--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) local myTable = IsInRadiusOfCommander() if (myTable[1] == true) then if (myTable[2] == true) then if (myTable[3] == true) then if (myTable[4] == true) then player:inventory_modify("OneCash",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 Contractor Medal you gained bonus cash") end 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") end end 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 if (possibleCommander:inventory_find("Well Learned - Medal")) then if (possibleCommander:inventory_find("Contractor - Medal")) then return {true, true, true, true} end return {true, true, true, false} end return {true, true, false, false} end return {true, false, false, false} end return {false, false, false, false} endendfunction 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 endend