here is my scrip dude
line 13Code:local cost = 10000 function onSay(cid, words, param, channel) if getPlayerMoney(cid) < cost then doPlayerSendCancel(cid,"You dont have enogh money.") end if getPlayerPromotionLevel(cid) == 1 then doPlayerSendCancel(cid,"You are already promoted") end setPlayerPromotionLevel(cid,1) doSendAnimatedText(getThingPos(cid),"Promoted!",TEXTCOLOR_GREEN) doSendMagicEffect(getThingPos(cid),49) doPlayerRemoveMoney(cid,cost) return true end
hey sonical it is just a question, can you see an error in my script as i rlly cant find one, i think all ends are there right?![]()
local cost = 10000
function onSay(cid, words, param, channel)
if getPlayerMoney(cid) < cost then
doPlayerSendCancel(cid,"You dont have enogh money.")
return true
end
if getPlayerPromotionLevel(cid) == 1 then
doPlayerSendCancel(cid,"You are already promoted")
return true
end
setPlayerPromotionLevel(cid,1)
doSendAnimatedText(getThingPos(cid),"Promoted!",TEXTCOLOR_GREEN)
doSendMagicEffect(getThingPos(cid),49)
doPlayerRemoveMoney(cid,cost)
return true
end
Shouldn't it be like this, as far as I know every "check if" in talkaction should have return true, at least all my scripts are made by that way, correct if I'm wrong.
only at the place where it will excute the talkaction , not the place of sending cancel , as return true in talkaction make the words appear in console , false will appear as default talkShouldn't it be like this, as far as I know every "check if" in talkaction should have return true, at least all my scripts are made by that way, correct if I'm wrong.
LUA:local cost = 10000 function onSay(cid, words, param, channel) if getPlayerMoney(cid) < cost then doPlayerSendCancel(cid,"You dont have enogh money.") return true end if getPlayerPromotionLevel(cid) == 1 then doPlayerSendCancel(cid,"You are already promoted") return true end setPlayerPromotionLevel(cid,1) doSendAnimatedText(getThingPos(cid),"Promoted!",TEXTCOLOR_GREEN) doSendMagicEffect(getThingPos(cid),49) doPlayerRemoveMoney(cid,cost) return true end