Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- local player = Player(cid)
- if player:isPremium() or not parameters.premium then
- local promotion = player:getVocation():getPromotion()
- if player:getStorageValue(STORAGEVALUE_PROMOTION) == 1 then
- npcHandler:say("You are already promoted!", cid)
- elseif player:getLevel() < parameters.level then
- npcHandler:say("I am sorry, but I can only promote you once you have reached level " .. parameters.level .. ".", cid)
- elseif not player:removeMoney(parameters.cost) then
- npcHandler:say("You do not have enough money!", cid)
- elseif (getPlayerPromotionLevel(cid)+1) ~= parameters.promotion then
- npcHandler:say('You need the previous promotion first!', cid)
- else
- npcHandler:say(parameters.text, cid)
- player:setVocation(promotion)
- player:setStorageValue(STORAGEVALUE_PROMOTION, 1)
- end
- else
- npcHandler:say("You need a premium account in order to get promoted.", cid)
- end
- npcHandler:resetNpc(cid)
- return true
- end
- function StdModule.promotePlayer2(cid, message, keywords, parameters, node)
- local secondPromoStorage = 55555 --CHANGE THIS NUMBER IF YOU WANT
- local npcHandler = parameters.npcHandler
- if npcHandler == nil then
- error("StdModule.promotePlayer called without any npcHandler instance.")
- end
- local player = Player(cid)
- if player:isPremium() or not parameters.premium then
- local promotion = player:getVocation():getPromotion()
- if player:getStorageValue(secondPromoStorage) == 1 then
- npcHandler:say("You are already promoted!", cid)
- elseif player:getLevel() < parameters.level then
- npcHandler:say("I am sorry, but I can only promote you once you have reached level " .. parameters.level .. ".", cid)
- elseif not player:removeMoney(parameters.cost) then
- npcHandler:say("You do not have enough money!", cid)
- elseif (getPlayerPromotionLevel(cid)+1) ~= parameters.promotion then
- npcHandler:say('You need the previous promotion first!', cid)
- else
- npcHandler:say(parameters.text, cid)
- player:setVocation(promotion) ----YOU HAVE TO CHANGE THIS FOR YOUR VOCATION ID OF SECOND PROMO you can use something like with the first one player:setVocation(getPlayerVocation(cid) + 4) IDK whats your voc IDs are
- player:setStorageValue(secondPromoStorage, 1)
- end
- else
- npcHandler:say("You need a premium account in order to get promoted.", cid)
- end
- npcHandler:resetNpc(cid)
- return true
- end
Add Comment
Please, Sign In to add comment