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

Solved Help vocations VIP

woody100_1

New Member
Joined
Aug 11, 2011
Messages
17
Reaction score
0
I have a problem with vip vocations add my script and a screenshot of the error, i use the forgotten server 1.0 THIS
Code:
function onLogin(cid)
if getPlayerVipDays(cid) >= 1 and (isInArray({1, 2, 3, 4, 5, 6, 7, 8}, getPlayerVocation(cid))) then
doPlayerSetVocation(cid, (getPlayerVocation(cid)+4))
end
if getPlayerVipDays(cid) < 1 and (isInArray({9, 10, 11, 12}, getPlayerVocation(cid))) then
doPlayerSetVocation(cid, (getPlayerVocation(cid)-4))
end
return true
end

error-lua-1113212.jpg
 
Code:
function onLogin(cid)
     local player = Player(cid)
     if getPlayerVipDays(cid) >= 1 and isInArray({1, 2, 3, 4, 5, 6, 7, 8}, player:getVocation():getId()) then
         player:setVocation(Vocation((player:getVocation():getId()+4)))
     end
     if getPlayerVipDays(cid) < 1 and isInArray({9, 10, 11, 12}, player:getVocation():getId()) then
         player:setVocation(Vocation((player:getVocation():getId()-4)))
     end
     return true
end

You can use compat.lua as example how to change the 0.2 functions to 1.0 metatables.
https://github.com/otland/forgottenserver/blob/master/data/compat.lua
 
Back
Top