• 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!

relog - lost super vocations

Drakos

Banned User
Joined
May 27, 2008
Messages
218
Reaction score
1
Location
Poland
i have super vocation like in roxor servs. But when someone relog, he dont have this vocation. Someone could help me ?

all works fine in tfs 0.22 but in 0.3b2 not ...
 
its the code to get this promo

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerVocation(cid) == 5 then
		doPlayerSetVocation(cid, 20)
		doCreatureSay(cid, "You are now a Super Sorcerer!", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, 1)
	elseif getPlayerVocation(cid) == 6 then
		doPlayerSetVocation(cid, 21)
		doCreatureSay(cid, "You are now a Super Druid!", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, 1)
	elseif getPlayerVocation(cid) == 7 then
		doPlayerSetVocation(cid, 22)
		doCreatureSay(cid, "You are now a Super Paladin!", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, 1)
	elseif getPlayerVocation(cid) == 8 then
		doPlayerSetVocation(cid, 23)
		doCreatureSay(cid, "You are now a Super Knight!", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, 1)
	else
		doPlayerSendCancel(cid,"You need to be promoted in order to use this item.")
	end
end

but i dont know where this save. Maybe it creaturescripts ?
 
its the code to get this promo

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerVocation(cid) == 5 then
		doPlayerSetVocation(cid, 20)
		doCreatureSay(cid, "You are now a Super Sorcerer!", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, 1)
	elseif getPlayerVocation(cid) == 6 then
		doPlayerSetVocation(cid, 21)
		doCreatureSay(cid, "You are now a Super Druid!", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, 1)
	elseif getPlayerVocation(cid) == 7 then
		doPlayerSetVocation(cid, 22)
		doCreatureSay(cid, "You are now a Super Paladin!", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, 1)
	elseif getPlayerVocation(cid) == 8 then
		doPlayerSetVocation(cid, 23)
		doCreatureSay(cid, "You are now a Super Knight!", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, 1)
	else
		doPlayerSendCancel(cid,"You need to be promoted in order to use this item.")
	end
end

but i dont know where this save. Maybe it creaturescripts ?


You must use PlayerStorage
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerPromotionLevel(cid) < 2 then
        setPlayerPromotionLevel(cid, 2)
        doCreatureSay(cid, "You have been promoted!", TALKTYPE_ORANGE_1)
        doRemoveItem(item.uid, 1)
    else
        doPlayerSendCancel(cid,"You need to be promoted in order to use this item.")
    end

    return TRUE
end

but this one will give you last promo no matter which one u are (only if u already is promoted it wont work)
 
Last edited:
ok i past yours code i have this :

You see yourself. You are .


on console :

Code:
Warning: [Vocations::getVocation] Vocation 4294967295 not found.
 
it doesnt work. but maybe is the other problem. In mysql when i change vocation to 20 i have this same error.

Code:
  if getPlayerPromotionLevel(cid) < 1 then
        setPlayerPromotionLevel(cid, 2)

where i have to change PromotionLevel ?
 
Moderator Message: Please create threads in the correct sections at this forum, if you need help with scripts like this, the "Request and Support" fits, also Open Tibia - Support section fit.
 
Back
Top