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

PZ log out

Werewolf

Forbidden Ascension
Joined
Jul 15, 2012
Messages
886
Reaction score
123
:eek: does anyone have a script that when you walk into a PZ zone, you lose battle sign, or removes it so you can Log out right away in PZ?
 
I think you can use this as checking if tile is Protection Zone:
Lua:
if getTilePzInfo(pos) == true
And this to remove condition infight:
Lua:
doRemoveCondition(cid, CONDITION_INFIGHT)
 
Well, there are many ways to do this. MANY. I'll give you a simple one though, it should work fine for your needs.

1- Go to "datapack/globalevents/" and open "globalevents.xml", then add this line to it:
XML:
<globalevent name="removesigninpz" interval="500" event="script" value="removesigninpz.lua"/>

2- Go to "datapack/globalevents/scripts/" and create a new file, name it "removesigninpz.lua", then add this script to it:
Lua:
local function cancelConditions(cid)
	doRemoveCondition(cid, CONDITION_INFIGHT)
	doRemoveCondition(cid, CONDITION_FIRE)
	doRemoveCondition(cid, CONDITION_ENERGY)
	doRemoveCondition(cid, CONDITION_DRUNK)
	doRemoveCondition(cid, CONDITION_PARALYZE)
	doRemoveCondition(cid, CONDITION_CURSED)
	doRemoveCondition(cid, CONDITION_HUNTING)
	doRemoveCondition(cid, CONDITION_BLEEDING)
	doRemoveCondition(cid, CONDITION_POISON)
    return false
end
function onThink(interval)
    for _, cid in ipairs(getPlayersOnline()) do
	    local pos, tile = getThingPos(cid), getTileThingByPos(getThingPos(cid))
		if getTilePzInfo(pos) == true then
		    cancelConditions(cid)
		end
	end
end

AND YOUR DONE! CONGRATULATIONS!
Now tell me if it worked or not D:.
 
@zuma the Op asked for a movevent

not global events, just trolling

Well, if you had the knowledge to notice that you can't do it using move events (unless you use action ids on each PZ sqm or you edit the source to add an onMove function), you'd realize that using global events is the best way to do what OP requested, just trolling.
 
Well, if you had the knowledge to notice that you can't do it using move events (unless you use action ids on each PZ sqm or you edit the source to add an onMove function), you'd realize that using global events is the best way to do what OP requested, just trolling.

My thoughts exactly.
 
[21/07/2013 14:32:54] [Error - GlobalEvents::think] Couldn't execute event: removesigninpz

- - - Updated - - -

i will REP+ WHO HELP ME.
 
Last edited:
Well, there are many ways to do this. MANY. I'll give you a simple one though, it should work fine for your needs.

1- Go to "datapack/globalevents/" and open "globalevents.xml", then add this line to it:
XML:
<globalevent name="removesigninpz" interval="500" event="script" value="removesigninpz.lua"/>

2- Go to "datapack/globalevents/scripts/" and create a new file, name it "removesigninpz.lua", then add this script to it:
Lua:
local function cancelConditions(cid)
	doRemoveCondition(cid, CONDITION_INFIGHT)
	doRemoveCondition(cid, CONDITION_FIRE)
	doRemoveCondition(cid, CONDITION_ENERGY)
	doRemoveCondition(cid, CONDITION_DRUNK)
	doRemoveCondition(cid, CONDITION_PARALYZE)
	doRemoveCondition(cid, CONDITION_CURSED)
	doRemoveCondition(cid, CONDITION_HUNTING)
	doRemoveCondition(cid, CONDITION_BLEEDING)
	doRemoveCondition(cid, CONDITION_POISON)
    return false
end
function onThink(interval)
    for _, cid in ipairs(getPlayersOnline()) do
	    local pos, tile = getThingPos(cid), getTileThingByPos(getThingPos(cid))
		if getTilePzInfo(pos) == true then
		    cancelConditions(cid)
		end
	end
end

AND YOUR DONE! CONGRATULATIONS!
Now tell me if it worked or not D:.

where is return true ?
 
Lua:
local function cancelConditions(cid)
	doRemoveCondition(cid, CONDITION_INFIGHT)
	doRemoveCondition(cid, CONDITION_FIRE)
	doRemoveCondition(cid, CONDITION_ENERGY)
	doRemoveCondition(cid, CONDITION_DRUNK)
	doRemoveCondition(cid, CONDITION_PARALYZE)
	doRemoveCondition(cid, CONDITION_CURSED)
	doRemoveCondition(cid, CONDITION_HUNTING)
	doRemoveCondition(cid, CONDITION_BLEEDING)
	doRemoveCondition(cid, CONDITION_POISON)
    return false
end
function onThink(interval)
    for _, cid in ipairs(getPlayersOnline()) do
	    local pos, tile = getThingPos(cid), getTileThingByPos(getThingPos(cid))
		if getTilePzInfo(pos) == true then
		    cancelConditions(cid)
		end
	end
return true
end
Check Now.
 
Back
Top Bottom