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

Vocation SQM

Baalzephom

Member
Joined
Sep 8, 2008
Messages
45
Reaction score
5
Location
Mexico
I need a script something like this, If a player is not a Sorcerer cant pass X sqm

Please is urgent
 
Hmm this is not the requests sub-forum but well.

This script is simplified from one of mine, I didnt test it but should work because I only removed stuff from my working one.

Add this in movements.xml:
PHP:
<movevent type="StepIn" actionid="20001" event="script" value="voctile.lua"/>

Put the actionID you desire there, and on the tile of course.

And now make the file voctile.lua (on data/movements/scripts) and add this in it:

Lua:
function onStepIn(cid, item, pos)

	------------
	-- Config --
	------------

	local tilepos	=	{x = 556, y = 31, z = 7, stackpos = 1}	-- The position of the "Voc" Tile.

	local acceptpos	=	{x = 528, y = 156, z = 8, stackpos = 1}	-- Accepted position.
	local rejectpos	=	{x = 556, y = 35, z = 7, stackpos = 1}	-- Rejected position.

	local vocations = {2,3,4,6,7,8}		-- Vocations that can pass. In this case I removed Sorcerer/Master Sorcerer like you asked.
	
	function RejectPlayer()
		doTeleportThing(cid, rejectpos)
		doSendMagicEffect(tilepos, 2)
		doPlayerSendCancel(cid, "Sorry, your vocation is not allowed to pass!")
	end

	------------
	-- Script --
	------------

	if isInArray(vocations, getPlayerVocation(cid)) then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Go on!")
		doTeleportThing(cid, acceptpos)
		doSendMagicEffect(tilepos, 6)
	else
		RejectPlayer()
	end
	return 1
end

Regards.
 
Last edited:
@up
Way to big for a script like that ^.-

Better this one:
Lua:
function onStepIn(cid, item, position, fromPosition)
	if isPlayer(cid) == TRUE then
		if isSorcerer(cid) == FALSE then
			doTeleportThing(cid, fromPosition, false)
			doPlayerSendCancel(cid, "Only sorcerer can pass.")
		end	
	end	
	return TRUE
end

That script will only allow sorcerers, if you are not sorcerer you are not able to pass.
 
@Guitar
Nice script, but it:

is not needed xP

Cya!

Yeh my bad, didnt notice I pasted that part too. In my case, for the "use" I have it on my project it actually needs the onStepOut for something else but forgot to remove the line before pasting the things here :p

@Pitufo:

I just deleted some lines from a script of mine and pasted it here for the matter, but you're right aswell :)
 
Or just use Slawken's advanced tiles. Vocations, sex, groups etc. included
 
Hmm this is not the requests sub-forum but well.

This script is simplified from one of mine, I didnt test it but should work because I only removed stuff from my working one.

Add this in movements.xml:
PHP:
<movevent type="StepIn" actionid="20001" event="script" value="voctile.lua"/>

Put the actionID you desire there, and on the tile of course.

And now make the file voctile.lua (on data/movements/scripts) and add this in it:

Lua:
function onStepIn(cid, item, pos)

    ------------
    -- Config --
    ------------

    local tilepos    =    {x = 556, y = 31, z = 7, stackpos = 1}    -- The position of the "Voc" Tile.

    local acceptpos    =    {x = 528, y = 156, z = 8, stackpos = 1}    -- Accepted position.
    local rejectpos    =    {x = 556, y = 35, z = 7, stackpos = 1}    -- Rejected position.

    local vocations = {2,3,4,6,7,8}        -- Vocations that can pass. In this case I removed Sorcerer/Master Sorcerer like you asked.
   
    function RejectPlayer()
        doTeleportThing(cid, rejectpos)
        doSendMagicEffect(tilepos, 2)
        doPlayerSendCancel(cid, "Sorry, your vocation is not allowed to pass!")
    end

    ------------
    -- Script --
    ------------

    if isInArray(vocations, getPlayerVocation(cid)) then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Go on!")
        doTeleportThing(cid, acceptpos)
        doSendMagicEffect(tilepos, 6)
    else
        RejectPlayer()
    end
    return 1
end

Regards.

thank you <3
 
Back
Top