function onSay(cid, word, param)
if getPlayerVocation(cid) == 1, 2, 3, 4 then
doPlayerAddMoney(cid, 100000)
doPlayerSendTextMessage(cid, 21, "You have now gotten your 10 Crystal Coins. Happy Hunting!")
setPlayerStorageValue(cid, 54000, 1)
end
if getPlayerVocation(cid) == 5, 6, 7, 8 then
doPlayerSendTextMessage(cid, 21, "You have gotten 5 crystal coins, since you are promoted.")
doPlayerAddMoney(cid, 500000)
setPlayerStorageValue(cid, 54000, 1)
end
if getPlayerStorageValue(cid) == 54000 then
doPlayerSendCancel(cid, "You have already gotten your money."
end
return true
end
Heres somewhat of an edited version lol
Lua:function onSay(cid, word, param) if getPlayerVocation(cid) == 1, 2, 3, 4 then doPlayerAddMoney(cid, 100000) doPlayerSendTextMessage(cid, 21, "You have now gotten your 10 Crystal Coins. Happy Hunting!") setPlayerStorageValue(cid, 54000, 1) end if getPlayerVocation(cid) == 5, 6, 7, 8 then doPlayerSendTextMessage(cid, 21, "You have gotten 5 crystal coins, since you are promoted.") doPlayerAddMoney(cid, 500000) setPlayerStorageValue(cid, 54000, 1) end if getPlayerStorageValue(cid) == 54000 then doPlayerSendCancel(cid, "You have already gotten your money." end return true end
function onSay(cid, word, param)
if getPlayerStorageValue(cid) == 54000 then
if isInArray({1, 2, 3, 4}, getPlayerVocation(cid)) then
doPlayerAddMoney(cid, 100000)
doPlayerSendTextMessage(cid, 21, "You have now gotten your 10 Crystal Coins. Happy Hunting!")
setPlayerStorageValue(cid, 54000, 1)
elseif isInArray({5, 6, 7, 8}, getPlayerVocation(cid)) then
doPlayerSendTextMessage(cid, 21, "You have gotten 5 crystal coins, since you are promoted.")
doPlayerAddMoney(cid, 500000)
setPlayerStorageValue(cid, 54000, 1)
end
else
doPlayerSendCancel(cid, "You have already gotten your money."
end
return true
end
It'd give money everytime. And why do you use "getPlayerVocation(cid) == 5, 6, 7, 8" better use isInArray().
Sorry I'm sort of new xD
function onSay(cid, word, param)
local promoLv, storage, result = getPlayerPromotionLevel(cid), 54000, "You have already received your bonus money!"
local rewards = {100000, 500000}
if(getCreatureStorage(cid, storage) == -1)then
local reward = rewards[promoLv+1]
if(reward)then
result = "You have received "..reward.." gold. Happy Hunting!"
doCreatureSetStorage(cid, storage, 1)
doPlayerAddMoney(cid, reward)
end
end
return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, result)
end