• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

broadcast

penivaldo

New Member
Joined
Sep 30, 2009
Messages
21
Reaction score
0
how do I send a message to everyone when a player kills another in a determined area?

exemple:

Player 1 kill player 2 in arena! <to all players>
 
Code:
local areaFrom = {x=100, y=100, z=7}
local areaTo = {x=200, y=200, z=7}

function onKill(cid, target, lastHit)
	if lastHit and isPlayer(target) and target ~= cid and isInRange(getThingPos(cid), areaFrom, areaTo) then
		doBroadcastMessage(getCreatureName(cid) .. ' killed ' .. getCreatureName(target) .. ' in arena!')
	end

	return true
end
 
thx, and about range, how can i configure it? there are only two positions, and the arena is a square, and square have 4 sides. can u help me?
 
Green is the TOP LEFT Square.
Red is the BOTTOM RIGHT Square
Code:
local areaFrom = [COLOR="Lime"]{x=100, y=100, z=7}[/COLOR]
local areaTo = [COLOR="Red"]{x=200, y=200, z=7}[/COLOR]

XXXXXXX
XXXXXXX
XXXXXXX
 
ex.

login.lua
Lua Code:
registerCreatureEvent(cid, 'broadkill')

creaturescripts.xml
Lua Code:
<event type="kill" name"broadkill" event="script" value="broadkill.lua"/>
 
Back
Top