forked from AlterGamingNetwork/mellotrainer
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcl_player.lua
333 lines (249 loc) · 7.86 KB
/
cl_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
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
--[[--------------------------------------------------------------------------
*
* Mello Trainer
* (C) Michael Goodwin 2017
* http://github.com/thestonedturtle/mellotrainer/releases
*
* This menu used the Scorpion Trainer as a framework to build off of.
* https://github.com/pongo1231/ScorpionTrainer
* (C) Emre Cürgül 2017
*
* A lot of useful functionality has been converted from the lambda menu.
* https://lambda.menu
* (C) Oui 2017
*
* Additional Contributors:
* WolfKnight (https://forum.fivem.net/u/WolfKnight)
*
---------------------------------------------------------------------------]]
RegisterNUICallback("player", function(data, cb)
local playerPed = GetPlayerPed(-1)
local action = data.action
local newstate = data.newstate
local text = "~r~OFF"
if(newstate) then
text = "~g~ON"
end
-- Heal Player
if action == "heal" then
SetEntityHealth(playerPed, 200)
ClearPedBloodDamage(playerPed)
ClearPedWetness(playerPed)
if(featureKeepWet)then -- Keep Wet Check.
SetPedWetnessHeight(playerPed, 2.0)
end
drawNotification("~g~Cleaned & Healed.")
-- Body Armor
elseif action == "armor" then
SetPedArmour(playerPed, 100)
drawNotification("~g~Armor Added.")
-- Suicide
elseif action == "suicide" then
SetEntityHealth(playerPed, 0)
drawNotification("~r~You Committed Suicide.")
-- God Mode/Invincibility
elseif action == "god" then
featurePlayerInvincible = newstate
drawNotification("God Mode: "..tostring(text))
featurePlayerInvincibleUpdated = true;
-- Infinite Stamina
elseif action == "stamina" then
featurePlayerInfiniteStamina = newstate
drawNotification("Unlimited Stamina: "..tostring(text))
-- Drunk Mode
elseif action == "drunk" then
featurePlayerDrunk = newstate
drawNotification("Drunk Mode: "..tostring(text))
featurePlayerDrunkUpdated = true;
-- Invsibility Toggle
elseif action == "invisible" then
featurePlayerInvisible = newstate
drawNotification("Invisibility: "..tostring(text))
featurePlayerInvisibleUpdated = true;
-- Silent Mode
elseif action == "silent" then
featurePlayerNoNoise = newstate
drawNotification("Silent Mode: "..tostring(text))
featurePlayerNoNoiseUpdated = true;
-- Everyone Ignores you
elseif action == "everyone" then
featurePlayerIgnoredByAll = newstate
drawNotification("Everyone Ignores You: "..tostring(text))
featurePlayerIgnoredByAllUpdated = true;
-- Police Ignore You
elseif action == "police" then
featurePlayerIgnoredByPolice = newstate
drawNotification("Police Ignore You: "..tostring(text))
featurePlayerIgnoredByPoliceUpdated = true;
-- Never Wanted
elseif action == "wanted" then
featurePlayerNeverWanted = newstate
drawNotification("Never Wanted: "..tostring(text))
featurePlayerNeverWantedUpdated = true;
elseif action == "keepwet" then
featureKeepWet = newstate
featureKeepWetUpdated = true;
drawNotification("Keep Wet: "..tostring(text))
elseif action == "fastswim" then
featurePlayerFastSwim = newstate
featurePlayerFastSwimUpdated = true;
drawNotification("Fast Swim: "..tostring(text))
elseif action == "fastrun" then
featurePlayerFastRun = newstate
featurePlayerFastRunUpdated = true;
drawNotification("Fast Run: "..tostring(text))
elseif action == "superjump" then
featurePlayerSuperJump = newstate
drawNotification("Super Jump: "..tostring(text))
elseif action == "noragdoll" then
featureNoRagDoll = newstate
featureNoRagDollUpdated = true
drawNotification("No Ragdoll: "..tostring(text))
elseif action == "nightvision" then
featureNightVision = newstate
featureNightVisionUpdated = true;
drawNotification("Night Vision: "..tostring(text))
elseif action == "thermalvision" then
featureThermalVision = newstate
featureThermalVisionUpdated = true;
drawNotification("Thermal Vision: "..tostring(text))
elseif action == "radiooff" then
featureRadioAlwaysOff = newstate
featureRadioAlwaysOffUpdated = true;
drawNotification("Radio Always Off: "..tostring(text))
elseif action == "keepclean" then
featureKeepClean = newstate
drawNotification("Keep Clean: "..tostring(text))
elseif action == "restoreappearance"then
featureRestoreAppearance = newstate
drawNotification("Restore Appearance: "..tostring(text))
end
if(cb)then cb("ok") end
end)
Citizen.CreateThread(function()
while true do
Wait(1)
local playerPed = GetPlayerPed(-1)
local playerID = PlayerId()
if playerPed then
-- Keep Wet
if(featureKeepWet and featureKeepWetUpdated) then
SetPedWetnessHeight(playerPed, 2.0)
featureKeepWetUpdated = false;
end
-- Silent (NOT WORKING?)
if(featurePlayerNoNoiseUpdated)then
if(featurePlayerNoNoise)then
SetPlayerNoiseMultiplier(playerID, 0.0)
else
SetPlayerNoiseMultiplier(playerID, 1.0)
end
featurePlayerNoNoiseUpdated = false
end
-- Fast Swim
if(featurePlayerFastSwimUpdated)then
if(featurePlayerFastSwim)then
SetSwimMultiplierForPlayer(playerID, 1.49)
else
SetSwimMultiplierForPlayer(playerID, 1.0)
end
featurePlayerFastSwimUpdated = false
end
-- Fast Run
if(featurePlayerFastRunUpdated)then
if(featurePlayerFastRun)then
SetRunSprintMultiplierForPlayer(playerID, 1.49)
else
SetRunSprintMultiplierForPlayer(playerID, 1.0)
end
featurePlayerFastRunUpdated = false
end
-- Super Jump
if (featurePlayerSuperJump)then
SetSuperJumpThisFrame(playerID)
end
-- No Ragdoll
if ( featureNoRagDoll ) then
SetPedCanRagdoll( playerPed, false )
else
SetPedCanRagdoll( playerPed, true )
end
-- Night Vision
if(featureNightVisionUpdated)then
SetNightvision(featureNightVision)
featureNightVisionUpdated = false
end
-- Thermal Vision
if (featureThermalVisionUpdated)then
SetSeethrough(featureThermalVision)
featureThermalVisionUpdated = false
end
-- Radio Off
if (featureRadioAlwaysOffUpdated)then
if(IsPedInAnyVehicle(playerPed, false))then
SetVehicleRadioEnabled(GetVehiclePedIsUsing(playerPed), not featureRadioAlwaysOff)
end
SetUserRadioControlEnabled(not featureRadioAlwaysOff)
end
-- Godmode
-- if ( featurePlayerInvincible ) then
-- SetEntityInvincible( playerPed, true )
-- else
-- SetEntityInvincible( playerPed, true )
-- end
SetEntityInvincible( playerPed, featurePlayerInvincible )
-- Stamina
if featurePlayerInfiniteStamina then
RestorePlayerStamina(playerID, 1.0)
end
-- Keep Clean
if featureKeepClean then
ClearPedBloodDamage(playerPed)
end
-- Drunk
if ( featurePlayerDrunkUpdated ) then
SetPedIsDrunk( playerPed, drunk )
if ( featurePlayerDrunk ) then
_LoadClipSet( "move_m@drunk@verydrunk" )
SetPedMovementClipset( playerPed, "move_m@drunk@verydrunk", 1.0 )
ShakeGameplayCam( "DRUNK_SHAKE", 1.0 )
else
ResetPedMovementClipset( playerPed, 1.0 )
StopGameplayCamShaking( true )
RemoveClipSet( "move_m@drunk@verydrunk" )
end
featurePlayerDrunkUpdated = false;
end
-- Invisibility
if(featurePlayerInvisibleUpdated)then
if featurePlayerInvisible then
SetEntityVisible(playerPed, false, 0)
else
SetEntityVisible(playerPed, true, 0)
end
featurePlayerInvisibleUpdated = false;
end
-- Everyone Ignores Me
SetEveryoneIgnorePlayer(PlayerID, featurePlayerIgnoredByAll)
if(featurePlayerIgnoredByAll) then
SuppressShockingEventsNextFrame()
end
-- Police Ignore Me & Don't Dispatch
SetPoliceIgnorePlayer(PlayerID, featurePlayerIgnoredByPolice)
if(featurePlayerIgnoredByPolice) then
SetDispatchCopsForPlayer(playerID, false)
else
SetDispatchCopsForPlayer(playerID, true)
end
-- Never Wanted & clears wanted level.
if(featurePlayerNeverWanted) then
if(GetPlayerWantedLevel(PlayerID) > 0) then
ClearPlayerWantedLevel(PlayerID)
end
SetMaxWantedLevel(0)
else
SetMaxWantedLevel(5)
end
end
end
end)