Маленький вопрос по ЛУА

Флэмч

Участник
Автор темы
77
1
Нужно, чтобы наказания выдавались по ИД, заменяю ..nick.. на ..id.. не помогло, что сделать можно?


Lua:
require "lib.moonloader"
local imgui = require 'imgui'
local encoding = require 'encoding'
local sampev = require 'lib.samp.events'
encoding.default = 'CP1251'
u8 = encoding.UTF8

local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8

function main()
repeat wait(0) until isSampAvailable()
sampAddChatMessage("{FF4545}[!] {FFFFFF}Сокращение админ-команд для выдачи определенных наказаний", -1)
sampRegisterChatCommand('smg', smg)
sampRegisterChatCommand('bc', bc)
sampRegisterChatCommand('mf', mf)
sampRegisterChatCommand('nvz', nvz)
sampRegisterChatCommand('mg', mg)
sampRegisterChatCommand('tr', tr)
sampRegisterChatCommand('caps', caps)
sampRegisterChatCommand('upom', upom)
sampRegisterChatCommand('osk', osk)
sampRegisterChatCommand('rekl', rekl)
sampRegisterChatCommand('oskpr', oskpr)
sampRegisterChatCommand('cp', cp)
sampRegisterChatCommand('opr', opr)
sampRegisterChatCommand('dm', dm)
sampRegisterChatCommand('db', db)
sampRegisterChatCommand('sk', sk)
sampRegisterChatCommand('tk', tk)
sampRegisterChatCommand('sbiv', sbiv)
sampRegisterChatCommand('ncop', ncop)
sampRegisterChatCommand('nvoj', nvoj)
sampRegisterChatCommand('ntune', ntune)
sampRegisterChatCommand('sp', sp)
sampRegisterChatCommand('gunzz', gunzz)
sampRegisterChatCommand('zz', zz)
sampRegisterChatCommand('csten', csten)
sampRegisterChatCommand('cigr', cigr)
sampRegisterChatCommand('vpp', vpp)
sampRegisterChatCommand('gh', gh)
sampRegisterChatCommand('ghc', ghc)
sampRegisterChatCommand('krupa', krupa)
sampRegisterChatCommand('afk', afk)
sampRegisterChatCommand('afk50', afk50)
sampRegisterChatCommand('gg', gg)
sampRegisterChatCommand('wt', wt)
sampRegisterChatCommand('rpm', rpm)
sampRegisterChatCommand('oz', oz)
sampRegisterChatCommand('prov', prov)
sampRegisterChatCommand('ncb', ncb)
sampRegisterChatCommand('roof', roof)
sampRegisterChatCommand('nak', nak)
sampRegisterChatCommand('fl', fl)
sampRegisterChatCommand('uj', uj)
sampRegisterChatCommand('nick', nick)
sampRegisterChatCommand('ibc', ibc)
sampRegisterChatCommand('rmg', rmg)
sampRegisterChatCommand('zp', zp)
sampRegisterChatCommand('nfl', nfl)

while true do
wait(0)

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".ыьп" then
sampSetChatInputText("/smg")
end
end

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".ис" then
sampSetChatInputText("/bc")
end
end

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".ьа" then
sampSetChatInputText("/mf")
end
end

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".тмя" then
sampSetChatInputText("/nvz")
end
end

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".ьп" then
sampSetChatInputText("/mg")
end
end

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".ек" then
sampSetChatInputText("/tr")
end
end

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".сфзы" then
sampSetChatInputText("/caps")
end
end 

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".гзщь" then
sampSetChatInputText("/upom")
end
end 

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".щыл" then
sampSetChatInputText("/osk")
end
end

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".кулд" then
sampSetChatInputText("/rekl")
end
end 

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".щылзк" then
sampSetChatInputText("/oskpr")
end
end

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".сз" then
sampSetChatInputText("/cp")
end
end 

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".щзк" then
sampSetChatInputText("/opr")
end
end

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".вь" then
sampSetChatInputText("/dm")
end
end 

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".ви" then
sampSetChatInputText("/db")
end
end 

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".ыл" then
sampSetChatInputText("/sk")
end
end 

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".ел" then
sampSetChatInputText("/tk")
end
end

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".ыишм" then
sampSetChatInputText("/sbiv")
end
end 

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".тсщз" then
sampSetChatInputText("/ncop")
end
end 

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".тмщо" then
sampSetChatInputText("/nvoj")
end
end

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".тегту" then
sampSetChatInputText("/ntune")
end
end 

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".ыз" then
sampSetChatInputText("/sp")
end
end 

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".пгтяя" then
sampSetChatInputText("/gunzz")
end
end

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".яя" then
sampSetChatInputText("/zz")
end
end 

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".сыеут" then
sampSetChatInputText("/csten")
end
end 

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".сшпк" then
sampSetChatInputText("/cigr")
end
end

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".мзз" then
sampSetChatInputText("/vpp")
end
end 

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".пр" then
sampSetChatInputText("/gh")
end
end 

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".прс" then
sampSetChatInputText("/ghc")
end
end

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".лкгзф" then
sampSetChatInputText("/krupa")
end
end 

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".фал" then
sampSetChatInputText("/afk")
end
end 

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".фал50" then
sampSetChatInputText("/afk50")
end
end

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".пп" then
sampSetChatInputText("/gg")
end
end 

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".щя" then
sampSetChatInputText("/oz")
end
end

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".зкщм" then
sampSetChatInputText("/prov")
end
end 

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".тси" then
sampSetChatInputText("/ncb")
end
end 

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".кщща" then
sampSetChatInputText("/roof")
end
end

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".тфл" then
sampSetChatInputText("/nak")
end
end 

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".ад" then
sampSetChatInputText("/fl")
end
end 

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".го" then
sampSetChatInputText("/uj")
end
end

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".тшсл" then
sampSetChatInputText("/nick")
end
end 

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".шис" then
sampSetChatInputText("/ibc")
end
end                                 

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".кьп" then
sampSetChatInputText("/rmg")
end
end

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".яз" then
sampSetChatInputText("/zp")
end
end  

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".це" then
sampSetChatInputText("/wt")
end
end

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".кзь" then
sampSetChatInputText("/rpm")
end
end

if sampIsChatInputActive() then
chattext = sampGetChatInputText()
if chattext == ".тад" then
sampSetChatInputText("/nfl")
end
end    

end

end

function rmg(id)
if id == "" then
sampAddChatMessage("{FF4545}[!] {FFFFFF}Используй /rmg id", -1)
else
local result = sampIsPlayerConnected(id)
if not result then
sampAddChatMessage("{FF4545}[!] {FFFFFF}Игрок не в игре.", -1)
else
local nick = sampGetPlayerNickname(id)
lua_thread.create(function() wait(0)

sampSendChat(u8'/mute '..id..', 30 MetaGaming in /rda.', -1)
end)
end
end
end

function uj(id)
if id == "" then
sampAddChatMessage("{FF4545}[!] {FFFFFF}Используй /uj id", -1)
else
local result = sampIsPlayerConnected(id)
if not result then
sampAddChatMessage("{FF4545}[!] {FFFFFF}Игрок не в игре.", -1)
else
local nick = sampGetPlayerNickname(id)
sampSendChat(u8'/unjail '..id.. -1)
sampSendChat(u8'/pm '..id..', Приятной', -1)
end
end
end

function nak(id)
if id == "" then
sampAddChatMessage("{FF4545}[!] {FFFFFF}Используй /nak id", -1)
else
local result = sampIsPlayerConnected(id)
if not result then
sampAddChatMessage("{FF4545}[!] {FFFFFF}Игрок не в игре.", -1)
else
local nick = sampGetPlayerNickname(id)
sampSendChat(u8'/pm '..id..', Наказать не можем. Возможно была провокация, не видели всего.', -1)
sampSendChat(u8'/pm '..id..', Вы можете написать жалобу на форум. ', -1)
end
end
end

function gh(id)
if id == "" then
sampAddChatMessage("{FF4545}[!] {FFFFFF}Используй /gh id", -1)
else
local result = sampIsPlayerConnected(id)
if not result then
sampAddChatMessage("{FF4545}[!] {FFFFFF}Игрок не в игре.", -1)
else
local nick = sampGetPlayerNickname(id)
sampSendChat(u8'/gethere '..id.. -1)
end
end
end

function vpp(id)
if id == "" then
sampAddChatMessage("{FF4545}[!] {FFFFFF}Используй /vpp id", -1)
else
local result = sampIsPlayerConnected(id)
if not result then
sampAddChatMessage("{FF4545}[!] {FFFFFF}Игрок не в игре.", -1)
else
local nick = sampGetPlayerNickname(id)
sampSendChat(u8'/pm '..id..', Если это действительно Ваш аккаунт, составьте жалобу на форум.', -1)
sampSendChat(u8'/ban '..id..', 30 Продан | передан | взломан', -1)
end
end
end

function cigr(id)
if id == "" then
sampAddChatMessage("{FF4545}[!] {FFFFFF}Используй /cigr id", -1)
else
local result = sampIsPlayerConnected(id)
if not result then
sampAddChatMessage("{FF4545}[!] {FFFFFF}Игрок не в игре.", -1)
else
local nick = sampGetPlayerNickname(id)
lua_thread.create(function() wait(0)

sampSendChat(u8'/warn '..id..', +С в игрока', -1)
end)
end
end
end

function csten(id)
if id == "" then
sampAddChatMessage("{FF4545}[!] {FFFFFF}Используй /csten id", -1)
else
local result = sampIsPlayerConnected(id)
if not result then
sampAddChatMessage("{FF4545}[!] {FFFFFF}Игрок не в игре.", -1)
else
local nick = sampGetPlayerNickname(id)
lua_thread.create(function() wait(0)

sampSendChat(u8'/jail '..id..', 60 +С в стену / воздух', -1)
end)
end
end
end

function zz(id)
if id == "" then
sampAddChatMessage("{FF4545}[!] {FFFFFF}Используй /zz id", -1)
else
local result = sampIsPlayerConnected(id)
if not result then
sampAddChatMessage("{FF4545}[!] {FFFFFF}Игрок не в игре.", -1)
else
local nick = sampGetPlayerNickname(id)
lua_thread.create(function() wait(0)
sampSendChat(u8'/warn '..id..', DeathMatch in GZ', -1)
end)
end
end
end

function sp(id)
if id == "" then
sampAddChatMessage("{FF4545}[!] {FFFFFF}Используй /sp id", -1)
else
local result = sampIsPlayerConnected(id)
if not result then
sampAddChatMessage("{FF4545}[!] {FFFFFF}Игрок не в игре.", -1)
else
local nick = sampGetPlayerNickname(id)
sampSendChat(u8'/spawnp '..id.. -1)
sampSendChat(u8'/pm '..id..', Приятной игры на arp', -1)
end
end
end

function ncop(id)
if id == "" then
sampAddChatMessage("{FF4545}[!] {FFFFFF}Используй /ncop id", -1)
else
local result = sampIsPlayerConnected(id)
if not result then
sampAddChatMessage("{FF4545}[!] {FFFFFF}Игрок не в игре.", -1)
else
local nick = sampGetPlayerNickname(id)
lua_thread.create(function() wait(0)
sampSendChat(u8'/warn '..id..', NonRole Play Cop.', -1)
end)
end
end
end

function sbiv(id)
if id == "" then
sampAddChatMessage("{FF4545}[!] {FFFFFF}Используй /sbiv id", -1)
else
local result = sampIsPlayerConnected(id)
if not result then
sampAddChatMessage("{FF4545}[!] {FFFFFF}Игрок не в игре.", -1)
else
local nick = sampGetPlayerNickname(id)
lua_thread.create(function() wait(0)
sampSendChat(u8'/warn '..id..', Сбив анимации', -1)
end)
end
end
end

function tr(id)
if id == "" then
sampAddChatMessage("{FF4545}[!] {FFFFFF}Используй /tr id", -1)
else
local result = sampIsPlayerConnected(id)
if not result then
sampAddChatMessage("{FF4545}[!] {FFFFFF}Игрок не в игре.", -1)
else
local nick = sampGetPlayerNickname(id)
lua_thread.create(function() wait(0)
sampSendChat(u8'/mute '..id..', 30 Транслит', -1)
end)
end
end
end