-
Notifications
You must be signed in to change notification settings - Fork 1
/
client.lua
180 lines (152 loc) · 6.2 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
ESX = nil
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(xPlayer)
PlayerData = xPlayer
end)
-- Menu --
local open = false
local Astuce = RageUI.CreateMenu('Astuce', 'Interaction')
local AstuceTouche = RageUI.CreateSubMenu(Astuce, "Touches", "Interaction")
local AstuceCommande = RageUI.CreateSubMenu(Astuce, "Commandes", "Interaction")
local AstuceUtilitaire = RageUI.CreateSubMenu(Astuce, "Utilitaires", "Interaction")
Astuce.Display.Header = true
Astuce.Closed = function()
open = false
end
function OpenAstuceMenu()
if open then
open = false
RageUI.Visible(Astuce, false)
return
else
open = true
RageUI.Visible(Astuce, true)
CreateThread(function()
while open do
RageUI.IsVisible(Astuce,function()
RageUI.Separator("Connecté en tant qu'id [~b~"..GetPlayerServerId(PlayerId()).."~s~]")
RageUI.Separator("↓ ~b~ Astuce ~s~↓")
RageUI.Button("Touche", "Ouvrir le menu des touches", {RightLabel = "~y~→→→"}, true , {}, AstuceTouche)
RageUI.Button("Commande", "Ouvrir le menu des commandes", {RightLabel = "~y~→→→"}, true , {}, AstuceCommande)
RageUI.Button("Utilitaire", "Ouvrir le menu des utilitaires", {RightLabel = "~y~→→→"}, true , {}, AstuceUtilitaire)
RageUI.Separator("↓ ~b~ Fermer ~s~↓")
RageUI.Button("~r~Fermer", "Fermer le menu", {RightLabel = "~y~→→"}, true , {
onSelected = function()
RageUI.CloseAll()
end
})
end)
-- Menu Astuce touche
RageUI.IsVisible(AstuceTouche,function()
RageUI.Separator("↓ ~b~ Touches ~s~↓")
RageUI.Button("Téléphone", "sort votre téléphone", {RightLabel = "[F1]"}, true , {})
RageUI.Button("Menu priincipale", "Ouvre le menu pricipale (inventaire, facture, vêtement ...)", {RightLabel = "[F5]"}, true , {})
RageUI.Button("Menu sociéter", "Ouvre votre menu sociéter (Annonces, facture ...)", {RightLabel = "[F6]"}, true , {})
RageUI.Button("Menu fouille", "Ouvre votre menu fouille", {RightLabel = "[F7]"}, true , {})
RageUI.Button("Lever les bras", "lève vos bras", {RightLabel = "[F9]"}, true , {})
RageUI.Separator("↓ ~b~ Fermer ~s~↓")
RageUI.Button("~r~Fermer", "Fermer le menu", {RightLabel = "~y~→→"}, true , {
onSelected = function()
RageUI.CloseAll()
end
})
end)
-- Menu Astuce commande
RageUI.IsVisible(AstuceCommande,function()
RageUI.Separator("↓ ~b~ Commandes ~s~↓")
RageUI.Button("Menu astuce", "Ouvre le menu astuce", {RightLabel = "/help"}, true , {})
RageUI.Button("Menu props", "Ouvre le menu props", {RightLabel = "/props"}, true , {})
RageUI.Button("Lien discord", "Donne le lien discord", {RightLabel = "/discord"}, true , {})
RageUI.Separator("↓ ~b~ Fermer ~s~↓")
RageUI.Button("~r~Fermer", "Fermer le menu", {RightLabel = "~y~→→"}, true , {
onSelected = function()
RageUI.CloseAll()
end
})
end)
-- Menu Astuce utilitaire
RageUI.IsVisible(AstuceUtilitaire,function()
RageUI.Separator("↓ ~b~ Utilitaires ~s~↓")
RageUI.Button("Discord", "Vous envois le lien du discord", {RightLabel = "~y~→"}, true , {
onSelected = function()
ESX.ShowAdvancedNotification("Astuce", "Utilitaire", "Voici le lien du discord: ~b~https://discord.gg/dkHFBkBBPZ", "char_amanda", 1)
end
})
RageUI.Separator("↓ ~r~ Fermeture ~s~↓")
RageUI.Button("~r~Fermer", "Fermer le menu", {RightLabel = "~y~→→"}, true , {
onSelected = function()
RageUI.CloseAll()
end
})
end)
Wait(0)
end
end)
end
end
-- Ouvrir le menu --
Citizen.CreateThread(function()
while true do
local wait = 750
for k in pairs(Config.positionAstuceMenu.InteractZone) do
local plyCoords = GetEntityCoords(GetPlayerPed(-1), false)
local pos = Config.positionAstuceMenu.InteractZone
local dist = Vdist(plyCoords.x, plyCoords.y, plyCoords.z, pos[k].x, pos[k].y, pos[k].z)
if dist <= 5.0 then
wait = 0
DrawMarker(Config.MarkerType, pos[k].x, pos[k].y, pos[k].z, 0.0, 0.0, 0.0, 0.0,0.0,0.0, Config.MarkerSizeLargeur, Config.MarkerSizeEpaisseur, Config.MarkerSizeHauteur, Config.MarkerColorR, Config.MarkerColorG, Config.MarkerColorB, Config.MarkerOpacite, Config.MarkerSaute, true, p19, Config.MarkerTourne)
if dist <= 5.0 then
wait = 0
Visual.Subtitle(Config.Text, 1)
if IsControlJustPressed(1,51) then
OpenAstuceMenu()
end
end
end
Citizen.Wait(wait)
end
end
end)
-- Commande --
RegisterCommand("id", function(source, args, rawcommand)
ESX.ShowAdvancedNotification("DPR Création", "ID", "Votre id est: [~y~~h~"..GetPlayerServerId(PlayerId()).."~s~] !", "CHAR_AGENT14", 8)
end, false)
RegisterCommand("discord", function(source, args, rawcommand)
ESX.ShowAdvancedNotification("Astuce", "Utilitaire", "Voici le lien du discord: ~b~https://discord.gg/dkHFBkBBPZ", "char_amanda", 1)
end, false)
RegisterCommand("help", function(source, args, rawcommand)
OpenAstuceMenu()
end, false)
-- Ped --
Citizen.CreateThread(function()
if Config.Ped then
function LoadModel(model)
while not HasModelLoaded(model) do
RequestModel(model)
Wait(1)
end
end
LoadModel(Config.PedType)
Ped = CreatePed(2, GetHashKey(Config.PedType), Config.PedPosition, Config.PedRotation, 0, 0)
DecorSetInt(Ped, "Desperados", 5431)
FreezeEntityPosition(Ped, 1)
SetEntityInvincible(Ped, true)
SetBlockingOfNonTemporaryEvents(Ped, 1)
end
end)
-- Blips --
Citizen.CreateThread(function()
if Config.blip then
for k, v in pairs(Config.positionAstuceMenu.InteractZone) do
local blip = AddBlipForCoord(v.x, v.y, v.z)
SetBlipSprite(blip, Config.BlipId)
SetBlipScale (blip, Config.BlipTaille)
SetBlipColour(blip, Config.BlipCouleur)
SetBlipAsShortRange(blip, Config.BlipRange)
BeginTextCommandSetBlipName('STRING')
AddTextComponentSubstringPlayerName(Config.BlipName)
EndTextCommandSetBlipName(blip)
end
end
end)