I need this script fixed...I want it to be able to send an item to a player thats offline.
Please help!
Code:
function onSay(cid, words, param)
if string.explode(param, ',') then
if(#params <= 1) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You need to say !orbs playername, amount")
return true
end
local player = db.getResult('SELECT `name`, `online` FROM `players` WHERE `name` = "' .. params[1] .. '";')
if(player:getID() == -1) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, 'playerNotFound')
end
if(player:getID() >= 1) then
doPlayerAddItem(player, 2157, params[2])
doPlayerPopupFYI(player, "You have recived orbs!")
else
doPlayerPopupFYI(cid, "This is not a player!")
end
end
return true
end
Please help!