kito2
www.masteria.net
Hi everyone, well, here is a script to add points if player is online, it works like: /addpoints kito, 50 and it will add 50 points if you are online, but if you are offline, it wont do that, so I need help, can someone fix this script and make available to add points if player is offline too?
Thanks.
PHP:
function onSay(cid, words, param)
if(param == "") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
return TRUE
end
local t = string.explode(param, ",")
if(not t[2]) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Not enough params.")
return TRUE
end
local target = getPlayerByName(t[1])
if target ~= 0 then
doAddPoints(target, t[2])
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, target.." has received "..t[2].." premium points.")
doPlayerSendTextMessage(target, MESSAGE_STATUS_CONSOLE_BLUE, "You have received "..t[2].." premium points.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player is offline or does not exist.")
end
return FALSE
end
Thanks.