• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.0 Free 1st promotion, Premium 2nd promotion

survivor

New Member
Joined
Mar 20, 2008
Messages
89
Reaction score
4
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:

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
 
now is on parameters like
Code:
  node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20, premium = true, text = 'Congratulations! You are now promoted.'})
 
Back
Top