[Урок Lua] Random - Форум Cheat-Master.ru
  • Страница 1 из 1
  • 1
Модератор форума: Admin_Bot, Admin_Bot2, Admin_Bot3, Admin_Bot4  
[Урок Lua] Random
[CM]SeveN[Tawer] Дата: Среда, 21.06.2017, 11:32 | Сообщение # 1
Новичок
Сообщений: 12
Статус: Offline
Код
function main()
    if not isSampfuncsLoaded() or not isSampLoaded() then return end  -- Проверка на загруженный самп
    while not isSampAvailable() do wait(100) end
     sampRegisterChatCommand("rtext", random1) -- Рег. Кмд.
     wait(-1)
end

function random1() -- Cmd
local textA = math.random(0,2) -- Мин число 0, макс число 2
if textA == 0 then -- Если выпало число 0, то
   sampfuncsLog("{ad1d1d}Text") -- Добавляем лог с красным цветом
else
     if textA == 1 then -- Если 1, то
       sampfuncsLog("{2fb7dd}Text2") -- С синим
     else
         if textA == 2 then -- А если 2, то
           sampfuncsLog("{2fdd35}Text3") -- С зеленым
         end
     end
end
end


:)


[url='https://vk.com/damonx'][img]https://i.imgur.com/9gF7zX3.jpg[/img][/url][url='http://cheat-master.ru/index/8-465304'][img]https://i.imgur.com/L0c5cva.jpg[/img][/url]
Alowir Дата: Вторник, 26.06.2018, 00:44 | Сообщение # 2
Сообщений: 774
Статус: Offline
  • Страница 1 из 1
  • 1
Поиск:
Статистика Форума