Skyfer
Member
how to add loop in a cmd code, my game crash when i add any kind of loop in the code like
while true do or repeat until
example:
while true do or repeat until
example:
Code:
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
sampRegisterChatCommand("mycmd", cmd_mycmd)
wait(-1)
end
function cmd_mycmd(arg)
if #arg == 0 then
sampAddChatMessage("{{FF0000}Empty", -1)
else
sampAddChatMessage("{{FF0000}loop", -1)
while true do
sampAddChatMessage("{{FF0000}loop", -1)
end
end
end