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

[Creaturescripts] End vip end promotion

felipedorgas

New Member
Joined
Aug 10, 2010
Messages
34
Reaction score
1
hello guys

i need help in this script,

is version 8.54-8.57

i have a good system for vip account (all characters win vip)

and this system have a script, what leads the player to a town free when end vip:

Code:
function onLogin(cid) 
        if getVipTime(cid) > 0  and isVip(cid) == FALSE then 
                local townid = 1 
                doPlayerSetTown(cid, townid) 
                local templePos = getTownTemplePosition(getPlayerTown(cid)) 
                doTeleportThing(cid, templePos, false) 
                setVipTime(cid, 0) 
                doTeleportPlayers(cid, templePos) 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You vip ends!") 
        else 
                local duration = getVipDate(cid) 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You has "..getVipDays(cid).." day(s) of vip."..(duration and (" It will last until "..duration..".") or "")) 
        end 
        return TRUE 
end

I need, what ends vip, the promotion vip down of 2 to 1 !

If you do not understand if I explain better... :thumbup:

thx
 
Mybe I understood it wrong but try
Lua:
function onLogin(cid) 
        if getVipTime(cid) > 0  and isVip(cid) == FALSE then 
                local townid = 1 
                doPlayerSetTown(cid, townid) 
                doPlayerSetPromotionLevel(cid,1)
                local templePos = getTownTemplePosition(getPlayerTown(cid)) 
                doTeleportThing(cid, templePos, false) 
                setVipTime(cid, 0) 
                doTeleportPlayers(cid, templePos) 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You vip ends!") 
        else 
                local duration = getVipDate(cid) 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You has "..getVipDays(cid).." day(s) of vip."..(duration and (" It will last until "..duration..".") or "")) 
        end 
        return TRUE 
end
or
Lua:
function onLogin(cid) 
        if getVipTime(cid) > 0  and isVip(cid) == FALSE then 
                local townid = 1 
                doPlayerSetTown(cid, townid) 
                setPlayerPromotionLevel(cid,1)
                local templePos = getTownTemplePosition(getPlayerTown(cid)) 
                doTeleportThing(cid, templePos, false) 
                setVipTime(cid, 0) 
                doTeleportPlayers(cid, templePos) 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You vip ends!") 
        else 
                local duration = getVipDate(cid) 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You has "..getVipDays(cid).." day(s) of vip."..(duration and (" It will last until "..duration..".") or "")) 
        end 
        return TRUE 
end
Rep++
 
Sonical

thx for help, more have a problem, this script (first) remove only the promotion of the FIRST character that I enter...

I'm doing test with all vocations, the rest still promotion vip

HELP MEEE :D
 
the script remove only promotion the first character i logout

example:

i have a account, with vip, and 4 characters, elder druid [vip], master sorcerer [vip] ... rp [vip] ... ek [vip]
all vip (same account) and with vip promotion (promotion 2)

and happen what my vip ends ( 0 days of vip )

i enter in my account, and enter at elder druid [vip] character.

and I come across it:

13:27 You has 0 day(s) of vip.

13:28 You see yourself. You are an elder druid.

OKAY..SURE !

go enter my character Royal Paladin [vip]...

13:29 You has 0 day(s) of vip.

13:29 You see yourself. You are a royal paladin [VIP].

HE CONTINUES PROMOTION VIP !!!!

this script (first) remove only the promotion of the FIRST character that I enter...
 
Try
Lua:
function onLogin(cid) 
if isVip(cid) == FALSE then 
	doPlayerSetPromotionLevel(cid,1)
end
if getVipTime(cid) > 0 then
                local townid = 1 
                doPlayerSetTown(cid, townid) 
                local templePos = getTownTemplePosition(getPlayerTown(cid)) 
                doTeleportThing(cid, templePos, false) 
                setVipTime(cid, 0) 
                doTeleportPlayers(cid, templePos) 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You vip ends!") 
        else 
                local duration = getVipDate(cid) 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You has "..getVipDays(cid).." day(s) of vip."..(duration and (" It will last until "..duration..".") or "")) 
end
        return TRUE 
end
 
Lua:
function onLogin(cid) 
if getVipTime(cid) < 1 then
                local townid = 1 
                doPlayerSetTown(cid, townid) 
                local templePos = getTownTemplePosition(getPlayerTown(cid)) 
                doTeleportThing(cid, templePos, false) 
                setVipTime(cid, 0) 
                doTeleportPlayers(cid, templePos) 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You vip ends!") 
					if isVip(cid) == FALSE then 
						doPlayerSetPromotionLevel(cid,1)
					end
        else 
                local duration = getVipDate(cid) 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You has "..getVipDays(cid).." day(s) of vip."..(duration and (" It will last until "..duration..".") or "")) 
end
        return TRUE 
end
 
bug again :S

the script not remove promotion e not leads to "local townid = 1 "

pls, i need very much !!!!
i give 10 rep++ :)
 
Last edited:
man this script \/ works perfectly !!! it takes account of all promotion...was what I wanted...

Code:
function onLogin(cid) 
if isVip(cid) == FALSE then 
	doPlayerSetPromotionLevel(cid,1)
end
if getVipTime(cid) > 0 then
                local townid = 1 
                doPlayerSetTown(cid, townid) 
                local templePos = getTownTemplePosition(getPlayerTown(cid)) 
                doTeleportThing(cid, templePos, false) 
                setVipTime(cid, 0) 
                doTeleportPlayers(cid, templePos) 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You vip ends!") 
        else 
                local duration = getVipDate(cid) 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You has "..getVipDays(cid).." day(s) of vip."..(duration and (" It will last until "..duration..".") or "")) 
end
        return TRUE 
end

but does not works /addvip whenever I enter the vip ends

17:54 You has 0 day(s) of vip.

I find this easy to fix...

THX :D
 
Lua:
function onLogin(cid) 
if isVip(cid) == FALSE then 
	doPlayerSetPromotionLevel(cid,1)
end
if getVipTime(cid) < 1 then
                local townid = 1 
                doPlayerSetTown(cid, townid) 
                local templePos = getTownTemplePosition(getPlayerTown(cid)) 
                doTeleportThing(cid, templePos, false) 
                setVipTime(cid, 0) 
                doTeleportPlayers(cid, templePos) 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You vip ends!") 
        else 
                local duration = getVipDate(cid) 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You has "..getVipDays(cid).." day(s) of vip."..(duration and (" It will last until "..duration..".") or "")) 
end
        return TRUE 
end
It was little mistake, sry.
 
nope guy =/

he not leads to local townid = 1

original script:
Code:
function onLogin(cid) 
        if getVipTime(cid) > 0  and isVip(cid) == FALSE then 
                local townid = 1 
                doPlayerSetTown(cid, townid) 
                local templePos = getTownTemplePosition(getPlayerTown(cid)) 
                doTeleportThing(cid, templePos, false) 
                setVipTime(cid, 0) 
                doTeleportPlayers(cid, templePos) 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua Vip acabou!") 
        else 
                local duration = getVipDate(cid) 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você possui "..getVipDays(cid).." dia(s) de vip."..(duration and (" Ela irá durar até "..duration..".") or "")) 
        end 
        return TRUE 
end
 
Lua:
function onLogin(cid) 
        if getVipTime(cid) > 0 and isVip(cid) == FALSE then 
			if getPlayerTown(cid) ~= 1 and getPlayerStorageValue(cid,2333) == 1 then
				doPlayerSetTown(cid, 1)
					doRemoveCreature(cid)
			end
                local templePos = getTownTemplePosition(getPlayerTown(cid)) 
                doTeleportThing(cid, templePos, false) 
				setPlayerStorageValue(cid,2333,-1)
                setVipTime(cid, 0) 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua Vip acabou!") 
        else 
                local duration = getVipDate(cid) 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você possui "..getVipDays(cid).." dia(s) de vip."..(duration and (" Ela irá durar até "..duration..".") or "")) 
				setPlayerStorageValue(cid,2333,1)
        end 
        return TRUE 
end
Now it simply kicks player if he/she doesn't have townid 1 and sets it to 1 :) Next time when he'll log in it teleports player to temple and other stuffs.
 
Lua:
function onLogin(cid) 
if isVip(cid) == true or getVipTime(cid) > 1 then
setPlayerStorageValue(cid,2333,1)
end
        if getVipTime(cid) < 1 and getPlayerStorageValue(cid,2333) == 1 then
                local templePos = getTownTemplePosition(1) 
                doTeleportThing(cid, templePos, false) 
				doPlayerSetTown(cid, 1)
				setPlayerStorageValue(cid,2333,-1)
                                setVipTime(cid, 0) 
				doPlayerSetPromotionLevel(cid,1)
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua Vip acabou!") 
        else 
                local duration = getVipDate(cid) 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você possui "..getVipDays(cid).." dia(s) de vip."..(duration and (" Ela irá durar até "..duration..".") or "")) 
        end 
        return TRUE 
end
Note: The player must have had vip before (and logged in one time with vip!), else it won't work correctly
(if player is vip then it sets storagevalue 2333 to 1, when his/her vip time ends it checks if that player has storage value 1, if yes then it sets his town id 1, promotionlvl 1 and teleports him/her to temple of town id 1)
 
Back
Top