-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclientJailer.lua
77 lines (68 loc) · 2.5 KB
/
clientJailer.lua
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
--Coded by Albo1125.
Citizen.CreateThread(function()
TriggerEvent('chat:addSuggestion', '/jail', 'Jails the specified ID for the specified for the specified length of time.', {
{ name="Jail Password", help="Jail Password"},
{ name="Subject Server ID", help="Server ID for the person getting jailed"},
{ name="Time in Seconds", help="Length of time in seconds that the subject needs to be jailed for"},
{ name="Reason for Jailing", help="Reason for the jailing of the subject"}
})
TriggerEvent('chat:addSuggestion', '/jailme', 'Jails yourself for the specified time.', {
{ name="Time in Seconds", help="Length of time in seconds that you're jailing yourself for"},
{ name="Reason for Jailing", help="Reason for jailing yourself"}
})
TriggerEvent('chat:addSuggestion', '/unjail', 'Unjails the specified ID.', {
{ name="Jail Password", help="Jail Password"},
{ name="Subject Server ID", help="Server ID for the person getting unjailed"},
})
end)
local cJ = false
local eJE = false
RegisterNetEvent("JP")
AddEventHandler("JP", function(jT)
if cJ == true then
return
end
local pP = GetPlayerPed(-1)
if DoesEntityExist(pP) then
Citizen.CreateThread(function()
local playerOldLoc = GetEntityCoords(pP, true)
SetEntityCoords(pP, 1677.233, 2658.618, 45.216)
cJ = true
eJE = false
while jT > 0 and not eJE do
pP = GetPlayerPed(-1)
RemoveAllPedWeapons(pP, true)
SetEntityInvincible(pP, true)
if IsPedInAnyVehicle(pP, false) then
ClearPedTasksImmediately(pP)
end
if jT % 30 == 0 then
TriggerEvent('chatMessage', 'SYSTEM', { 0, 0, 0 }, jT .." more seconds until release.")
end
Citizen.Wait(500)
local pL = GetEntityCoords(pP, true)
local D = Vdist(1677.233, 2658.618, 45.216, pL['x'], pL['y'], pL['z'])
if D > 90 then
SetEntityCoords(pP, 1677.233, 2658.618, 45.216)
if D > 100 then
jT = jT + 60
if jT > 1500 then
jT = 1500
end
TriggerEvent('chatMessage', 'JUDGE', { 0, 0, 0 }, "Your jail time was extended for an unlawful escape attempt.")
end
end
jT = jT - 0.5
end
TriggerServerEvent('chatMessageEntered', "SYSTEM", { 0, 0, 0 }, GetPlayerName(PlayerId()) .." was released from jail.")
SetEntityCoords(pP, 1855.807, 2601.949, 45.323)
cJ = false
SetEntityInvincible(pP, false)
end)
end
end)
RegisterNetEvent("UnJP")
AddEventHandler("UnJP", function()
eJE = true
end)
--Coded by Albo1125