forked from ItsAmmarB/DeathScript
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserver.lua
More file actions
84 lines (65 loc) · 2.82 KB
/
Copy pathserver.lua
File metadata and controls
84 lines (65 loc) · 2.82 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
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
78
79
80
81
82
83
84
------ MADE BY MAX F. ------
--FOR JUSTICE COMMUNITY RP--
----------------------------
--------------------------------------------------------------------
------------------CODE STARTS FROM UNDER THIS LINE------------------
--------------------------------------------------------------------
--VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV--
--------------------------------------------------
----------------REGISTERING EVENTS----------------
--------------------------------------------------
RegisterServerEvent('DeathScript:AdminReturn')
--------------------------------------------------
---------------REGISTERING COMMAND---------------
--------------------------------------------------
----------------CIVILIAN COMMANDS----------------
--------------------------------------------------
RegisterCommand('togds', function(source, args, rawCommand)
TriggerClientEvent('DeathScript:Toggle', -1)
end, true)
RegisterCommand('revive', function(source, args, rawCommand)
TriggerClientEvent('DeathScript:Revive', source)
end, false)
RegisterCommand('respawn', function(source, args, rawCommand)
TriggerClientEvent('DeathScript:Respawn', source)
end, false)
--------------------------------------------------
---------------REGISTERING COMMAND---------------
--------------------------------------------------
------------------ADMIN COMMANDS------------------
--------------------------------------------------
RegisterCommand('adrev', function(source, args, rawCommand)
local target = tonumber( args[1] )
if target then
TriggerClientEvent('DeathScript:Revive', target, true)
TriggerClientEvent("DeathScript:ShowNotification", target, "~g~You were admin revived")
else
TriggerClientEvent('DeathScript:Revive', source, true)
end
end, true)
RegisterCommand('adres', function(source, args, rawCommand)
local target = tonumber( args[1] )
if target then
TriggerClientEvent('DeathScript:Respawn', target, true)
TriggerClientEvent("DeathScript:ShowNotification", target, "~g~You were admin respawned")
else
TriggerClientEvent('DeathScript:Respawn', source, true)
end
end, true)
RegisterCommand('setrespawntime', function(source, args, rawCommand)
if args[1] then
TriggerClientEvent('DeathScript:SetRespawnTime', -1, args[1])
else
TriggerClientEvent("DeathScript:ShowNotification", source, "~r~You need to specify the respawn time!")
end
end, true)
RegisterCommand('setrevivetime', function(source, args, rawCommand)
if args[1] then
TriggerClientEvent('DeathScript:SetReviveime', -1, args[1])
else
TriggerClientEvent("DeathScript:ShowNotification", source, "~r~You need to specify the revive time!")
end
end, true)
RegisterCommand('deathtoggle', function(source, args, rawCommand)
TriggerClientEvent('DeathScript:Toggle', -1, args[1])
end, true)