I was wondering if anyone could make me the promotion system like that.
At 0.3.6 it was simply needpremium "0 or 1", but now it isn't anymore..
This is the promotion script from 1.0:
At 0.3.6 it was simply needpremium "0 or 1", but now it isn't anymore..
This is the promotion script from 1.0:
Code:
function StdModule.promotePlayer(cid, message, keywords, parameters, node)
local npcHandler = parameters.npcHandler
if npcHandler == nil then
error("StdModule.promotePlayer called without any npcHandler instance.")
end
if not npcHandler:isFocused(cid) then
return false
end
if(isPlayerPremiumCallback == nil or isPlayerPremiumCallback(cid) == true or parameters.premium == false) then
local promotedVoc = getPromotedVocation(getPlayerVocation(cid))
if(getPlayerStorageValue(cid, 30018) == 1) then
npcHandler:say("You are already promoted!", cid)
elseif(getPlayerLevel(cid) < parameters.level) then
npcHandler:say("I am sorry, but I can only promote you once you have reached level " .. parameters.level .. ".", cid)
elseif(doPlayerRemoveMoney(cid, parameters.cost) ~= TRUE) then
npcHandler:say("You do not have enough money!", cid)
else
doPlayerSetVocation(cid, promotedVoc)
npcHandler:say(parameters.text, cid)
end
else
npcHandler:say("You need a premium account in order to get promoted.", cid)
end
npcHandler:resetNpc(cid)
return true
end