• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent Reset to free settings when premium ends

guiismiti

Well-Known Member
Joined
May 19, 2014
Messages
315
Solutions
3
Reaction score
68
Very simple. This will:
- Change hometown to Thais (or the town with ID #2);
- Teleport the player to the start position configured for your server;
- Change the outfit to citizen with default colors;
- Send the message that the premium time has expired.

To install:
- Make sure you're not using the Storage Value 43466;
- Change the Town ID to whatever town you want the player to be teleported to;
- Insert the code into login.lua, right before the teleport magiceffect.

Code:
    if isPremium(cid) then
        setPlayerStorageValue(cid, 43466, 1)
    elseif ((getPlayerStorageValue(cid, 43466)) == 1) then
        setPlayerStorageValue(cid, 43466, 0)
        outfit = {lookType = 128, lookHead = 78, lookAddons = 0, lookLegs = 39, lookBody = 68, lookFeet = 76}
        doCreatureChangeOutfit(cid, outfit)
        doTeleportThing(cid, config.startPosition, true)
        doPlayerSetTown(cid, 2)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your premium time has expired.")
    end
 
Back
Top