Skip to content

Commit

Permalink
Added blip timeout clock
Browse files Browse the repository at this point in the history
Added a timout countdown that urns the blip off after time set in config file
  • Loading branch information
Pyth3rEx committed Sep 17, 2019
1 parent e2b6ebf commit 1216ae0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ in _ThingsForTheMachine you will find all the files you'll have to put in your s
**HOW TO INSTALL:**

1 - Head to the [releases](https://github.com/Pyth3rEx/esx_fireDispatch/releases) tab to download the version of your choice (don't be stupid, take the last one... unless it's broken... then don't take it...)
2 - Put the content of `_ThingsForTheMachine` into your [ESX] folder on your FiveM server
2 - Put the content of `_ThingsForTheMachine` into your [ESX] folder on your FiveM server
3 - Go to your server's server.cfg and add `start esx_fireDispatch` *(try and put it pretty high up as this script requires to be started quite early, I recomend right below the 'required' ESX ressources and above any player-related plugins)*

**REQUEST TO PEOPLE UPDATING MY SCRIPT:**
Expand Down
10 changes: 10 additions & 0 deletions _ThingsForTheMachine/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ Citizen.CreateThread(function()
end
end

local iTimer = Config.Display["GPStimeout"] -- Sets timer value to value choses in Config file
while true do
-- Handeling spreading of fires
Wait(1000)
Expand All @@ -187,6 +188,15 @@ Citizen.CreateThread(function()
else
RemoveParticleFx(scriptData.particles[i], true)
end

-- GPS Blip countdown
if iTimer > 0 then
-- the 'Wait 1 second' part is above (right under the whileTrue loop)
iTimer = iTimer - 1 -- Removes 1 loop
print(iTimer)
else
SetBlipAlpha(fireBlips[i], 0) -- Turn blip transparent
end
end
end
end
Expand Down
6 changes: 4 additions & 2 deletions _ThingsForTheMachine/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ Config = {}

Config.Display = {

allowGPS = true -- Display callouts on the GPS
allowGPS = true, -- Display callouts on the GPS
GPStimeout = 100 -- Timer before blip gets removed from GPS

}
}
-- {prm1,prm2,prm3...}

0 comments on commit 1216ae0

Please sign in to comment.