Maxwel1
Legend Of Everything
PHP:
function onSay(cid, words, param)
if (param ~= "") then
if (words == "/reward") then
local player = getPlayerByName(param)
if (isPlayer(player) == TRUE) then
if (getPlayerPromotionLevel(player) <= 1) then
setPlayerPromotionLevel(player,getPlayerPromotionLevel(player)+2)
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"You have changed ".. param .."\'s vocation (reward).")
else
doPlayerSendCancel(cid,"This player is already rewarded.")
end
else
doPlayerSendCancel(cid,"Player is not online.")
end
elseif (words == "/unreward") then
local player = getPlayerByName(param)
if (isPlayer(player) == TRUE) then
if (getPlayerPromotionLevel(player) > 1) then
setPlayerPromotionLevel(player,getPlayerPromotionLevel(player)-2)
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE,"You have changed ".. param .."\'s vocation (unreward).")
else
doPlayerSendCancel(cid,"This player wasn't rewarded, so you can't unreward him/her.")
end
else
doPlayerSendCancel(cid,"Player is not online.")
end
end
else
doPlayerSendCancel(cid,"In param you must insert player name.")
end
return TRUE
end
it just reward but don unreward why?!!!!!!
any idea?