-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclient.lua
More file actions
43 lines (40 loc) · 1.44 KB
/
client.lua
File metadata and controls
43 lines (40 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--===============================================--===============================================
--= stationary radars based on https://github.com/DreanorGTA5Mods/StationaryRadar =
--===============================================--===============================================
local radares = {
{x = 379.68807983398, y = -1048.3527832031, z = 29.250692367554},
{x = -253.10794067383, y = -630.20385742188, z = 33.002685546875},
}
Citizen.CreateThread(function()
while true do
Wait(0)
for k,v in pairs(radares) do
local player = GetPlayerPed(-1)
local coords = GetEntityCoords(player, true)
if Vdist2(radares[k].x, radares[k].y, radares[k].z, coords["x"], coords["y"], coords["z"]) < 10 then
Citizen.Trace("estas pasando por un radar")
checkSpeed()
end
end
end
end)
function checkSpeed()
local pP = GetPlayerPed(-1)
local speed = GetEntitySpeed(pP)
local vehicle = GetVehiclePedIsIn(pP, false)
local driver = GetPedInVehicleSeat(vehicle, -1)
local maxspeed = 10
local kmhspeed = math.ceil(speed*3.6)
if kmhspeed > maxspeed and driver == pP then
Citizen.Wait(250)
TriggerServerEvent('cobrarMulta')
exports.pNotify:SetQueueMax("left", 1)
exports.pNotify:SendNotification({
text = "You've been fined for speeding.",
type = "error",
timeout = 5000,
layout = "centerLeft",
queue = "left"
})
end
end