Skip to content

Commit

Permalink
1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
FAXES authored Nov 26, 2018
1 parent 3753f59 commit 59e1393
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 0 deletions.
25 changes: 25 additions & 0 deletions License.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Terms of Use

(Below the term "product" is used to describe the script / modification)

This script is freeware and is not to be exploited for personal, financial or commercial gain. This product is provided without any form of warranty.
Therefore, responsibility for any damages caused by this product or its misuse rest solely with the user, as the author(s) will accept no liability.

- This copy of terms must remain in its original state and must not be modified in anyway

- These terms must be alongside the product at all times

- Do not re-release with out permission (just ask for permission)

- Do not redistribute to any other sites. This script is only to be published on verified sites by FAXES

- Editing / abusing these terms will result in action

### Summery
So basically you can edit anything with the product (except the terms), but you can not release the product nor release the edited version without written permission from FAXES.

Terms are also available at
[www.faxes.zone/scripts/terms](http://faxes.zone/scripts/terms)


![alt text](http://faxes.zone/files/logos/FAXES%20ToUSML.png "FAXES ToU Icon")
9 changes: 9 additions & 0 deletions __resource.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
------------------------------------
--- Police Backup, Made by FAXES ---
------------------------------------

resource_manifest_version '05cfa83c-a124-4cfa-a768-c24a5811d8f9'

client_script "client.lua"

server_script "server.lua"
67 changes: 67 additions & 0 deletions client.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
------------------------------------
--- Police Backup, Made by FAXES ---
------------------------------------

--- CONFIG ---
local leoPeds = {
"s_m_y_cop_01",
}

--------------------------------------------------------------------------------------------------------
function checkPed(ped, PedList)
for i = 1, #PedList do
if GetHashKey(PedList[i]) == GetEntityModel(ped) then
return true
end
end
return false
end

function ShowInfo(text)
SetNotificationTextEntry("STRING")
AddTextComponentString(text)
DrawNotification(false, false)
end

function playCode99Sound()
PlaySoundFrontend(-1, "TIMER_STOP", "HUD_MINI_GAME_SOUNDSET", 1)
Wait(900)
PlaySoundFrontend(-1, "TIMER_STOP", "HUD_MINI_GAME_SOUNDSET", 1)
Wait(900)
PlaySoundFrontend(-1, "TIMER_STOP", "HUD_MINI_GAME_SOUNDSET", 1)
end

RegisterNetEvent('Fax:ShowInfo')
AddEventHandler('Fax:ShowInfo', function(notetext)
ShowInfo(notetext)
end)

RegisterNetEvent('Fax:BackupReq')
AddEventHandler('Fax:BackupReq', function(bk, s)
local src = s
local bkLvl = bk
local bkLvlTxt = "N/A"
local coords = GetEntityCoords(GetPlayerPed(GetPlayerFromServerId(src)))
local street1 = GetStreetNameAtCoord(coords.x, coords.y, coords.z, Citizen.ResultAsInteger(), Citizen.ResultAsInteger())
local streetName = (GetStreetNameFromHashKey(street1))

if checkPed(GetPlayerPed(PlayerId()), leoPeds) then
if bkLvl == "1" then
bkLvlTxt = "~b~code 1"
elseif bkLvl == "2" then
bkLvlTxt = "~y~code 2"
elseif bkLvl == "3" then
bkLvlTxt = "~r~CODE 3"
PlaySoundFrontend(-1, "Mission_Pass_Notify", "DLC_HEISTS_GENERAL_FRONTEND_SOUNDS", 1)
elseif bkLvl == "99" then
bkLvlTxt = "~r~~h~CODE 99"
end

ShowInfo("An officer is in need of assistance " .. bkLvlTxt .. "~s~. ~o~Location: ~s~" .. streetName .. ".")
SetNewWaypoint(coords.x, coords.y)

if bkLvl == "99" then
playCode99Sound()
end
end
end)
22 changes: 22 additions & 0 deletions server.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
------------------------------------
--- Police Backup, Made by FAXES ---
------------------------------------

RegisterCommand("bk", function(source, args, rawCommand)
local s = source
local bkLvl = args[1]

if not bkLvl then
TriggerClientEvent("Fax:ShowInfo", source, "~y~Please specify a code level ~n~~s~1, 2, 3")
elseif bkLvl == "1" then
TriggerClientEvent("Fax:BackupReq", -1, bkLvl, s)
elseif bkLvl == "2" then
TriggerClientEvent("Fax:BackupReq", -1, bkLvl, s)
elseif bkLvl == "3" then
TriggerClientEvent("Fax:BackupReq", -1, bkLvl, s)
elseif bkLvl == "99" then
TriggerClientEvent("Fax:BackupReq", -1, bkLvl, s)
elseif bkLvl ~= "1" or bkLvl ~= "2" or bkLvl ~= "3" or bkLvl ~= "99" then
TriggerClientEvent("Fax:ShowInfo", source, "~y~Invalid code level")
end
end)

0 comments on commit 59e1393

Please sign in to comment.