function onStepIn(cid, item, pos, frompos)
if isPlayer(cid) == TRUE and item.actionid == 6666 and getPlayerStorageValue(cid,6666) == 1 then
doTeleportThing(cid, {x=358, y=638, z=7})
doPlayerSendTextMessage(cid,22,"You're now in the VIP zone.")
else
doPlayerSendTextMessage(cid,22,"Sorry only VIP players may enter.")
doTeleportThing(cid, frompos)
end
end
<movevent event="StepIn" actionid="6666" script="viptp.lua"/>
local vipStorage = 12345
function onStepIn(cid, fromPos)
if isPlayer(cid) == TRUE then
if getPlayerStorageValue(cid, vipStorage) == -1 then
doTeleportThing(cid, fromPos, 0)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can not enter VIP city.")
end
end
return TRUE
end
function onStepOut(cid)
if isPlayer(cid) == TRUE then
if getPlayerStorageValue(cid, vipStorage) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Enjoy your stay.")
end
end
return TRUE
end
how do i give premium players storagevalue?
<talkaction words="/vip" script="VIP.lua" />
function onSay(cid,words,param)
if getPlayerAccess(cid) > 3 and param ~= "" and getPlayerStorageValue(getPlayerByName(param), 12345) == -1 or getPlayerStorageValue(getPlayerByName(param), 12345) == 0 then
doPlayerSendTextMessage(getPlayerByName(param),20,'VIP ADDED.')
setPlayerStorageValue(getPlayerByName(param), 12345, 1)
doPlayerSendTextMessage(cid,21,'VIP ADDED.')
elseif getPlayerAccess(cid) < 3 then
doPlayerSendTextMessage(cid,25,"You're Not a Gamemaster.")
elseif getPlayerStorageValue(getPlayerByName(param), 12345) ~= -1 then
doPlayerSendTextMessage(cid,25,"Sorry, not possible.")
else
doPlayerSendTextMessage(cid,21,"Sorry, not possible.")
end
end
Thanks Jose for a fast reply. But i want it like this. When someone buy premium on my website thru donation system. I want it to add 7 days pacc and storagevalue for 7 days. So when the premium ends, they can't use the door with the storagevalue. If you know what i mean.![]()
function onStepIn(cid, item, pos)
local look = getPlayerLookDir(cid)
if isPremium(cid) ~= 1 then
if look == 0 or look == 1 then
doMoveCreature(cid, look+2)
elseif look == 2 or look == 3 then
doMoveCreature(cid, look-2)
end
doPlayerSendTextMessage(cid,21, "Sorry you need VIP account to enter.")
else
return 0
end
end
<movevent event="StepIn" actionid="6666" script="vip.lua"/>