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

GlobalEvent Vip System

what is the script you use to remove days? i wanted to know the function that counts days since something happened like i received a VIP now, in 1 day i'll have -1 day i wanted to do that with points like, i received 15 points now, in a day i'll receive another 15
 
The door dosn't work...
I've chose magic door but can someone tell me what's wrong?

When i click on the door it just says Gate of experience or something like that ...
Do i need to change Action ID on the door or something or Unique ID?
Please help me!:D

And if someone here Are a good website maker msg me !
I really need help with a website!

Thanks!:)
 
yeah im not sure how to get the door working can someone help me i put in the unique id as told to but it wont let me pass threw can someone help me?

- - - Updated - - -

can anyone help me? it just says this door is protected from unwanted intruders, so i tried a different door and it said i needed lvl 4788, so i changed it etc and anyone with the right level could walk in i can seem to get it to work can someone please help.. it would be greatly appreciated.

- - - Updated - - -

can someone help or what?
 
This post is so old, one of my first noob scripts, go mods and see the mock one's
 
Great tutorial ! its working but the only thing is the door ... how to pass when i use the medal ?
 
Well, this code was created by Empty :D
It should be works so i wanna post it :)

First, go to actions.xml and add this:
Code:
    <!-- VipSystem (Credits StreamSide and Empty) --!>
<action actionid="5788" script="other/vip door.lua" />
<action itemid="XXXX" script="other/vip.lua"/>
Change the XXXX for your item, I use 5785 (medal of honour).

then go to actions/scripts/other and create 2 lua files
1.- vipdoor.lua
Code:
-- Credits StreamSide and Empty
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local cidPosition = getCreaturePosition(cid)
        if (item.actionid == 5788 and getPlayerStorageValue(cid,11551) >= 1) then
            if cidPosition.x < toPosition.x then
                doTeleportThing(cid, {x=toPosition.x+1,y=toPosition.y,z=toPosition.z}, TRUE)
                                doCreatureSay(cid, "Welcome VIP Player!", TALKTYPE_ORANGE_1)
            else
                doTeleportThing(cid, {x=toPosition.x-1,y=toPosition.y,z=toPosition.z}, TRUE)
                                doCreatureSay(cid, "Welcome VIP Player!", TALKTYPE_ORANGE_1)
            end
            return TRUE
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but only VIP Players can pass here! Buy VIP on the WEB.")
            return TRUE
    end
    return FALSE
end

2.- vip.lua
Code:
-- Credits StreamSide and Empty
function onUse(cid, item, fromPosition, itemEx, toPosition)

    if getPlayerStorageValue(cid,11551) < 1 then
        if getPlayerLevel(cid) > 1 then
            getPlayerStorageValue(cid, 11551)
            doSendAnimatedText(getPlayerPosition(cid), "Welcome!", TEXTCOLOR_RED)
            doCreatureSay(cid, "CONGRATULATIONS! You are now a VIP for 15 days! You can now enter the VIP-area and use unique features!. ", TALKTYPE_ORANGE_1)
            setPlayerStorageValue(cid, 11551, (getPlayerStorageValue(cid,11551) + 15))
            doRemoveItem(item.uid, 1)
        else
            doPlayerSendCancel(cid,"You need to be at least level 2 to use this.")
            doRemoveItem(item.uid, 1)
        end
    else
        doPlayerSendCancel(cid,"You are already a donator.")
    end   
return TRUE
end

Also you can change this: "if getPlayerLevel(cid) > 1 then" for the determinated level...

OK, then go to globalevents/scripts and create 2 lua files

1.- removevipdays.lua
Code:
-- Credits StreamSide and Empty
function onThink(cid, item, fromPosition, toPosition)

    for _, name in ipairs(getOnlinePlayers()) do
        local player = getPlayerByName(name)
        if getPlayerStorageValue(player,11551) > 1 then
            setPlayerStorageValue(player,11551,getPlayerStorageValue(player) - 1)
        end
    end
end

2.- removevip.lua
Code:
-- Credits StreamSide and Empty
function onThink(cid, item, fromPosition, toPosition)

    for _, name in ipairs(getOnlinePlayers()) do
        local player = getPlayerByName(name)
        if getPlayerStorageValue(player,11551) == 1 then
            setPlayerStorageValue(player,11551,0)
        end
    end
end

And in globalevents.xml add this:
Code:
    <!-- VipSystem (Credits StreamSide and Empty) --!>
    <globalevent name="checkvip" interval="86400000" script="removevipdays.lua"/>
    <globalevent name="removevip" interval="36000000" script="removevip.lua"/>

And thats all :D
If you like it, REP ME PLZ XDD

StreamSide Here...

And if you wanna a broadcast for the VIP Player edit the vip.lua and copy this:
Code:
-- Credits StreamSide, Empty and Kaorus
function onUse(cid, item, fromPosition, itemEx, toPosition)
local name = getCreatureName(cid)
    -- if getPlayerStorageValue(cid,11551) < 1 then
        if getPlayerLevel(cid) > 1 then
            getPlayerStorageValue(cid, 11551)
            doSendAnimatedText(getPlayerPosition(cid), "Welcome!", TEXTCOLOR_RED)
            doCreatureSay(cid, "CONGRATULATIONS! You are now a VIP for 15 days! You can now enter the VIP-area and use unique features!. ", TALKTYPE_ORANGE_1)
            doBroadcastMessage("CONGRATULATIONS " ..  name .. "! Now you are VIP for 15 days! Now you can enter the VIP-area and use unique features!")
            setPlayerStorageValue(cid, 11551, (getPlayerStorageValue(cid,11551) + 15))
            doRemoveItem(item.uid, 1)
        else
            doPlayerSendCancel(cid,"You need to be at least level 2 to use this.")
            doRemoveItem(item.uid, 1)
        end
    -- else
    --    doPlayerSendCancel(cid,"You are already a donator.")
    -- end   
return TRUE
end

P.S.: Thanks Kaorus and Empty
[24/12/2014 19:11:16] [Error - GlobalEvents::think] Couldn't execute event: removevip
 
Add return true above the last end.
[24/12/2014 19:27:20] [Error - GlobalEvent Interface]
[24/12/2014 19:27:20] data/globalevents/scripts/removevipdays.lua:eek:nThink
[24/12/2014 19:27:20] Description:
[24/12/2014 19:27:20] (luaGetCreatureStorage) Creature not found

[24/12/2014 19:27:20] [Error - GlobalEvent Interface]
[24/12/2014 19:27:20] data/globalevents/scripts/removevipdays.lua:eek:nThink
[24/12/2014 19:27:20] Description:
[24/12/2014 19:27:20] data/globalevents/scripts/removevipdays.lua:6: attempt to perform arithmetic on a boolean value
[24/12/2014 19:27:20] stack traceback:
[24/12/2014 19:27:21] data/globalevents/scripts/removevipdays.lua:6: in function <data/globalevents/scripts/removevipdays.lua:1>
[24/12/2014 19:27:21] [Error - GlobalEvents::think] Couldn't execute event: checkvip
btw i think i got same problems with days wont remove if player offline ,he must be online to lose days how can i make time of vip running with offline players
 
Last edited:
Code:
-- Credits StreamSide and Empty
function onThink(interval, lastExecution)

     for _, cid in ipairs(getPlayersOnline()) do
         if getPlayerStorageValue(cid, 11551) > 1 then
             setPlayerStorageValue(cid, 11551, getPlayerStorageValue(cid, 11551) - 1)
         end
     end
     return true
end
 
Last edited:
Code:
-- Credits StreamSide and Empty
function onThink(interval, lastExecution)

     for _, cid in ipairs(getPlayersOnline()) do
         if getPlayerStorageValue(cid, 11551) > 1 then
             setPlayerStorageValue(cid, 11551, getPlayerStorageValue(cid) - 1)
         end
     end
     return true
end
still same problem
[24/12/2014 20:35:52] [Error - GlobalEvent Interface]
[24/12/2014 20:35:52] data/globalevents/scripts/removevipdays.lua:eek:nThink
[24/12/2014 20:35:52] Description:
[24/12/2014 20:35:52] (luaGetCreatureStorage) Creature not found

[24/12/2014 20:35:52] [Error - GlobalEvent Interface]
[24/12/2014 20:35:52] data/globalevents/scripts/removevipdays.lua:eek:nThink
[24/12/2014 20:35:52] Description:
[24/12/2014 20:35:52] data/globalevents/scripts/removevipdays.lua:6: attempt to perform arithmetic on a boolean value
[24/12/2014 20:35:52] stack traceback:
[24/12/2014 20:35:52] data/globalevents/scripts/removevipdays.lua:6: in function <data/globalevents/scripts/removevipdays.lua:2>
[24/12/2014 20:35:53] [Error - GlobalEvents::think] Couldn't execute event: checkvip
 
Don't see a reason why it would give an error like that since it only gets players online.
Code:
-- Credits StreamSide and Empty
function onThink(interval, lastExecution)

     for _, cid in ipairs(getPlayersOnline()) do
         if isPlayer(cid) then
             if getPlayerStorageValue(cid, 11551) > 1 then
                 setPlayerStorageValue(cid, 11551, getPlayerStorageValue(cid) - 1)
             end
         end
     end
     return true
end
[24/12/2014 23:27:03] [Error - GlobalEvent Interface]
[24/12/2014 23:27:03] data/globalevents/scripts/removevipdays.lua:eek:nThink
[24/12/2014 23:27:03] Description:
[24/12/2014 23:27:03] (luaGetCreatureStorage) Creature not found

[24/12/2014 23:27:03] [Error - GlobalEvent Interface]
[24/12/2014 23:27:03] data/globalevents/scripts/removevipdays.lua:eek:nThink
[24/12/2014 23:27:03] Description:
[24/12/2014 23:27:03] data/globalevents/scripts/removevipdays.lua:7: attempt to perform arithmetic on a boolean value
[24/12/2014 23:27:03] stack traceback:
[24/12/2014 23:27:03] data/globalevents/scripts/removevipdays.lua:7: in function <data/globalevents/scripts/removevipdays.lua:2>
[24/12/2014 23:27:03] [Error - GlobalEvents::think] Couldn't execute event: checkvip
afff i got bored :S
do you have another vip system? i mean you have tried it before
 
The script worked perfectly here on my server , but I wonder if it is possible to modify this script so that the account be VIP and not only the character who used the doll .
 
Nice post.
I'm using this on my OTs and I also added this script to my talkactions.
This talkaction will show to the players how much days of VIP do they have by saying the command "!vip"
Code:
function onSay(cid, words, param)
    if getPlayerStorageValue(cid,11551) > 0 then
            doPlayerSendCancel(cid, "You have " .. getPlayerStorageValue(cid,11551).. " VIP days.")
doSendMagicEffect(getPlayerPosition(cid), 4)
    else
            doPlayerSendCancel(cid, "You are not VIP.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    end


    return 1
end
Thanks!
 

Similar threads

Back
Top