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

Arena nie teleportuje gracza

zabka229

New Member
Joined
Dec 30, 2009
Messages
147
Reaction score
0
Witam, mam problem:
Gracz po wygranej na arenie 1vs1 nie zostaje teleportowany:
PHP:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)

	-- CONFIG --
	local a = {
	l = {x=274,y=15,z=7}, -- top left pos of arena
	r = {x=280,y=19,z=7}, -- bot right pos of arena
	e = {x=276,y=26,z=7}, -- loser 'll be teleported in this pos when dies
	w = {x=276,y=26,z=7}, -- winner 'll be teleported in this pos when looser dies
	}
	-- CONFIG --
	local p = getCreaturePosition(cid) -- don't touch
    local killerPos = getPlayerPosition(lastHitKiller)
	local tp = getThingFromPos(killerPos)

	if isInRange(p, a.l, a.r)  then
		doSendMagicEffect(p, CONST_ME_STUN)
		doTeleportThing(cid, a.e)
		doTeleportThing(tp, a.w)
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
		doCreatureAddMana(cid, getCreatureMaxMana(cid))
		return FALSE
	end
	return true
end

Arena jest pokryta pvp zone, skrypt jest podpiety w login.lua i creaturescripts.xml ;/
 
Nie rozumiem :D
Przegrany zostaje przesłany w miejsce temple, a wygrany zostaje na arenie ;/
 
PHP:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)

    -- CONFIG --
    local a = {
    l = {x=274,y=15,z=7}, 
    r = {x=280,y=19,z=7}, 
    e = {x=276,y=26,z=7}, 
    w = {x=276,y=26,z=7}, 
    }
    -- CONFIG --
    local p = getCreaturePosition(cid) -- dont touch
    local killerPos = getPlayerPosition(lastHitKiller)
    local tp = getThingFromPos(killerPos)

    if isInRange(p, a.l, a.r)  then
        doSendMagicEffect(p, CONST_ME_STUN)
        doTeleportThing(cid, a.e)
        doTeleportThing(tp.uid, a.w)
        doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
        doCreatureAddMana(cid, getCreatureMaxMana(cid))
        return FALSE
    end
    return true
end
 
Last edited:
Back
Top