-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample.res
More file actions
28 lines (25 loc) · 741 Bytes
/
Copy pathExample.res
File metadata and controls
28 lines (25 loc) · 741 Bytes
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
Citizen.registerCommand(
"ping",
(source, _, _) => {
switch source {
| source if source > 0 => {
let source = #Int(source)
let playerName: string = Citizen.invokeNative(Server.Cfx.getPlayerName, source)
let latency: int = Citizen.invokeNative(Server.Cfx.getPlayerPing, source)
let payload = #Dictionary([
(
"args",
#Array([
#String(playerName),
#String("PONG! Your latency is " ++ string_of_int(latency) ++ " ms."),
]),
),
("color", #Array([#Int(5), #Int(255), #Int(255)])),
])
Citizen.emitNet("chat:addMessage", #Array([source, payload]))
}
| _ => ()
}
},
false,
)