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

Premium door

Keiro

New Member
Joined
Jun 24, 2009
Messages
285
Reaction score
0
i need a script for a premiuum door, just premium players would be able to pass , thanks..

it would be like one of those VIP doors, but for premium....


here is a VIP door

Code:
-- Credits StreamSide and Empty
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local cidPosition = getCreaturePosition(cid)
		if (item.actionid == 5789 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 your VIP soon!.")
			return TRUE
	end
	return FALSE
end

i need smth like this but for premiuum players

thanks
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local cidPosition = getCreaturePosition(cid)
	if isPremium(cid) then
		if cidPosition.x < toPosition.x then
			doTeleportThing(cid, { x = toPosition.x+1, y = toPosition.y, z = toPosition.z }, TRUE)
		else
			doTeleportThing(cid, { x = toPosition.x-1, y = toPosition.y, z = toPosition.z }, TRUE)
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You must have a premium account to pass!")
	end
	return true
end
 
Ok, so.. For those wondering how to make it work, you should put an action id on the door of your preference. In my case im using the A ID 4545. Then go to yourserver/data/actions/actions.xml and add..
Code:
<action actionid="4545" script="other/premiumdoor.lua"/>

If you are using a different action id, change it.

Then create a .lua doc on youserver/data/actions/scripts/other/ with the name "premiumdoor.lua" with the following code..
Code:
-- Credits StreamSide and Empty

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local cidPosition = getCreaturePosition(cid)
        if isPremium(cid) then
            if cidPosition.x < toPosition.x then
                doTeleportThing(cid, {x=toPosition.x+1,y=toPosition.y,z=toPosition.z}, TRUE)
                                doCreatureSay(cid, "Welcome premium player!", TALKTYPE_ORANGE_1)
            else
                doTeleportThing(cid, {x=toPosition.x-1,y=toPosition.y,z=toPosition.z}, TRUE)
                                doCreatureSay(cid, "Welcome premium player!", TALKTYPE_ORANGE_1)
            end
            return TRUE
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but only premium players can pass here! Buy your premium soon!.")
            return TRUE
    end
    return FALSE
end

And it should work..

I've changed a little the code of Keiro to make it work for the premium.
 
Ok, so.. For those wondering how to make it work, you should put an action id on the door of your preference. In my case im using the A ID 4545. Then go to yourserver/data/actions/actions.xml and add..
Code:
<action actionid="4545" script="other/premiumdoor.lua"/>

If you are using a different action id, change it.

Then create a .lua doc on youserver/data/actions/scripts/other/ with the name "premiumdoor.lua" with the following code..
Code:
-- Credits StreamSide and Empty

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local cidPosition = getCreaturePosition(cid)
        if isPremium(cid) then
            if cidPosition.x < toPosition.x then
                doTeleportThing(cid, {x=toPosition.x+1,y=toPosition.y,z=toPosition.z}, TRUE)
                                doCreatureSay(cid, "Welcome premium player!", TALKTYPE_ORANGE_1)
            else
                doTeleportThing(cid, {x=toPosition.x-1,y=toPosition.y,z=toPosition.z}, TRUE)
                                doCreatureSay(cid, "Welcome premium player!", TALKTYPE_ORANGE_1)
            end
            return TRUE
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but only premium players can pass here! Buy your premium soon!.")
            return TRUE
    end
    return FALSE
end

And it should work..

I've changed a little the code of Keiro to make it work for the premium.

Thank you man really helped me <3
 
Back
Top