• 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/Donator Medal

Northnorial

Member
Joined
May 30, 2009
Messages
742
Reaction score
5
Location
Germany
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
 
Last edited:
ADD this to the actios.xml
Code:
    <!-- VIP System -->
	<action actionid="5788" script="vipdoor.lua" />
	<action itemid="5785" script="vip.lua"/>

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


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
 
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: [...].
 
ADD this to the actios.xml
Code:
    <!-- VIP System -->
    <action actionid="5788" script="vipdoor.lua" />
    <action itemid="5785" script="vip.lua"/>
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

-.-
Credits?
 
Back
Top