-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.lua
316 lines (294 loc) · 13.6 KB
/
client.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
local oncooldown = false
Citizen.CreateThread(function()
while true do
Citizen.Wait(10)
if oncooldown then
Wait(300000)
oncooldown = false
end
end
end)
RegisterNetEvent("syn:carrot")
AddEventHandler("syn:carrot", function(source)
local Ped = PlayerPedId()
local onhorse = IsPedOnMount(Ped)
local _source = source
if onhorse then
local horse = GetMount(Ped)
TaskAnimalInteraction(Ped, horse, -224471938, GetHashKey("p_carrot02x"), 0) --Animazione
local valueHealth = Citizen.InvokeNative(0x36731AC041289BB1, horse, 0)
local valueStamina = Citizen.InvokeNative(0x36731AC041289BB1, horse, 1)
if not tonumber(valueHealth) then valueHealth = 0 end
if not tonumber(valueStamina) then valueStamina = 0 end
TriggerEvent("vorp:TipRight", "You feed your horse a Carrot", 4000)
Citizen.Wait(3500)
Citizen.InvokeNative(0xC6258F41D86676E0, horse, 0, valueHealth + 30)
Citizen.InvokeNative(0xC6258F41D86676E0, horse, 1, valueStamina + 30)
if not oncooldown then
oncooldown = true
TriggerEvent('syn:exp', horse, 5) -- horse exp increase by 5
end
else
TaskItemInteraction(PlayerPedId(), nil, GetHashKey("EAT_MULTI_BITE_FOOD_SPHERE_D8-2_SANDWICH_QUICK_LEFT_HAND"), true, 0, 0)
TriggerEvent("vorp:TipRight", "You eat a Carrot", 4000)
Citizen.Wait(1000)
TriggerEvent('fred_meta:consume', 10,5,0,0,0.0,0,0,0,0.0,0.0) --Fred Metabolism
PlaySoundFrontend("Core_Fill_Up", "Consumption_Sounds", true, 0)
local number = Citizen.InvokeNative(0x36731AC041289BB1, PlayerPedId(), 1)
if number then
print (number)
Citizen.InvokeNative(0xC6258F41D86676E0, PlayerPedId(),1, number + 25)
else
Citizen.InvokeNative(0xC6258F41D86676E0, PlayerPedId(),1, 25)
end
Citizen.Wait(1000)
end
end)
RegisterNetEvent("syn:haycube")
AddEventHandler("syn:haycube", function(source)
local Ped = PlayerPedId()
local onhorse = IsPedOnMount(Ped)
local _source = source
if onhorse then
local horse = GetMount(Ped)
TaskAnimalInteraction(Ped, horse, -224471938, GetHashKey("s_horsnack_haycube01x"), 0)
local valueHealth = Citizen.InvokeNative(0x36731AC041289BB1, horse, 0)
local valueStamina = Citizen.InvokeNative(0x36731AC041289BB1, horse, 1)
if not tonumber(valueHealth) then valueHealth = 0 end
if not tonumber(valueStamina) then valueStamina = 0 end
TriggerEvent("vorp:TipRight", "You feed your horse a Hay Cube", 4000)
Citizen.Wait(3500)
Citizen.InvokeNative(0xC6258F41D86676E0, horse, 0, valueHealth + 15)
Citizen.InvokeNative(0xC6258F41D86676E0, horse, 1, valueStamina + 5)
end
if not oncooldown then
oncooldown = true
TriggerEvent('syn:exp', horse, 5) -- horse exp increase by 5
end
end)
RegisterNetEvent("syn:horsemeal")
AddEventHandler("syn:horsemeal", function(source)
local Ped = PlayerPedId()
local onhorse = IsPedOnMount(Ped)
local _source = source
if onhorse then
local horse = GetMount(Ped)
TaskAnimalInteraction(Ped, horse, -224471938, GetHashKey("s_horsnack_haycube01x"), 0)
local valueHealth = Citizen.InvokeNative(0x36731AC041289BB1, horse, 0)
local valueStamina = Citizen.InvokeNative(0x36731AC041289BB1, horse, 1)
if not tonumber(valueHealth) then valueHealth = 0 end
if not tonumber(valueStamina) then valueStamina = 0 end
TriggerEvent("vorp:TipRight", "You feed your horse a Horse Ration", 4000)
Citizen.Wait(3500)
Citizen.InvokeNative(0xC6258F41D86676E0, horse, 0, valueHealth + 25)
Citizen.InvokeNative(0xC6258F41D86676E0, horse, 1, valueStamina + 5)
end
if not oncooldown then
oncooldown = true
TriggerEvent('syn:exp', horse, 5) -- horse exp increase by 5
end
end)
RegisterNetEvent("syn:wildcarrot")
AddEventHandler("syn:wildcarrot", function(source)
local Ped = PlayerPedId()
local onhorse = IsPedOnMount(Ped)
local _source = source
if onhorse then
local horse = GetMount(Ped)
TaskAnimalInteraction(Ped, horse, -224471938, GetHashKey("p_carrot02x"), 0) --Animazione
local valueHealth = Citizen.InvokeNative(0x36731AC041289BB1, horse, 0)
local valueStamina = Citizen.InvokeNative(0x36731AC041289BB1, horse, 1)
if not tonumber(valueHealth) then valueHealth = 0 end
if not tonumber(valueStamina) then valueStamina = 0 end
TriggerEvent("vorp:TipRight", "You feed your horse a Wild Carrot", 4000)
Citizen.Wait(3500)
Citizen.InvokeNative(0xC6258F41D86676E0, horse, 0, valueHealth + 30)
Citizen.InvokeNative(0xC6258F41D86676E0, horse, 1, valueStamina + 5)
if not oncooldown then
oncooldown = true
TriggerEvent('syn:exp', horse, 5) -- horse exp increase by 5
end
else
TaskItemInteraction(PlayerPedId(), nil, GetHashKey("EAT_MULTI_BITE_FOOD_SPHERE_D8-2_SANDWICH_QUICK_LEFT_HAND"), true, 0, 0)
TriggerEvent("vorp:TipRight", "You eat a Wild Carrot", 4000)
Citizen.Wait(1000)
TriggerEvent('fred_meta:consume', 10,5,0,0,0.0,0,0,0,0.0,0.0) --Fred Metabolism
PlaySoundFrontend("Core_Fill_Up", "Consumption_Sounds", true, 0)
local number = Citizen.InvokeNative(0x36731AC041289BB1, PlayerPedId(), 1)
if number then
print (number)
Citizen.InvokeNative(0xC6258F41D86676E0, PlayerPedId(),1, number + 25)
else
Citizen.InvokeNative(0xC6258F41D86676E0, PlayerPedId(),1, 25)
end
Citizen.Wait(1000)
end
end)
RegisterNetEvent("syn:sugarcube")
AddEventHandler("syn:sugarcube", function(source)
local Ped = PlayerPedId()
local onhorse = IsPedOnMount(Ped)
local _source = source
if onhorse then
local horse = GetMount(Ped)
TaskAnimalInteraction(Ped, horse, -224471938, GetHashKey("p_carrot02x"), 0) --Animazione
local valueHealth = Citizen.InvokeNative(0x36731AC041289BB1, horse, 0)
local valueStamina = Citizen.InvokeNative(0x36731AC041289BB1, horse, 1)
if not tonumber(valueHealth) then valueHealth = 0 end
if not tonumber(valueStamina) then valueStamina = 0 end
TriggerEvent("vorp:TipRight", "You feed your horse a Sugar Cube", 4000)
Citizen.Wait(3500)
Citizen.InvokeNative(0xC6258F41D86676E0, horse, 0, valueHealth + 0)
Citizen.InvokeNative(0xC6258F41D86676E0, horse, 1, valueStamina + 50)
if not oncooldown then
oncooldown = true
TriggerEvent('syn:exp', horse, 5) -- horse exp increase by 5
end
else
TaskItemInteraction(PlayerPedId(), nil, GetHashKey("EAT_MULTI_BITE_FOOD_SPHERE_D8-2_SANDWICH_QUICK_LEFT_HAND"), true, 0, 0)
TriggerEvent("vorp:TipRight", "You eat a Sugar Cube", 4000)
Citizen.Wait(1000)
TriggerEvent('fred_meta:consume', 2,0,0,0,0.0,0,0,0,0.0,0.0) --Fred Metabolism
PlaySoundFrontend("Core_Fill_Up", "Consumption_Sounds", true, 0)
local number = Citizen.InvokeNative(0x36731AC041289BB1, PlayerPedId(), 1)
if number then
print (number)
Citizen.InvokeNative(0xC6258F41D86676E0, PlayerPedId(),1, number + 25)
else
Citizen.InvokeNative(0xC6258F41D86676E0, PlayerPedId(),1, 25)
end
Citizen.Wait(1000)
end
end)
RegisterNetEvent("syn:apple")
AddEventHandler("syn:apple", function(source)
local Ped = PlayerPedId()
local onhorse = IsPedOnMount(Ped)
local _source = source
if onhorse then
local horse = GetMount(Ped)
TaskAnimalInteraction(Ped, horse, -224471938, GetHashKey("p_carrot02x"), 0) --Animazione
local valueHealth = Citizen.InvokeNative(0x36731AC041289BB1, horse, 0)
local valueStamina = Citizen.InvokeNative(0x36731AC041289BB1, horse, 1)
if not tonumber(valueHealth) then valueHealth = 0 end
if not tonumber(valueStamina) then valueStamina = 0 end
TriggerEvent("vorp:TipRight", "You feed your horse an apple", 4000)
Citizen.Wait(3500)
Citizen.InvokeNative(0xC6258F41D86676E0, horse, 0, valueHealth + 40)
Citizen.InvokeNative(0xC6258F41D86676E0, horse, 1, valueStamina + 5)
if not oncooldown then
oncooldown = true
TriggerEvent('syn:exp', horse, 5) -- horse exp increase by 5
end
else
TaskItemInteraction(PlayerPedId(), nil, GetHashKey("EAT_MULTI_BITE_FOOD_SPHERE_D8-2_SANDWICH_QUICK_LEFT_HAND"), true, 0, 0)
TriggerEvent("vorp:TipRight", "You eat an Apple", 4000)
Citizen.Wait(1000)
TriggerEvent('fred_meta:consume', 10,0,0,0,0.0,0,0,0,0.0,0.0) --Fred Metabolism
PlaySoundFrontend("Core_Fill_Up", "Consumption_Sounds", true, 0)
local number = Citizen.InvokeNative(0x36731AC041289BB1, PlayerPedId(), 1)
if number then
print (number)
Citizen.InvokeNative(0xC6258F41D86676E0, PlayerPedId(),1, number + 25)
else
Citizen.InvokeNative(0xC6258F41D86676E0, PlayerPedId(),1, 25)
end
Citizen.Wait(1000)
end
end)
RegisterNetEvent("syn:consumable_peach")
AddEventHandler("syn:consumable_peach", function(source)
local Ped = PlayerPedId()
local onhorse = IsPedOnMount(Ped)
local _source = source
if onhorse then
local horse = GetMount(Ped)
TaskAnimalInteraction(Ped, horse, -224471938, GetHashKey("p_carrot02x"), 0) --Animazione
local valueHealth = Citizen.InvokeNative(0x36731AC041289BB1, horse, 0)
local valueStamina = Citizen.InvokeNative(0x36731AC041289BB1, horse, 1)
if not tonumber(valueHealth) then valueHealth = 0 end
if not tonumber(valueStamina) then valueStamina = 0 end
TriggerEvent("vorp:TipRight", "You feed your horse a Peach", 4000)
Citizen.Wait(3500)
Citizen.InvokeNative(0xC6258F41D86676E0, horse, 0, valueHealth + 40)
Citizen.InvokeNative(0xC6258F41D86676E0, horse, 1, valueStamina + 5)
if not oncooldown then
oncooldown = true
TriggerEvent('syn:exp', horse, 5) -- horse exp increase by 5
end
else
TaskItemInteraction(PlayerPedId(), nil, GetHashKey("EAT_MULTI_BITE_FOOD_SPHERE_D8-2_SANDWICH_QUICK_LEFT_HAND"), true, 0, 0)
TriggerEvent("vorp:TipRight", "You eat a Peach", 4000)
Citizen.Wait(1000)
TriggerEvent('fred_meta:consume', 10,0,0,0,0.0,0,0,0,0.0,0.0) --Fred Metabolism
PlaySoundFrontend("Core_Fill_Up", "Consumption_Sounds", true, 0)
local number = Citizen.InvokeNative(0x36731AC041289BB1, PlayerPedId(), 1)
if number then
print (number)
Citizen.InvokeNative(0xC6258F41D86676E0, PlayerPedId(),1, number + 25)
else
Citizen.InvokeNative(0xC6258F41D86676E0, PlayerPedId(),1, 25)
end
Citizen.Wait(1000)
end
end)
RegisterNetEvent("syn:horsestimulant")
AddEventHandler("syn:horsestimulant", function(source)
local Ped = PlayerPedId()
local onhorse = IsPedOnMount(Ped)
local _source = source
local horse = GetMount(Ped)
TaskAnimalInteraction(PlayerPedId(), horse, -1355254781, GetHashKey("p_cs_syringe01x"), 0)
local valueHealth = Citizen.InvokeNative(0x36731AC041289BB1, horse, 0)
local valueStamina = Citizen.InvokeNative(0x36731AC041289BB1, horse, 1)
if not tonumber(valueHealth) then valueHealth = 0 end
if not tonumber(valueStamina) then valueStamina = 0 end
TriggerEvent("vorp:TipRight", "You give your horse Stimulants", 4000)
Citizen.Wait(3500)
Citizen.InvokeNative(0xC6258F41D86676E0, horse, 0, valueHealth + 35)
Citizen.InvokeNative(0xC6258F41D86676E0, horse, 1, valueStamina + 35)
Citizen.InvokeNative(0xF6A7C08DF2E28B28, horse, 0, 1000.0)
Citizen.InvokeNative(0xF6A7C08DF2E28B28, horse, 1, 1000.0)
Citizen.InvokeNative(0x50C803A4CD5932C5, true)
Citizen.InvokeNative(0xD4EE21B7CC7FD350, true)
PlaySoundFrontend("Core_Fill_Up", "Consumption_Sounds", true, 0)
if not oncooldown then
oncooldown = true
TriggerEvent('syn:exp', horse, 5) -- horse exp increase by 20
end
end)
RegisterNetEvent('syn:brush')
AddEventHandler('syn:brush', function(source)
local _source = source
local Ped = PlayerPedId()
local horse = Citizen.InvokeNative(0x4C8B59171957BCF7, PlayerPedId())
TriggerEvent("StressaPlayer", 10)
local pCoords = GetEntityCoords(Ped)
local cCoords = GetEntityCoords(horse)
local Distanza = GetDistanceBetweenCoords(pCoords, cCoords)
if Distanza < 2.0 then
if Config.vorp then
TriggerEvent("vorp:TipRight", "You used the brush", 5000)
elseif Config.redem then
TriggerEvent("redem_roleplay:ShowSimpleRightText", "You used the brush", 5000)
end
TaskAnimalInteraction(Ped, horse, 554992710, GetHashKey("P_BRUSHHORSE02X"), 0)
local valueHealth = Citizen.InvokeNative(0x36731AC041289BB1, horse, 0)
if not tonumber(valueHealth) then valueHealth = 0 end
Citizen.Wait(3000)
Citizen.InvokeNative(0xC6258F41D86676E0, horse, 0, valueHealth + 5)
Citizen.InvokeNative(0x6585D955A68452A5, horse)
Citizen.InvokeNative(0xB5485E4907B53019, horse)
else
if Config.vorp then
TriggerEvent("vorp:TipRight", "You are not near your horse", 3000)
elseif Config.redem then
TriggerEvent("redem_roleplay:ShowSimpleRightText", "You are not near your horse", 3000)
end
Wait(0)
end
if not oncooldown then
oncooldown = true
TriggerEvent('syn:exp', horse, 7) -- horse exp increase by 10
end
end)