-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathplayer.lua
52 lines (43 loc) · 1.09 KB
/
player.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
local godmode, stamina
RegisterNUICallback("player", function(data, cb)
local playerPed = GetPlayerPed(-1)
local action = data.action
local newstate = data.newstate
if action == "heal" then
SetEntityHealth(playerPed, 200)
drawNotification("~g~Player healed.")
elseif action == "armor" then
SetPedArmour(playerPed, 100)
drawNotification("~g~Added armor to Player.")
elseif action == "suicide" then
SetEntityHealth(playerPed, 0)
drawNotification("~g~Killed Player.")
elseif action == "god" then
godmode = newstate
elseif action == "stamina" then
stamina = newstate
end
cb("ok")
end)
RegisterNUICallback("playerskin", function(data, cb)
local model = GetHashKey(data.action)
RequestModel(model)
while not HasModelLoaded(model) do
Wait(1)
end
SetPlayerModel(PlayerId(), model)
drawNotification("~g~Changed Player Model.")
cb("ok")
end)
Citizen.CreateThread(function()
while true do
Wait(1)
local playerPed = GetPlayerPed(-1)
if playerPed then
SetEntityInvincible(playerPed, godmode)
if stamina then
RestorePlayerStamina(PlayerId(), 1.0)
end
end
end
end)