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

Lua Donate door :S

Kask

Banned User
Joined
Jan 3, 2008
Messages
376
Reaction score
1
Hello, i will explain, a bit badly, because not very much English:D

Im got one problem with door, if i put action on "gate of experiense" door, or nothing can enter "donatores cant", or all can enter, or the door not closed...

Please help :S

Sorry for my english :$
 
but i want only for sex door hmm, i change sex 0 to 5, and 5 are for donator, can be i need one script, if you can give me that :)

Thanks.
 
here you go :)
PHP:
function onUse(cid, item, frompos, item2, topos)
	if item.itemactionid == 20005
		if getPlayerSex(cid) == 5 then
			pos = getPlayerPosition(cid)

			if pos.x == topos.x then
				if pos.y < topos.y then
					pos.y = topos.y + 1
				else
					pos.y = topos.y - 1
				end
			elseif pos.y == topos.y then
				if pos.x < topos.x then
					pos.x = topos.x + 1
				else
					pos.x = topos.x - 1
				end
			else
				doPlayerSendTextMessage(cid,22,'Stand in front of the door.')
				return 1
			end

			doTeleportThing(cid,pos)
			doSendMagicEffect(topos,12)
		else
			doPlayerSendTextMessage(cid,22,'You need to be donater to use this door.')
		end
		return 1
	else
		return 0
	end
end
 
i got this!

Code:
function onUse(cid, item, frompos, item2, topos)
SEX = getPlayerSex(cid)

if item.uid == 12345 then

if SEX >= 5 then
if SEX >= 6 then
GENDER = "Donator"
pos = getPlayerPosition(cid)

if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,22,'Stand in front of the door.')
return 1
end

doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid,22,'Only Donators Players.')
end
return 1
end
end
 
I put this
Code:
	<action itemid="12345" script="donationdoor.lua" />
And door of map editor

in Action ID "Door gate of experiense"
 
What do u mean with this: in Action ID "Door gate of experiense"...
anyway here u go do this exactly
Go to actions/scripts
copy paste any .lua file
and rename it to "donationdoor"
and paste this in it:
PHP:
function onUse(cid, item, frompos, item2, topos)
    if item.itemactionid == 20005
        if getPlayerSex(cid) == 5 then
            pos = getPlayerPosition(cid)

            if pos.x == topos.x then
                if pos.y < topos.y then
                    pos.y = topos.y + 1
                else
                    pos.y = topos.y - 1
                end
            elseif pos.y == topos.y then
                if pos.x < topos.x then
                    pos.x = topos.x + 1
                else
                    pos.x = topos.x - 1
                end
            else
                doPlayerSendTextMessage(cid,22,'Stand in front of the door.')
                return 1
            end

            doTeleportThing(cid,pos)
            doSendMagicEffect(topos,12)
        else
            doPlayerSendTextMessage(cid,22,'You need to be donater to use this door.')
        end
        return 1
    else
        return 0
    end
end

and in actions.xml
post this
Code:
	<action actionid="20005" script="donationdoor.lua" />
and in map editor create a door with action id 20005. it should work
 
Back
Top