Вопросы по Lua скриптингу

Общая тема для вопросов по разработке скриптов на языке программирования Lua, в частности под MoonLoader.
  • Задавая вопрос, убедитесь, что его нет в списке частых вопросов и что на него ещё не отвечали (воспользуйтесь поиском).
  • Поищите ответ в теме посвященной разработке Lua скриптов в MoonLoader
  • Отвечая, убедитесь, что ваш ответ корректен.
  • Старайтесь как можно точнее выразить мысль, а если проблема связана с кодом, то обязательно прикрепите его к сообщению, используя блок [code=lua]здесь мог бы быть ваш код[/code].
  • Если вопрос связан с MoonLoader-ом первым делом желательно поискать решение на wiki.

Частые вопросы

Как научиться писать скрипты? С чего начать?
Информация - Гайд - Всё о Lua скриптинге для MoonLoader(https://blast.hk/threads/22707/)
Как вывести текст на русском? Вместо русского текста у меня какие-то каракули.
Изменить кодировку файла скрипта на Windows-1251. В Atom: комбинация клавиш Ctrl+Shift+U, в Notepad++: меню Кодировки -> Кодировки -> Кириллица -> Windows-1251.
Как получить транспорт, в котором сидит игрок?
Lua:
local veh = storeCarCharIsInNoSave(PLAYER_PED)
Как получить свой id или id другого игрока?
Lua:
local _, id = sampGetPlayerIdByCharHandle(PLAYER_PED) -- получить свой ид
local _, id = sampGetPlayerIdByCharHandle(ped) -- получить ид другого игрока. ped - это хендл персонажа
Как проверить, что строка содержит какой-то текст?
Lua:
if string.find(str, 'текст', 1, true) then
-- строка str содержит "текст"
end
Как эмулировать нажатие игровой клавиши?
Lua:
local game_keys = require 'game.keys' -- где-нибудь в начале скрипта вне функции main

setGameKeyState(game_keys.player.FIREWEAPON, -1) -- будет сэмулировано нажатие клавиши атаки
Все иды клавиш находятся в файле moonloader/lib/game/keys.lua.
Подробнее о функции setGameKeyState здесь: lua - setgamekeystate | BlastHack — DEV_WIKI(https://www.blast.hk/wiki/lua:setgamekeystate)
Как получить id другого игрока, в которого целюсь я?
Lua:
local valid, ped = getCharPlayerIsTargeting(PLAYER_HANDLE) -- получить хендл персонажа, в которого целится игрок
if valid and doesCharExist(ped) then -- если цель есть и персонаж существует
  local result, id = sampGetPlayerIdByCharHandle(ped) -- получить samp-ид игрока по хендлу персонажа
  if result then -- проверить, прошло ли получение ида успешно
    -- здесь любые действия с полученным идом игрока
  end
end
Как зарегистрировать команду чата SAMP?
Lua:
-- До бесконечного цикла/задержки
sampRegisterChatCommand("mycommand", function (param)
     -- param будет содержать весь текст введенный после команды, чтобы разделить его на аргументы используйте string.match()
    sampAddChatMessage("MyCMD", -1)
end)
Крашит игру при вызове sampSendChat. Как это исправить?
Это происходит из-за бага в SAMPFUNCS, когда производится попытка отправки пакета определенными функциями изнутри события исходящих RPC и пакетов. Исправления для этого бага нет, но есть способ не провоцировать его. Вызов sampSendChat изнутри обработчика исходящих RPC/пакетов нужно обернуть в скриптовый поток с нулевой задержкой:
Lua:
function onSendRpc(id)
  -- крашит:
  -- sampSendChat('Send RPC: ' .. id)

  -- норм:
  lua_thread.create(function()
    wait(0)
    sampSendChat('Send RPC: ' .. id)
  end)
end
 
Последнее редактирование:

M0rtelli

Участник
34
6
нужна помощь по регулярным выражениям.
у меня всегда были проблемы с ними, сейчас не исключение.
суть: у меня есть
Lua:
imgui.InputTextMultiline("##земля мне пухом", nakazaniya, imgui.ImVec2(300, 400))
туда я ввожу формы. например:
/offjail Test_Test 30 test
/offmute Test_Test 60 просто так
мне нужно достать введенные наказания и отправить в чат.
 

Fott

Простреленный
3,444
2,306
Лог:
[ML] (error) LiteHelper: ...86)\НОВАЯ СБОРКА ЗИМНЯЯ РИНЖИ\moonloader\LiteHelper.luac:0: attempt to index upvalue '' (a nil value)
stack traceback:
...86)\НОВАЯ СБОРКА ЗИМНЯЯ РИНЖИ\moonloader\LiteHelper.luac: in function <...86)\НОВАЯ СБОРКА ЗИМНЯЯ РИНЖИ\moonloader\LiteHelper.luac:0>
[ML] (error) LiteHelper: Script died due to an error. (14F3B98C)
Автор ошибся в коде, либо конфиг сломался. И вообще это тема по вопросам по разработке, а не "почему у меня не работает чей то скрипт"
 

s3nder_

Известный
61
82
Lua:
local samem = require('SAMemory')
samem.require 'CVehicle'
function main()
    repeat wait(0) until isSampAvailable()
    while true do
        wait(0)
        if isKeyJustPressed(82) and not sampIsCursorActive() then
            if isCharInAnyCar(PLAYER_PED) and not isCharDead(PLAYER_PED) then
                local veh = samem.player_vehicle[0]
                if veh ~= samem.nullptr then
                    local matrix = veh.pMatrix
                    matrix.up = -matrix.up
                end
            end
        end
    end
end

на букву R флипнет.
Зачем так сложно?Можно сделать намного проще обычными функциями

Lua:
require 'moonloader'

function main()
    repeat wait(0) until isSampAvailable()
    while true do wait(0)
        if isKeyJustPressed(VK_R) and isCharInAnyCar(PLAYER_PED) then
            setCarHeading(getCarCharIsUsing(PLAYER_PED), getCarHeading(getCarCharIsUsing(PLAYER_PED)))
        end
    end
end
 
  • Нравится
Реакции: Korya и Gorskin

copypaste_scripter

Известный
1,218
225
открыл скрипт написанный в ноутпад++ через атом, после сохранении тупо иероглифи пишет, я удалил атом, что делать со скриптом? там дофига текста по русскому...
 

s3nder_

Известный
61
82
открыл скрипт написанный в ноутпад++ через атом, после сохранении тупо иероглифи пишет, я удалил атом, что делать со скриптом? там дофига текста по русскому...
надо было кодировку в Atom поставить Windows 1251
 

tsunamiqq

Участник
429
16
Что делать если тип, когда вписал sampSendChat и кмд, ну у меня при наводке на игрока открывается меню, я открываю меню и у меня тупо флудит кмд в чат, как это исправить?
 

tsunamiqq

Участник
429
16
Не юзать это в цикле
Lua:
function imgui.CenterColumnText(text)
        imgui.SetCursorPosX((imgui.GetColumnOffset() + (imgui.GetColumnWidth() / 2)) - imgui.CalcTextSize(text).x / 2)
        imgui.Text(text)
    end

    if interaction_window_state.v then
        imgui.SetNextWindowSize(imgui.ImVec2(900, 350), imgui.Cond.FirstUseEver)
        imgui.Begin(u8'Взаимодействие', interaction_window_state, imgui.WindowFlags.NoResize + imgui.WindowFlags.NoCollapse)
        imgui.BeginChild('##121', imgui.ImVec2(270, 300), true)
        imgui.Text(u8(sampGetPlayerNickname(actionId)))
        imgui.Separator()
        imgui.Columns(2, "columns", true)
        imgui.CenterColumnText(u8'O?aeoey:')
        imgui.NextColumn()
        imgui.CenterColumnText(u8(sampGetPlayerScore(actionId)))
        imgui.Separator()
        imgui.NextColumn()
        imgui.CenterColumnText(u8'O?aeoey:')
        imgui.NextColumn()
        imgui.CenterColumnText(u8((actionId)))
        imgui.Separator()
        imgui.NextColumn()
        imgui.CenterColumnText(u8'O?aeoey:')
        imgui.NextColumn()
        imgui.CenterColumnText(u8(sampGetPlayerOrganisation(actionId)))
        imgui.Separator()
        imgui.NextColumn()
        imgui.CenterColumnText(u8'O?aeoey:')
        imgui.NextColumn()
        imgui.CenterColumnText(u8(sampGetPlayerHealth(actionId)))
        imgui.Separator()
        imgui.NextColumn()
        imgui.CenterColumnText(u8'O?aeoey:')
        imgui.NextColumn()
        imgui.CenterColumnText(u8(sampGetPlayerArmor(actionId)))
        imgui.Separator()
        imgui.NextColumn()
        imgui.CenterColumnText(u8'O?aeoey:')
        imgui.NextColumn()
        imgui.CenterColumnText(u8((actionId)))
        imgui.Separator()
        imgui.NextColumn()
        imgui.CenterColumnText(u8'O?aeoey:')
        imgui.NextColumn()
        imgui.CenterColumnText(u8(sampGetPlayerPing(actionId)))
        imgui.Separator()
        imgui.NextColumn()
        imgui.CenterColumnText(u8'Скин')
        imgui.NextColumn()
        imgui.CenterColumnText(u8(sampGetPlayerSkin(actionId)))
        imgui.Separator()
        imgui.NextColumn()
        imgui.CenterColumnText(u8'AFK:')
        imgui.NextColumn()
        imgui.CenterColumnText(u8(sampGetPlayerPause(actionId)))
        imgui.Columns(1)
        imgui.Separator()
        imgui.NextColumn()
        imgui.Text(u8'Интерфейс и идея взята с Interaction Menu')
        imgui.Text(u8'Код сделан с нуля. Не взят с скрипта выше.')
        imgui.Text(u8'Меню подделано к скрипту Family Helper')
        imgui.EndChild()
        imgui.SameLine()
        if act == 0 then
            imgui.BeginChild('##once', imgui.ImVec2(320, 300), true)
            imgui.Button('Паспорт', imgui.ImVec2(150,25.7))
            imgui.SameLine()
            imgui.Button('Мед.карта', imgui.ImVec2(150,25.7))
            imgui.Button('Лицензии', imgui.ImVec2(150,25.7))
            imgui.SameLine()
            imgui.Button('Скиллы', imgui.ImVec2(150,25.7))
            imgui.Button('Передать ганы', imgui.ImVec2(150,25.7))
            imgui.SameLine()
            imgui.Button('Дать денег$', imgui.ImVec2(150,25.7))
            if imgui.Button('T        R        A        D        E', imgui.ImVec2(308, 50)) then act = 28 end
            imgui.Button('Принять в ОРГ.', imgui.ImVec2(150,25.7))
            imgui.SameLine()
            imgui.Button('Уволить с ОРГ.', imgui.ImVec2(150,25.7))
            imgui.Button('Выдать ранг в ОРГ.', imgui.ImVec2(150,25.7))
            imgui.SameLine()
            imgui.Button('Мут в ОРГ.', imgui.ImVec2(150,25.7))
            imgui.Button('Розмут в ОРГ.', imgui.ImVec2(150,25.7))
            imgui.SameLine()
            imgui.Button('Принять в семью', imgui.ImVec2(150,25.7))
            imgui.Button('Уволить из семьи', imgui.ImVec2(150,25.7))
            imgui.SameLine()
            imgui.Button('Выдать ранг в семьи', imgui.ImVec2(150,25.7))
            imgui.Button('Мут в семье', imgui.ImVec2(150,25.7))
            imgui.SameLine()
            imgui.Button('Розмут в семье', imgui.ImVec2(150,25.7))
            imgui.EndChild()
        elseif act == 28 then
            imgui.BeginChild('##twice', imgui.ImVec2(320, 300), true)
            sampSendChat('/trade '..actionId)
            imgui.EndChild()
        endф
        imgui.SameLine()
        imgui.BeginChild('##tabs2', imgui.ImVec2(270, 300), true)
        imgui.EndChild()
        imgui.End()
    end
    end
    local id = 0

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampAddChatMessage('[FamHelper] Aaoi? ne?eioa: Tsunami_Nakamura. Iiiiuiee: Adam_Karleone [ARIZONA 10]', 0x00BFFF)
    sampAddChatMessage('[FamHelper] Anou aii?inu? AE - lcn.maks', 0x00BFFF)
    sampAddChatMessage('[FamHelper] Aeoeaaoey ne?eioa: /famh', 0x00BFFF)
    sampAddChatMessage('[FamHelper] Iaoee aaa, eee ia ai?aaioeo? Iaieoeoa a AE', 0x00BFFF)
    sampRegisterChatCommand('famh', function() main_window_state.v = not main_window_state.v end)

    while true do wait(0)
        local valid, ped = getCharPlayerIsTargeting(PLAYER_HANDLE)
        if valid and doesCharExist(ped) then
            local result, id = sampGetPlayerIdByCharHandle(ped)
            if result and isKeyJustPressed(VK_E) then
                interaction_window_state.v = true
                actionId = id
            end
        end
        if checkbox.v then
            printStringNow('test', 1000)
        end
        imgui.Process = main_window_state.v or interaction_window_state.v
    end
end

function imgui.CenterTextColoredRGB(text)
    local width = imgui.GetWindowWidth()
    local style = imgui.GetStyle()
    local colors = style.Colors
    local ImVec4 = imgui.ImVec4
    end    

function yellowbtn()
        imgui.PushStyleColor(imgui.Col.Text, imgui.ImVec4(0, 0, 0, 0.8))
        imgui.PushStyleColor(imgui.Col.Button, imgui.ImVec4(1, 0.6, 0, 1))
        imgui.PushStyleColor(imgui.Col.ButtonHovered, imgui.ImVec4(1, 0.5, 0, 1))
        imgui.PushStyleColor(imgui.Col.ButtonActive, imgui.ImVec4(1, 0.4, 0, 1))
    end
function endbtn()
        imgui.PopStyleColor(4)
        style()
    end
    
function greybtn()
        imgui.PushStyleColor(imgui.Col.Button, imgui.ImVec4(0.4, 0.4, 0.4, 1))
        imgui.PushStyleColor(imgui.Col.ButtonHovered, imgui.ImVec4(0.3, 0.3, 0.3, 1))
        imgui.PushStyleColor(imgui.Col.ButtonActive, imgui.ImVec4(0.2, 0.2, 0.2, 1))
    end

    
function sampGetPlayerSkin(id)
    result, pedHandle = sampGetCharHandleBySampPlayerId(id)
    if result then
        skinId = getCharModel(pedHandle)
        return skinId
    end
end

function sampGetPlayerPause(playerId)
    if sampIsPlayerPaused(playerId) then 
        return tostring('??')
    else 
        return tostring('???')
    end
end

function sampGetPlayerOrganisation(playerId)
    if sampGetPlayerColor(actionId) == 2147502591 then 
        return tostring('Полиция')
    end
    if sampGetPlayerColor(actionId) == 2164227710 then 
        return tostring('Больница')
    end
    if sampGetPlayerColor(actionId) == 2160918272 then 
        return tostring('Мэрия')
    end
    if sampGetPlayerColor(actionId) == 2157536819 then 
        return tostring('Армия/ТСР')
    end
    if sampGetPlayerColor(actionId) == 2164221491 then 
        return tostring('Автошкола')
    end
    if sampGetPlayerColor(actionId) == 2164228096 then 
        return tostring('СМИ')
    end
    if sampGetPlayerColor(actionId) == 2150206647 then 
        return tostring('Банк ЛС')
    end
    if sampGetPlayerColor(actionId) == 2566951719 then 
        return tostring('Groove')
    end
    if sampGetPlayerColor(actionId) == 2580667164 then 
        return tostring('Vagos')
    end
    if sampGetPlayerColor(actionId) == 2580283596 then 
        return tostring('Ballas')
    end
    if sampGetPlayerColor(actionId) == 2566979554 then 
        return tostring('Aztec')
    end
    if sampGetPlayerColor(actionId) == 2573625087 then 
        return tostring('Rifa')
    end
    if sampGetPlayerColor(actionId) == 2155832420 then 
        return tostring('N.Wolves')
    end
    if sampGetPlayerColor(actionId) == 2573625087 then 
        return tostring('Yakuza')
    end
    if sampGetPlayerColor(actionId) == 2150852249 then 
        return tostring('Рус. Мафия')
    end
    if sampGetPlayerColor(actionId) == 2157523814 then 
        return tostring('LCN')
    end
    if sampGetPlayerColor(actionId) == 23486046 then 
        return tostring('*В маске*')
    end
    if sampGetPlayerColor(actionId) == 2149720609 then 
        return tostring('Хитманы')
    end
    return tostring('????')
end
 

copypaste_scripter

Известный
1,218
225
открыл скрипт написанный в ноутпад++ через атом, после сохранении тупо иероглифи пишет, я удалил атом, что делать со скриптом? там дофига текста по русскому...
плиз помогите ато вот весь скрипт так
1617384387264.png
 

Fott

Простреленный
3,444
2,306
Lua:
function imgui.CenterColumnText(text)
        imgui.SetCursorPosX((imgui.GetColumnOffset() + (imgui.GetColumnWidth() / 2)) - imgui.CalcTextSize(text).x / 2)
        imgui.Text(text)
    end

    if interaction_window_state.v then
        imgui.SetNextWindowSize(imgui.ImVec2(900, 350), imgui.Cond.FirstUseEver)
        imgui.Begin(u8'Взаимодействие', interaction_window_state, imgui.WindowFlags.NoResize + imgui.WindowFlags.NoCollapse)
        imgui.BeginChild('##121', imgui.ImVec2(270, 300), true)
        imgui.Text(u8(sampGetPlayerNickname(actionId)))
        imgui.Separator()
        imgui.Columns(2, "columns", true)
        imgui.CenterColumnText(u8'O?aeoey:')
        imgui.NextColumn()
        imgui.CenterColumnText(u8(sampGetPlayerScore(actionId)))
        imgui.Separator()
        imgui.NextColumn()
        imgui.CenterColumnText(u8'O?aeoey:')
        imgui.NextColumn()
        imgui.CenterColumnText(u8((actionId)))
        imgui.Separator()
        imgui.NextColumn()
        imgui.CenterColumnText(u8'O?aeoey:')
        imgui.NextColumn()
        imgui.CenterColumnText(u8(sampGetPlayerOrganisation(actionId)))
        imgui.Separator()
        imgui.NextColumn()
        imgui.CenterColumnText(u8'O?aeoey:')
        imgui.NextColumn()
        imgui.CenterColumnText(u8(sampGetPlayerHealth(actionId)))
        imgui.Separator()
        imgui.NextColumn()
        imgui.CenterColumnText(u8'O?aeoey:')
        imgui.NextColumn()
        imgui.CenterColumnText(u8(sampGetPlayerArmor(actionId)))
        imgui.Separator()
        imgui.NextColumn()
        imgui.CenterColumnText(u8'O?aeoey:')
        imgui.NextColumn()
        imgui.CenterColumnText(u8((actionId)))
        imgui.Separator()
        imgui.NextColumn()
        imgui.CenterColumnText(u8'O?aeoey:')
        imgui.NextColumn()
        imgui.CenterColumnText(u8(sampGetPlayerPing(actionId)))
        imgui.Separator()
        imgui.NextColumn()
        imgui.CenterColumnText(u8'Скин')
        imgui.NextColumn()
        imgui.CenterColumnText(u8(sampGetPlayerSkin(actionId)))
        imgui.Separator()
        imgui.NextColumn()
        imgui.CenterColumnText(u8'AFK:')
        imgui.NextColumn()
        imgui.CenterColumnText(u8(sampGetPlayerPause(actionId)))
        imgui.Columns(1)
        imgui.Separator()
        imgui.NextColumn()
        imgui.Text(u8'Интерфейс и идея взята с Interaction Menu')
        imgui.Text(u8'Код сделан с нуля. Не взят с скрипта выше.')
        imgui.Text(u8'Меню подделано к скрипту Family Helper')
        imgui.EndChild()
        imgui.SameLine()
        if act == 0 then
            imgui.BeginChild('##once', imgui.ImVec2(320, 300), true)
            imgui.Button('Паспорт', imgui.ImVec2(150,25.7))
            imgui.SameLine()
            imgui.Button('Мед.карта', imgui.ImVec2(150,25.7))
            imgui.Button('Лицензии', imgui.ImVec2(150,25.7))
            imgui.SameLine()
            imgui.Button('Скиллы', imgui.ImVec2(150,25.7))
            imgui.Button('Передать ганы', imgui.ImVec2(150,25.7))
            imgui.SameLine()
            imgui.Button('Дать денег$', imgui.ImVec2(150,25.7))
            if imgui.Button('T        R        A        D        E', imgui.ImVec2(308, 50)) then act = 28 end
            imgui.Button('Принять в ОРГ.', imgui.ImVec2(150,25.7))
            imgui.SameLine()
            imgui.Button('Уволить с ОРГ.', imgui.ImVec2(150,25.7))
            imgui.Button('Выдать ранг в ОРГ.', imgui.ImVec2(150,25.7))
            imgui.SameLine()
            imgui.Button('Мут в ОРГ.', imgui.ImVec2(150,25.7))
            imgui.Button('Розмут в ОРГ.', imgui.ImVec2(150,25.7))
            imgui.SameLine()
            imgui.Button('Принять в семью', imgui.ImVec2(150,25.7))
            imgui.Button('Уволить из семьи', imgui.ImVec2(150,25.7))
            imgui.SameLine()
            imgui.Button('Выдать ранг в семьи', imgui.ImVec2(150,25.7))
            imgui.Button('Мут в семье', imgui.ImVec2(150,25.7))
            imgui.SameLine()
            imgui.Button('Розмут в семье', imgui.ImVec2(150,25.7))
            imgui.EndChild()
        elseif act == 28 then
            imgui.BeginChild('##twice', imgui.ImVec2(320, 300), true)
            sampSendChat('/trade '..actionId)
            imgui.EndChild()
        endф
        imgui.SameLine()
        imgui.BeginChild('##tabs2', imgui.ImVec2(270, 300), true)
        imgui.EndChild()
        imgui.End()
    end
    end
    local id = 0

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    sampAddChatMessage('[FamHelper] Aaoi? ne?eioa: Tsunami_Nakamura. Iiiiuiee: Adam_Karleone [ARIZONA 10]', 0x00BFFF)
    sampAddChatMessage('[FamHelper] Anou aii?inu? AE - lcn.maks', 0x00BFFF)
    sampAddChatMessage('[FamHelper] Aeoeaaoey ne?eioa: /famh', 0x00BFFF)
    sampAddChatMessage('[FamHelper] Iaoee aaa, eee ia ai?aaioeo? Iaieoeoa a AE', 0x00BFFF)
    sampRegisterChatCommand('famh', function() main_window_state.v = not main_window_state.v end)

    while true do wait(0)
        local valid, ped = getCharPlayerIsTargeting(PLAYER_HANDLE)
        if valid and doesCharExist(ped) then
            local result, id = sampGetPlayerIdByCharHandle(ped)
            if result and isKeyJustPressed(VK_E) then
                interaction_window_state.v = true
                actionId = id
            end
        end
        if checkbox.v then
            printStringNow('test', 1000)
        end
        imgui.Process = main_window_state.v or interaction_window_state.v
    end
end

function imgui.CenterTextColoredRGB(text)
    local width = imgui.GetWindowWidth()
    local style = imgui.GetStyle()
    local colors = style.Colors
    local ImVec4 = imgui.ImVec4
    end   

function yellowbtn()
        imgui.PushStyleColor(imgui.Col.Text, imgui.ImVec4(0, 0, 0, 0.8))
        imgui.PushStyleColor(imgui.Col.Button, imgui.ImVec4(1, 0.6, 0, 1))
        imgui.PushStyleColor(imgui.Col.ButtonHovered, imgui.ImVec4(1, 0.5, 0, 1))
        imgui.PushStyleColor(imgui.Col.ButtonActive, imgui.ImVec4(1, 0.4, 0, 1))
    end
function endbtn()
        imgui.PopStyleColor(4)
        style()
    end
   
function greybtn()
        imgui.PushStyleColor(imgui.Col.Button, imgui.ImVec4(0.4, 0.4, 0.4, 1))
        imgui.PushStyleColor(imgui.Col.ButtonHovered, imgui.ImVec4(0.3, 0.3, 0.3, 1))
        imgui.PushStyleColor(imgui.Col.ButtonActive, imgui.ImVec4(0.2, 0.2, 0.2, 1))
    end

   
function sampGetPlayerSkin(id)
    result, pedHandle = sampGetCharHandleBySampPlayerId(id)
    if result then
        skinId = getCharModel(pedHandle)
        return skinId
    end
end

function sampGetPlayerPause(playerId)
    if sampIsPlayerPaused(playerId) then
        return tostring('??')
    else
        return tostring('???')
    end
end

function sampGetPlayerOrganisation(playerId)
    if sampGetPlayerColor(actionId) == 2147502591 then
        return tostring('Полиция')
    end
    if sampGetPlayerColor(actionId) == 2164227710 then
        return tostring('Больница')
    end
    if sampGetPlayerColor(actionId) == 2160918272 then
        return tostring('Мэрия')
    end
    if sampGetPlayerColor(actionId) == 2157536819 then
        return tostring('Армия/ТСР')
    end
    if sampGetPlayerColor(actionId) == 2164221491 then
        return tostring('Автошкола')
    end
    if sampGetPlayerColor(actionId) == 2164228096 then
        return tostring('СМИ')
    end
    if sampGetPlayerColor(actionId) == 2150206647 then
        return tostring('Банк ЛС')
    end
    if sampGetPlayerColor(actionId) == 2566951719 then
        return tostring('Groove')
    end
    if sampGetPlayerColor(actionId) == 2580667164 then
        return tostring('Vagos')
    end
    if sampGetPlayerColor(actionId) == 2580283596 then
        return tostring('Ballas')
    end
    if sampGetPlayerColor(actionId) == 2566979554 then
        return tostring('Aztec')
    end
    if sampGetPlayerColor(actionId) == 2573625087 then
        return tostring('Rifa')
    end
    if sampGetPlayerColor(actionId) == 2155832420 then
        return tostring('N.Wolves')
    end
    if sampGetPlayerColor(actionId) == 2573625087 then
        return tostring('Yakuza')
    end
    if sampGetPlayerColor(actionId) == 2150852249 then
        return tostring('Рус. Мафия')
    end
    if sampGetPlayerColor(actionId) == 2157523814 then
        return tostring('LCN')
    end
    if sampGetPlayerColor(actionId) == 23486046 then
        return tostring('*В маске*')
    end
    if sampGetPlayerColor(actionId) == 2149720609 then
        return tostring('Хитманы')
    end
    return tostring('????')
end
И что дальше? Я тебе уже объяснял
 

Vintik

Через тернии к звёздам
Проверенный
1,493
956
  • Нравится
Реакции: Fott