--Global Arerna -- g_arena=nil g_player=nilfunction Arena_OnCreate(arena) -- Set our global value g_arena = arena -- Initialize random math.randomseed(os.time())endfunction 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",1) --Prize them 200 experience(using items that give exp) player:message("You killed someone, and because you were in the aura of a commander with a Well Learned Medal you gained 200 extra xp") endendfunction 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 falseendfunction Msg_OnCommand(player, command, payload, recipient, msg_type) local coords = player:coords() if (command == "?deploy") then --Someone typed ?deploy if (player:inventory_find("Crawler-pickup") > 0) then --do they have the crawler in their inventory? if (player:getVehicle():vehiclename() == "Commander") then --are they a commander? arena:vehicle_create(100, coords.x, coords.y, 0) g_arena:item_create("Machine Gun Turret Kit Lua",1, coords.x + 10, coords.y - 5) g_arena:item_create("Machine Gun Turret Kit Lua",1, coords.x - 10, coords.y - 5) g_arena:item_create("Machine Gun Turret Kit Lua",1, coords.x, coords.y + 5) end end endendfunction WellLearned(player){ if ( if (player:inventory_find("Well Learned - Medal") then --Is he holding a Well Learend Medal? if (player:getVehicle():vehiclename() == "Commander") then -- Are they a Commander? return true end endendfunction Contractor(player){ if (player:inventory_find("Contractor - Medal") then --Is he holding a Well Learend Medal? if (player:getVehicle():vehiclename() == "Commander") then -- Are they a Commander? return true end endend