Aleada
Unknown Member
- Joined
- Mar 14, 2013
- Messages
- 231
- Reaction score
- 7
Heya everyone, I'm trying to make a script that indicates you're afk when you declare it. It will also show the message you want to display every interval on the specified time:
The only thing is at line 28, I don't know how to make a wait/pause in LUA :/
If anyone can help, that'd be great!
Thank you!
Code:
function onSay(cid, words, param, channel)
local interval = 5
local words = ""
local pos = getPlayerPosition(cid)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Why are you going AFK?")
return true
elseif(param == 'off') then
if (getPlayerStorageValue(cid, 9876) == 1) then
doSendAnimatedText(getPlayerPosition(cid), "I'm back!", 200)
setPlayerStorageValue(cid, 9876, 0)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You weren't ever AFK")
end
else
if (getPlayerStorageValue(cid, 9876) == 0) then
words = param
doSendAnimatedText(getPlayerPosition(cid), "Brb!", 200)
setPlayerStorageValue(cid, 9876, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are already AFK")
end
end
while (getPlayerStorageValue(cid, 9876) == 1) do
doSendAnimatedText(getPlayerPosition(cid), words, 200)
pause(time*1000)
end
return true
end
The only thing is at line 28, I don't know how to make a wait/pause in LUA :/
If anyone can help, that'd be great!