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

[Vip Check] help

elking

Swev-v2.sytes.net Comming Soon !<>!
Joined
Aug 20, 2012
Messages
445
Reaction score
28
Location
Egypt
Hello people of Otland.

I need help with vip check

I use this for Vip.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)

if getPlayerStorageValue(cid,11551) < 1 then
if getPlayerLevel(cid) > 1 then
getPlayerStorageValue(cid, 11551)
doCreatureSay(cid, "CONGRATULATIONS! You are now a VIP for 12 days! You can now enter the VIP!. ", TALKTYPE_MONSTER)
setPlayerStorageValue(cid, 11551, (getPlayerStorageValue(cid,11551) + 12))
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid,"You need to be at least level 1 to use this.")
end
else
doPlayerSendCancel(cid,"You are already a VIP.")
end
return TRUE
end

and this for Vip door.lua
Code:
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,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, "You Are Not Vip ! Donate And Buy It to Enjoy .")
return TRUE
end
return FALSE
end

help I test @Kekox system but it give all character on your account vip days

anyone can help me with vip check or make kekox vip for 1 character
 
Last edited by a moderator:
Did you do this as Cromox said:

<globalevent name="VipDaysRemover" time="00:01" event="script" value="daysremover.lua"/>

This is necessary to decrement the number of Vip days. That script is the only place the number of Vip days remaining is reduced.


It's also not so clear from the first page of this thread that the Player Storage 11551 is being correctly synchronized with the data base table value Cronox suggested.

If you're using one as the persistent storage, and the other in your tests, they have to be kept synchronized.
 
Last edited:
Did you do this as Cromox said:

<globalevent name="VipDaysRemover" time="00:01" event="script" value="daysremover.lua"/>

This is necessary to decrement the number of Vip days. That script is the only place the number of Vip days remaining is reduced.


It's also not so clear from the first page of this thread that the Player Storage 11551 is being correctly synchronized with the data base table value Cronox suggested.

If you're using one as the persistent storage, and the other in your tests, they have to be kept synchronized.

Yes I use it
 
And does your "entitlement test" use the database or the Storage?

The one on the previous page uses the Storage, and I didn't see anything that resets it. If that's so, and it's also saved to disk, it will be set to true once, then stay true forever.
 
And does your "entitlement test" use the database or the Storage?

The one on the previous page uses the Storage, and I didn't see anything that resets it. If that's so, and it's also saved to disk, it will be set to true once, then stay true forever.

I use storage
 
M8 - read the second sentence too.

Check to see if the Storage is changed back to "false" when the login script changes the number of remaining days in the database to zero.
 
can u paste here you door vip to see
Vipeffect.lua
Code:
function onThink(interval, lastExecution)
        for _, name in ipairs(getOnlinePlayers()) do
        local cid = getPlayerByName(name)
                if (getPlayerStorageValue(cid,11551) >= 1) then
                  doSendMagicEffect(getPlayerPosition(cid), 27)
                  doSendAnimatedText(getPlayerPosition(cid), "VIP!", TEXTCOLOR_RED)
              end
        end
        return true
end

vipdoor.lua
Code:
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,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, "You Are Not Vip ! Donate And Buy It to Enjoy .")
return TRUE
end
return FALSE
end
 
Well I think ,your problem is daysremover
why days remover only remove vipdays ,but don't added function remove action storage.
so vip days remove but effect don't disappear why anyways have effect storage ,Onfinish VIP.
try this:
Code:
local storage = 11551
function onTime()
    db.executeQuery("UPDATE players SET vipdays = vipdays - 1 WHERE vipdays > 0;")
    setPlayerStorageValue(pid, storage, -1)
    return TRUE
end
 
Last edited:
Well I think ,your problem is daysremover
why days remover only remove vipdays ,but don't added function remove action storage.
so vip days remove but effect don't disappear why anyways have effect storage ,Onfinish VIP.
try this:
Code:
local storage = 11551
function onTime()
    db.executeQuery("UPDATE players SET vipdays = vipdays - 1 WHERE vipdays > 0;")
    setPlayerStorageValue(pid, storage, -1)
    return TRUE
end

Code:
[14/05/2014 08:36:49] [Warning - Event::loadScript] Event onTimer not found (data/globalevents/scripts/daysremover.lua)
 
@Cronox.
No estoy seguro que funcione con ese script, habria que ver como funciona ese sistema al agregar dias vip.

@elking
The problem I see there is that the vip isnt being removed when the days are over.. Post here you script to add vip days and I will make a script to remove automatically vip from players which vip is over already..
 
@Cronox.
No estoy seguro que funcione con ese script, habria que ver como funciona ese sistema al agregar dias vip.

@elking
The problem I see there is that the vip isnt being removed when the days are over.. Post here you script to add vip days and I will make a script to remove automatically vip from players which vip is over already..

vip.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)

local vipitem = 5785 -- item ID medal  (Edit 1)

if getPlayerStorageValue(cid,11551) < 1 then
if getPlayerLevel(cid) > 1 then
doPlayerPopupFYI(cid, "congratulation ,we add 12 day to your character enjoy :)")
setPlayerStorageValue(cid, 11551, 1)
doAddVipDays(cid, 12)
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid,"You need to be at least level 1 to use this.")
end
else
doPlayerSendCancel(cid,"You are already a VIP.")
end
return TRUE
end
 

Similar threads

Back
Top