All pastes #544739 Raw Edit

Unnamed

public lua v1 · immutable
·published 2007-06-06 15:53 UTC
rendered paste body
 --Global Arerna -- g_arena=nil g_player=nilfunction Arena_OnCreate(arena)	-- Set our global value	g_arena = arena	-- Initialize random	math.randomseed(os.time())end function Player_OnJoin(player)	if (player.m_name == "Toriad") then		g_arena:message("Your almighty God has entered! Worship him")		else	g_arena:message("" .. player.m_name .. " has joined")	endend  function Player_OnDeath(killer,victim)  	if (IsInRadiusOfCommander(killer) == true) then  		player:inventory_modify("OneExperience",200) --Prize them 200 experience(using items that give exp)  		player:message("You killed someone, and because you were in the aura of a commander you gained 200 extra xp")  	end endfunction IsInRadiusOfCommander(player)  	local coords = player:coords() 	local radius = 10  	local playersInArea = { } --make a table which will hold the players in the area  	local numberOfPlayers = g_arena:GetPlayersInArea(playersInArea, coords.x, coords.y, radius)   	for i = 1, numberOfPlayers do  		local possibleCommander = playersInArea[i]  		if (possibleCommander:getTeam().m_name == player:getTeam().m_name) then			if (possibleCommander:getVehicle():vehiclename() == "Commander") then 				return true  			end 		end 	end 	return false end