Hidden/Spoiler:
[code] pingmaker = OnObjectDamage(function(object, damager)
-- if GetObjectLastHitWeaponClass(object) == "imp_weap_inf_wrist_rocket" and GetObjectTeam(object) == 2 then
if GetObjectLastHitWeaponClass(object) == "imp_weap_inf_wrist_rocket" then
--When the weapon is fired:
minChange = 300 --or whatever distance you want to search
x, y, z = GetWorldPosition(damager)
playerPos = {x, y, z}
for i, v in pairs(unitsAlive) do
local x, y, z = GetWorldPosition(unit)
searchingPos = {x, y, z}
if math.abs(searchingPos[1] - playerPos[1]) < minChange
and math.abs(searchingPos[2] - playerPos[2]) < minChange
and math.abs(searchingPos[3] - playerPos[3]) < minChange
and playerTeam == 2 then
ShowMessageText("level.0CW.ping")
pingcount = pingcount + 1;
CreateEntity("com_item_null", GetEntityMatrix(object), "ping"..pingcount)
MapAddEntityMarker("ping"..pingcount, "hud_objective_icon1", 5.0, 1, "BLUE", true, true, true)
if pingcount == 1 then
StartTimer(ping1)
end
if pingcount == 2 then
StartTimer(ping2)
end
if pingcount == 3 then
StartTimer(ping3)
end
if pingcount == 4 then
StartTimer(ping4)
end
if pingcount == 5 then
StartTimer(ping5)
end
if pingcount == 6 then
StartTimer(ping6)
end
if pingcount == 7 then
StartTimer(ping7)
end
if pingcount == 8 then
StartTimer(ping8)
end
if pingcount == 9 then
StartTimer(ping9)
end
if pingcount == 10 then
StartTimer(ping10)
end
if pingcount == 11 then
StartTimer(ping11)
end
if pingcount == 12 then
StartTimer(ping12)
end
if pingcount == 13 then
StartTimer(ping13)
end
if pingcount == 14 then
StartTimer(ping14)
end
if pingcount == 15 then
StartTimer(ping15)
end
if pingcount == 16 then
StartTimer(ping16)
end
if pingcount == 17 then
StartTimer(ping17)
end
if pingcount == 18 then
StartTimer(ping18)
end
if pingcount == 19 then
StartTimer(ping19)
end
if pingcount == 20 then
StartTimer(ping20)
end
if pingcount == 21 then
StartTimer(ping21)
end
if pingcount == 22 then
StartTimer(ping22)
end
if pingcount == 23 then
StartTimer(ping23)
end
if pingcount == 24 then
StartTimer(ping24)
end
if pingcount == 25 then
StartTimer(ping25)
end
if pingcount == 26 then
StartTimer(ping26)
end
if pingcount == 27 then
StartTimer(ping27)
end
if pingcount == 28 then
StartTimer(ping28)
end
if pingcount == 29 then
StartTimer(ping29)
end
if pingcount == 30 then
StartTimer(ping30)
end
if pingcount == 31 then
StartTimer(ping31)
end
if pingcount == 32 then
StartTimer(ping32)
end
if pingcount == 33 then
StartTimer(ping33)
end
if pingcount == 34 then
StartTimer(ping34)
end
if pingcount == 35 then
StartTimer(ping35)
end
if pingcount == 36 then
StartTimer(ping36)
end
if pingcount == 37 then
StartTimer(ping37)
end
if pingcount == 38 then
StartTimer(ping38)
end
if pingcount == 39 then
StartTimer(ping39)
end
if pingcount == 40 then
StartTimer(ping40)
end
if pingcount == 41 then
StartTimer(ping41)
end
if pingcount == 42 then
StartTimer(ping42)
end
if pingcount == 43 then
StartTimer(ping43)
end
if pingcount == 44 then
StartTimer(ping44)
end
if pingcount == 45 then
StartTimer(ping45)
end
if pingcount == 46 then
StartTimer(ping46)
end
if pingcount == 47 then
StartTimer(ping47)
end
if pingcount == 48 then
StartTimer(ping48)
end
if pingcount == 49 then
StartTimer(ping4)
end
if pingcount == 50 then
StartTimer(ping50)
end
end
end
end)[/code]
-- if GetObjectLastHitWeaponClass(object) == "imp_weap_inf_wrist_rocket" and GetObjectTeam(object) == 2 then
if GetObjectLastHitWeaponClass(object) == "imp_weap_inf_wrist_rocket" then
--When the weapon is fired:
minChange = 300 --or whatever distance you want to search
x, y, z = GetWorldPosition(damager)
playerPos = {x, y, z}
for i, v in pairs(unitsAlive) do
local x, y, z = GetWorldPosition(unit)
searchingPos = {x, y, z}
if math.abs(searchingPos[1] - playerPos[1]) < minChange
and math.abs(searchingPos[2] - playerPos[2]) < minChange
and math.abs(searchingPos[3] - playerPos[3]) < minChange
and playerTeam == 2 then
ShowMessageText("level.0CW.ping")
pingcount = pingcount + 1;
CreateEntity("com_item_null", GetEntityMatrix(object), "ping"..pingcount)
MapAddEntityMarker("ping"..pingcount, "hud_objective_icon1", 5.0, 1, "BLUE", true, true, true)
if pingcount == 1 then
StartTimer(ping1)
end
if pingcount == 2 then
StartTimer(ping2)
end
if pingcount == 3 then
StartTimer(ping3)
end
if pingcount == 4 then
StartTimer(ping4)
end
if pingcount == 5 then
StartTimer(ping5)
end
if pingcount == 6 then
StartTimer(ping6)
end
if pingcount == 7 then
StartTimer(ping7)
end
if pingcount == 8 then
StartTimer(ping8)
end
if pingcount == 9 then
StartTimer(ping9)
end
if pingcount == 10 then
StartTimer(ping10)
end
if pingcount == 11 then
StartTimer(ping11)
end
if pingcount == 12 then
StartTimer(ping12)
end
if pingcount == 13 then
StartTimer(ping13)
end
if pingcount == 14 then
StartTimer(ping14)
end
if pingcount == 15 then
StartTimer(ping15)
end
if pingcount == 16 then
StartTimer(ping16)
end
if pingcount == 17 then
StartTimer(ping17)
end
if pingcount == 18 then
StartTimer(ping18)
end
if pingcount == 19 then
StartTimer(ping19)
end
if pingcount == 20 then
StartTimer(ping20)
end
if pingcount == 21 then
StartTimer(ping21)
end
if pingcount == 22 then
StartTimer(ping22)
end
if pingcount == 23 then
StartTimer(ping23)
end
if pingcount == 24 then
StartTimer(ping24)
end
if pingcount == 25 then
StartTimer(ping25)
end
if pingcount == 26 then
StartTimer(ping26)
end
if pingcount == 27 then
StartTimer(ping27)
end
if pingcount == 28 then
StartTimer(ping28)
end
if pingcount == 29 then
StartTimer(ping29)
end
if pingcount == 30 then
StartTimer(ping30)
end
if pingcount == 31 then
StartTimer(ping31)
end
if pingcount == 32 then
StartTimer(ping32)
end
if pingcount == 33 then
StartTimer(ping33)
end
if pingcount == 34 then
StartTimer(ping34)
end
if pingcount == 35 then
StartTimer(ping35)
end
if pingcount == 36 then
StartTimer(ping36)
end
if pingcount == 37 then
StartTimer(ping37)
end
if pingcount == 38 then
StartTimer(ping38)
end
if pingcount == 39 then
StartTimer(ping39)
end
if pingcount == 40 then
StartTimer(ping40)
end
if pingcount == 41 then
StartTimer(ping41)
end
if pingcount == 42 then
StartTimer(ping42)
end
if pingcount == 43 then
StartTimer(ping43)
end
if pingcount == 44 then
StartTimer(ping44)
end
if pingcount == 45 then
StartTimer(ping45)
end
if pingcount == 46 then
StartTimer(ping46)
end
if pingcount == 47 then
StartTimer(ping47)
end
if pingcount == 48 then
StartTimer(ping48)
end
if pingcount == 49 then
StartTimer(ping4)
end
if pingcount == 50 then
StartTimer(ping50)
end
end
end
end)[/code]