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

The best VIP system ever! [Action/Movevent/Globalevent]

onTimer should be onTime in removedays.lua and make sure you dont get any unwanted linebreaks when you copy this codes cus it can screw up your sql queries pretty bad and will probably give you an error in the console. Just make sure ur lua files looks like the code posted here. Also, registerCreatureEvent(cid, "VipCheck") must be before the last end in login.lua


So like this?
Lua:
function onLogin(cid)
    registerCreatureEvent(cid, "PlayerDeath")
    registerCreatureEvent(cid, "VipCheck")
    return TRUE
end
 
that should do the trick, if it doesnt just add it where i did..

PHP:
	registerCreatureEvent(cid, "GuildMotd")
<!-- on this line -->
	registerCreatureEvent(cid, "Idle")
 
Fixed Add vip days command and Remove vip days command

In the add vip days command i also changed the sender, so the reciever gets the message "You have received X VIP days from a god." where X is the vip days you chose.

Also added a function for the script to see if its one or more days 1 day = "You have received 1 VIP day from a god." while 2 or more = "You have recieved 2 VIP days from a god."

Replace the text in your adddays.lua file to this:
Code:
function onSay(cid, words, param, channel)
        if(param == '') then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
                return true
        end
 
        local t = string.explode(param, ",")
        t[1] = tonumber(t[1])
        if(not t[1]) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires numeric param.")
                return true
        end
 
        local pid = cid
        if(t[2]) then
                pid = getPlayerByNameWildcard(t[2])
                if(not pid) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " was not found.")
                        return true
                end
        end
 
        if(t[1] > 365) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can only add a maximum of 365 vip days.")
                return true
        end
 
        pid = getPlayerByNameWildcard(t[2])
 
    doAddVipDays(pid, t[1])
        if(t[1] > 1) then
    doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "You have given ".. t[1] .." VIP days to ".. t[2])
    doPlayerSendTextMessage(pid,MESSAGE_STATUS_CONSOLE_ORANGE, "You have received ".. t[1] .." VIP days from a god.")    
        return true
end
    doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "You have given ".. t[1] .." VIP day to ".. t[2])
    doPlayerSendTextMessage(pid,MESSAGE_STATUS_CONSOLE_ORANGE, "You have received ".. t[1] .." VIP day from a god.")  
        return true
end

In remove vip days command i did pretty much the same "A god removed X VIP days from you." but i also added a line so that you can see how much vip days the players have if you try to remove more than they currently have, I also added a line which makes you unable to remove days into a negative number (ex. -3 Days dunno if it was possible before) same function as adding days apply here (1 day = day, 2 or more days = days).

Replace the text in your removedays.lua to this:
Code:
function onSay(cid, words, param, channel)
        if(param == '') then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
                return true
        end
 
        local t = string.explode(param, ",")
        t[1] = tonumber(t[1])
        if(not t[1]) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires numeric param.")
                return true
        end
 
        local pid = cid
        if(t[2]) then
                pid = getPlayerByNameWildcard(t[2])
                if(not pid) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " was not found.")
                        return true
                end
        end

pid = getPlayerByNameWildcard(t[2])
currentVip = getPlayerVipDays(pid)
        if(t[1] > currentVip) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can not remove more VIP days than the player has, the player currently has ".. currentVip ..".")
                return true
        end
 
    doRemoveVipDays(pid, t[1])
if(t[1] > 1) then
    doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "You have removed ".. t[1] .." VIP days from ".. t[2])
    doPlayerSendTextMessage(pid,MESSAGE_STATUS_CONSOLE_ORANGE, "A god just removed ".. t[1] .." VIP days from you.")    
return true
end
    doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "You have removed ".. t[1] .." VIP day from ".. t[2])
    doPlayerSendTextMessage(pid,MESSAGE_STATUS_CONSOLE_ORANGE, "A god just removed ".. t[1] .." VIP day from you.")  
        return true
end


And dont forget to REP++ if it helped you!
 
Last edited:
Rep ++ :) ... Thanks Sir ....


can u make vip tile better ? like when vip player pass on it it say " you are vip . so you can go there " and when not vip player pass it say " you aren't vip , so you can't pass there " .... can u make it?
 
Rep ++ :) ... Thanks Sir ....


can u make vip tile better ? like when vip player pass on it it say " you are vip . so you can go there " and when not vip player pass it say " you aren't vip , so you can't pass there " .... can u make it?

Ill see to it.. just started with lua editing, but i probably can do it.. really shouldnt be that hard :) tho isnt it better with that script on the doors?
 
Edited viptile.lua

Code:
function onStepIn(cid, item, position, fromPosition)
         if getPlayerVipDays(cid) == 0 then
             doTeleportThing(cid, fromPosition, FALSE)
             doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Thou shall not pass, this is for VIPs only!")
             doSendMagicEffect(getCreaturePosition(cid), 50)
              return true
         end

         currentVip = getPlayerVipDays(cid)
         if (currentVip > 0) then
             doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are VIP, you may pass.")
             doSendMagicEffect(getCreaturePosition(cid), 14)
             return true
         end
end
vipsonly.png
vipaccess.png


Edited the code a bit, message to VIPs & none-VIPs (LOTRO Quote) , also added some magic effects..


Please rep++ if you like it.
 
Last edited:
@up Well i have a question for you, could you make this work on tfs 0.2.10?

Sorry im not familiar with that version at all, was a long time since i did anything with otserv and i just started again.. all things i do i only test at r3777 atm (0.4)
 
What about PHP buy vip days like premium

Make a shop offer with a mysql query that alters vip days, just look at a unban acc one or remove skull, should work the same just alter the sql query so it gives the amount of vip days you want the offer to be instead of unbanning acc or removing skull if you understand what i mean.

If you dont understand what i mean PM me if you need help ^^
 
That with vip effect. dont works by me :S


i got another vip script:S

This is error that i got in console :

[Error - GlobalEvent Interface]
data/globalevents/scripts/vipeffect.lua:eek:nThink
Description:
data/globalevents/scripts/vipeffect.lua:4: attempt to call global 'getPlayerVipDays' (a nil value)
stack traceback:
data/globalevents/scripts/vipeffect.lua:4: in function <data/globalevents/scripts/vipeffect.lua:1>
[Error - GlobalEvents::think] Couldn't execute event: vipeffect
 
You missed the step where I told you to add some functions to the lib files.

The vip tile should not also work for you.
 
Back
Top