Не работает /cuff

EvgeniuMurzak

Новичок
Автор темы
8
0
Не работает /cuff, не знаю как поставить переменную в sampSend Chat. Самы отыгровки работают, а /cuff не ставит то то я введу

Вот код

function cmd_cuff(arg)
thread:run("cuff")
end

function thread_function(cuff)
sampSendChat("/me быстрым движением руки, открыл подсумок")
wait(1200)
sampSendChat("/me достав из подсумка наручники, накинул их на кисти преступника")
wait(1200)
sampSendChat(/cuff .. arg)
end
 

Licht

Известный
238
32
Не работает /cuff, не знаю как поставить переменную в sampSend Chat. Самы отыгровки работают, а /cuff не ставит то то я введу

Вот код

function cmd_cuff(arg)
thread:run("cuff")
end

function thread_function(cuff)
sampSendChat("/me быстрым движением руки, открыл подсумок")
wait(1200)
sampSendChat("/me достав из подсумка наручники, накинул их на кисти преступника")
wait(1200)
sampSendChat(/cuff .. arg)
end
Kод можно сделать проще и лучше
...
function cuff(param)
id = tonumber(param)
if param then
if id ~= nil then
sampSendChat("/me быстрым движением руки, открыл подсумок")
wait(1200)
sampSendChat("/me достав из подсумка наручники, накинул их на кисти преступника")
wait(1200)
sampSendChat('/cuff '..id)
else
sampAddChatMessage('Надеть наручники', -1)
end
end
end
____________________________________
 
Последнее редактирование:

Licht

Известный
238
32
досихпор не работает
Lua:
function cuff(param)
id = tonumber(param)
if param then
if id ~= nil then
sampSendChat("/me быстрым движением руки, открыл подсумок")
wait(1200)
sampSendChat("/me достав из подсумка наручники, накинул их на кисти преступника")
wait(1200)
sampSendChat('/cuff '..id)
else
sampAddChatMessage('Надеть наручники', -1)
end
end
end

это попробуй
 

aim.cfg

Участник
37
4
Lua:
function main()
repeat wait(100) until isSampAvailable()
sampRegisterChatCommand("lol", cmd_cuff)
while true do wait(0)
end
end

function cmd_cuff(arg)
lua_thread.create(function()
sampSendChat("/me быстрым движением руки, открыл подсумок")
wait(1200)
sampSendChat("/me достав из подсумка наручники, накинул их на кисти преступника")
wait(1200)
sampSendChat(string.format( "/cuff %s",arg ))
end)
end
так не пробовал?

Lua:
function cuff(param)
id = tonumber(param)
if param then
if id ~= nil then
sampSendChat("/me быстрым движением руки, открыл подсумок")
wait(1200)
sampSendChat("/me достав из подсумка наручники, накинул их на кисти преступника")
wait(1200)
sampSendChat('/cuff '..id)
else
sampAddChatMessage('Надеть наручники', -1)
end
end
end

это попробуй
у него краш будет из-за wait -_- и зачем всё объясняешь пускай сам учится.
 

EvgeniuMurzak

Новичок
Автор темы
8
0
Lua:
function main()
repeat wait(100) until isSampAvailable()
sampRegisterChatCommand("lol", cmd_cuff)
while true do wait(0)
end
end

function cmd_cuff(arg)
lua_thread.create(function()
sampSendChat("/me быстрым движением руки, открыл подсумок")
wait(1200)
sampSendChat("/me достав из подсумка наручники, накинул их на кисти преступника")
wait(1200)
sampSendChat(string.format( "/cuff %s",arg ))
end)
end
так не пробовал?


у него краш будет из-за wait -_- и зачем всё объясняешь пускай сам учится.
я все что мог выучить выучил но оно не работает по этому я и прошу поооомооощииии
 

EvgeniuMurzak

Новичок
Автор темы
8
0
Скинь весь код, мб в нём трабл
script_name('FirstScript')
script_author('MyMomFuckiNGay')
script_description('This is very cool script for mvd, man damn')

require "lib.moonloader"

local tag = "[MVD Helper]: "
sick = "/cuff"

function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait{100} end

sampRegisterChatCommand("cuff", cmd_cuff)

thread = lua_thread.create_suspended(thread_function)

sampAddChatMessage(tag .. "Помощник МВД работает успешно!", 0x1A00FF)

while true do
wait (0)

end
end

function cmd_cuff(id)
thread:run(id)
end

function thread_function(id)
sampSendChat("/me быстрым движением руки, открыл подсумок")
wait(1200)
sampSendChat("/me достав наручники из подсумка, накинул их на кисти")
wait(1200)
sampSendChat("/cuff id")
end
 

aim.cfg

Участник
37
4
script_name('FirstScript')
script_author('MyMomFuckiNGay')
script_description('This is very cool script for mvd, man damn')

require "lib.moonloader"

local tag = "[MVD Helper]: "
sick = "/cuff"

function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait{100} end

sampRegisterChatCommand("cuff", cmd_cuff)

thread = lua_thread.create_suspended(thread_function)

sampAddChatMessage(tag .. "Помощник МВД работает успешно!", 0x1A00FF)

while true do
wait (0)

end
end

function cmd_cuff(id)
thread:run(id)
end

function thread_function(id)
sampSendChat("/me быстрым движением руки, открыл подсумок")
wait(1200)
sampSendChat("/me достав наручники из подсумка, накинул их на кисти")
wait(1200)
sampSendChat("/cuff id")
end
Lua:
script_name('FirstScript')
script_author('MyMomFuckiNGay')
script_description('This is very cool script for mvd, man damn')

require "lib.moonloader"

local tag = "[MVD Helper]: "
local sick = "/cuff"

function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait{100} end
sampRegisterChatCommand("cuff", cmd_cuff)
sampAddChatMessage(tag .. "Помощник МВД работает успешно!", 0x1A00FF)
while true do wait(0)
end
end

function cmd_cuff(id)
if id ~= nil then
arg = tonumber(id)
if arg ~= nil then
lua_thread.create(function()
sampSendChat("/me быстрым движением руки, открыл подсумок")
wait(1200)
sampSendChat("/me достав наручники из подсумка, накинул их на кисти")
wait(1200)
sampSendChat(string.format( "cuff %d",arg))
end)
end
end
Я сам проверил, у меня всё работает отлично.
 

EvgeniuMurzak

Новичок
Автор темы
8
0
Lua:
script_name('FirstScript')
script_author('MyMomFuckiNGay')
script_description('This is very cool script for mvd, man damn')

require "lib.moonloader"

local tag = "[MVD Helper]: "
local sick = "/cuff"

function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait{100} end
sampRegisterChatCommand("cuff", cmd_cuff)
sampAddChatMessage(tag .. "Помощник МВД работает успешно!", 0x1A00FF)
while true do wait(0)
end
end

function cmd_cuff(id)
if id ~= nil then
arg = tonumber(id)
if arg ~= nil then
lua_thread.create(function()
sampSendChat("/me быстрым движением руки, открыл подсумок")
wait(1200)
sampSendChat("/me достав наручники из подсумка, накинул их на кисти")
wait(1200)
sampSendChat(string.format( "cuff %d",arg))
end)
end
end
Я сам проверил, у меня всё работает отлично.
Спасибо, я сам решил проблему.
У меня вышло так: я добавил переменную sick = "/cuff"
И сделал sampSendChat(sick .. id)

Спасибо что пытались помочь, ребята.