Northnorial
Member
I need the action for a VIP Medal. I mean if i use this medal I can enter the door of VIP Zone. Can someone give me a script like this?
Using 8.40 TFS
Thanks
Using 8.40 TFS
Thanks
Last edited:
<!-- VIP System -->
<action actionid="5788" script="vipdoor.lua" />
<action itemid="5785" script="vip.lua"/>
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! Now you can enter to the vip zone", TALKTYPE_ORANGE_1)
doBroadcastMessage("CONGRATULATIONS! " .. name .. "! Now you can enter to the vip zone")
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 a donator.")
-- end
return TRUE
end
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!", TALKTYPE_ORANGE_1)
else
doTeleportThing(cid, {x=toPosition.x,y=toPosition.y,z=toPosition.z}, TRUE)
doCreatureSay(cid, "Welcome VIP!", TALKTYPE_ORANGE_1)
end
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only vips can enter here.")
return TRUE
end
return FALSE
end
And why you are using 23:27 You see a target.
ItemID: [5788]. As a VIP Door?
Isn't it normally a door?
Like this: 23:27 You see a closed door.
ItemID: [1257].
ActionID: [...].
And why should i use it? it's a target not a door.. :[
i want a door
If i do /i 5788 on my server It's a target :/ I'm using 8.40 TFS 0.3.1
I'll test later for it works with a door. Thank you
ADD this to the actios.xml
vip.luaCode:<!-- VIP System --> <action actionid="5788" script="vipdoor.lua" /> <action itemid="5785" script="vip.lua"/>
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!", TALKTYPE_ORANGE_1) else doTeleportThing(cid, {x=toPosition.x,y=toPosition.y,z=toPosition.z}, TRUE) doCreatureSay(cid, "Welcome VIP!", TALKTYPE_ORANGE_1) end return TRUE else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only vips can enter here.") return TRUE end return FALSE end
doCreatureSay(cid, "Welcome VIP!", TALKTYPE_ORANGE_1) = Orange.I'm using this VIP System now. But can i use another color? Not TALKTYPE_ORANGE_1 ? Is that possiple?