function onAdvance(cid, skill, oldLevel, newLevel)
local pos = {x=1016, y=1021, z=7}---- temple of the town the player will be teleported to when the vip has ended,
if skill == SKILL__LEVEL and newLevel >= 300 and getPlayerStorageValue(cid, 2005) == -1 then
setPlayerStorageValuee(cid, 1001, -1)---- vip storage
setPlayerStorageValuee(cid, 2005, 1)
doTeleportThing(cid, pos)
doSendMagicEffect(pos, CONST_ME_TELEPORT)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You'r vip trail has ended becouse you reached level 300, now go and buy a new one. You've also been teleported back to the main temple!")
end
return true