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

No pz cross when..

Donio

Banned User
Joined
Jun 24, 2008
Messages
4,004
Reaction score
16
Location
Manhattan, New York
Hey, im back trying to figure out how I can make so people cant use this spell when they have Pz cross or else then can just tp them self home when they are traped in war etc..

the script:

Code:
local function doTeleport(cid, count)
	if not isPlayer(cid) then
		return true
	end
	doSendAnimatedText(getThingPos(cid), 5 - count..'s', COLOR_ORANGE)
	doSendMagicEffect(getThingPos(cid), CONST_ME_YELLOW_RINGS)
	if count == 5 then
		return doCreatureSetNoMove(cid, false) and doTeleportThing(cid, {x=1000,y=999,z=7}) and doCreatureSay(cid, 'You have been teleported to temple', TALKTYPE_ORANGE_1, false, cid)
	else
		addEvent(doTeleport, 1000, cid, count + 1)
	end
	return true
end

function onCastSpell(cid, var)
	if getCreatureSkullType(cid) > SKULL_GREEN or isPlayerPzLocked(cid) then
		doPlayerSendCancel(cid, 'You cannot use this spell after killing another player or while skulled.')
	else
		return doCreatureSetNoMove(cid, true) and doTeleport(cid, 0)
	end
end
 
so like this:

Code:
local function doTeleport(cid, count)
	if not isPlayer(cid) then
		return true
	end
	doSendAnimatedText(getThingPos(cid), 5 - count..'s', COLOR_ORANGE)
	doSendMagicEffect(getThingPos(cid), CONST_ME_YELLOW_RINGS)
	if count == 5 then
		return doCreatureSetNoMove(cid, false) and doTeleportThing(cid, {x=1000,y=999,z=7}) and doCreatureSay(cid, 'You have been teleported to temple', TALKTYPE_ORANGE_1, false, cid)
	else
		addEvent(doTeleport, 1000, cid, count + 1)
	end
	return true
end

function onCastSpell(cid, var)
	setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE) 
	if getCreatureSkullType(cid) > SKULL_GREEN or isPlayerPzLocked(cid) then
		doPlayerSendCancel(cid, 'You cannot use this spell after killing another player or while skulled.')
	else
		return doCreatureSetNoMove(cid, true) and doTeleport(cid, 0)
	end
end
?
 
so like this:

Code:
local function doTeleport(cid, count)
	if not isPlayer(cid) then
		return true
	end
	doSendAnimatedText(getThingPos(cid), 5 - count..'s', COLOR_ORANGE)
	doSendMagicEffect(getThingPos(cid), CONST_ME_YELLOW_RINGS)
	if count == 5 then
		return doCreatureSetNoMove(cid, false) and doTeleportThing(cid, {x=1000,y=999,z=7}) and doCreatureSay(cid, 'You have been teleported to temple', TALKTYPE_ORANGE_1, false, cid)
	else
		addEvent(doTeleport, 1000, cid, count + 1)
	end
	return true
end

function onCastSpell(cid, var)
	setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE) 
	if getCreatureSkullType(cid) > SKULL_GREEN or isPlayerPzLocked(cid) then
		doPlayerSendCancel(cid, 'You cannot use this spell after killing another player or while skulled.')
	else
		return doCreatureSetNoMove(cid, true) and doTeleport(cid, 0)
	end
end
?

no, use getCreatureCondition(cid, CONDITION_INFIGHT)

Code:
local function doTeleport(cid, count)
	if not isPlayer(cid) then
		return true
	end
	doSendAnimatedText(getThingPos(cid), 5 - count..'s', COLOR_ORANGE)
	doSendMagicEffect(getThingPos(cid), CONST_ME_YELLOW_RINGS)
	if count == 5 then
		return doCreatureSetNoMove(cid, false) and doTeleportThing(cid, {x=1000,y=999,z=7}) and doCreatureSay(cid, 'You have been teleported to temple', TALKTYPE_ORANGE_1, false, cid)
	else
		addEvent(doTeleport, 1000, cid, count + 1)
	end
	return true
end

function onCastSpell(cid, var)
	if getCreatureSkullType(cid) > SKULL_GREEN or isPlayerPzLocked(cid) or getCreatureCondition(cid, CONDITION_INFIGHT) then
		doPlayerSendCancel(cid, 'You cannot use this spell after killing another player or while skulled.')
	else
		return doCreatureSetNoMove(cid, true) and doTeleport(cid, 0)
	end
end
 

Similar threads

Back
Top