Ateş edilen bölgede blip çıkarır.
Kod:
addEventHandler ("onPlayerWeaponFire", root,
function (weapons)
if (getElementData(source, "faction") == 1 or getElementData(source, "faction") == 3 or getElementData(source, "faction") == 59 or getElementData(source, "faction") == 84 or getElementData(source, "faction") == 83 or getElementData(source, "faction") == 50) then return end
if (getElementData(source, "Fire")) then return end
setElementData(source, "Fire", true)
x,y,z = getElementPosition(source)
local weaponName = getWeaponNameFromID(weapons)
local localidade = getZoneName(x, y, z)
local teams = getPlayersInTeam( getTeamFromName("FACTİONADI1") ) and getPlayersInTeam( getTeamFromName("FACTİONADI2") ) and getPlayersInTeam( getTeamFromName("FACTİONADI3") ) and getPlayersInTeam( getTeamFromName("FACTİONADI4") )
local team = getPlayersInTeam( getTeamFromName("FACTİONADI5") )
if localidade == "San Fierro" then
tee = teams
else
tee = team
end
for key, value in ipairs( tee ) do
outputChatBox ("Bir şahıs silah ile ateş etti ( "..weaponName.." )" , value, 255, 0, 0 ,true)
outputChatBox ("Silah anonsu geldi" , value, 255, 0, 0,true)
outputChatBox ("Eklenen blip'e doğru yönel unutma 30 saniye sonra silinecektir" , value, 255, 0, 0,true)
local blip = createBlip ( x,y,z, 20 , 0, 0, 0, 255)
setElementVisibleTo(blip, root, false)
setElementVisibleTo(blip, value, true)
playSoundFrontEnd ( value, 44 )
setTimer ( function()
destroyElement(blip)
end, 30000, 1)
end
setTimer(setElementData, 30000, 1, source, "Fire", false)
end)