- 23
- 0
Всем привет. Написал белиберду, нужна помощь.
samp = require 'samp.events'
cmds = {
['/slap'] = '/sl'
['/spawn'] = '/sp'
['/unjail'] = '/uj'
['/getstats'] = '/st'
['/astats'] = '/ast'
['/agm'] = '/gm'
['/togpone'] = '/togp'
['/freeze'] = '/fr'
['/unfreeze'] = '/ufr'
['/mute'] = '/mt'
['/rmute'] = '/rmt'
['/jail'] = '/j'
['/forceskin'] = '/frsk'
['/fuelcars'] = '/fc'
['/spveh'] = '/sph'
['/kickpb'] = '/kpb'
['/mpwin'] = '/mw'
['/givegun'] = '/ggun'
['/agm'] = '/gm'
['/agm'] = '/gm'
}
function samp.onSendCommand(cmd)
local c = cmd:match('^(.*)%s-.-$')
if cmds[c] then
cmd = cmd:gsub(c, cmds[c], 1)
end
return { cmd }
end
Вообщем для некоторых команд нужно вводить айди. Помогите. (Плохо шарю в Lua)
samp = require 'samp.events'
cmds = {
['/slap'] = '/sl'
['/spawn'] = '/sp'
['/unjail'] = '/uj'
['/getstats'] = '/st'
['/astats'] = '/ast'
['/agm'] = '/gm'
['/togpone'] = '/togp'
['/freeze'] = '/fr'
['/unfreeze'] = '/ufr'
['/mute'] = '/mt'
['/rmute'] = '/rmt'
['/jail'] = '/j'
['/forceskin'] = '/frsk'
['/fuelcars'] = '/fc'
['/spveh'] = '/sph'
['/kickpb'] = '/kpb'
['/mpwin'] = '/mw'
['/givegun'] = '/ggun'
['/agm'] = '/gm'
['/agm'] = '/gm'
}
function samp.onSendCommand(cmd)
local c = cmd:match('^(.*)%s-.-$')
if cmds[c] then
cmd = cmd:gsub(c, cmds[c], 1)
end
return { cmd }
end
Вообщем для некоторых команд нужно вводить айди. Помогите. (Плохо шарю в Lua)