Skip to content

Commit b217b75

Browse files
committed
fix+refactor:(bpt_menu declared missing variable)
1 parent 6b815a3 commit b217b75

File tree

7 files changed

+23
-294
lines changed

7 files changed

+23
-294
lines changed

bpt_menu/LICENSE

+2-2
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ state the exclusion of warranty; and each file should have at least
632632
the "copyright" line and a pointer to where the full notice is found.
633633

634634
<one line to give the program's name and a brief idea of what it does.>
635-
Copyright (C) <2022> <bitpredator>
635+
Copyright (C) 2022-2023 bitpredator
636636

637637
This program is free software: you can redistribute it and/or modify
638638
it under the terms of the GNU General Public License as published by
@@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail.
652652
If the program does terminal interaction, make it output a short
653653
notice like this when it starts in an interactive mode:
654654

655-
<program> Copyright (C) <2022> <bitpredator>
655+
<program> Copyright (C) 2022-2023 bitpredator
656656
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657657
This is free software, and you are welcome to redistribute it
658658
under certain conditions; type `show c' for details.

bpt_menu/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# bpt_menu
22

3-
Copyright (C) 2022 bitpredator
3+
Copyright (C) 2022-2023 bitpredator
44

55
This program is a project for the fivem community, you have legal permission to distribute and / or modify it only if you have forked this repository, if it is not a fork repository, the version will be removed from the DMCA request.
66

bpt_menu/client/main.lua

+1-90
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,13 @@ Citizen.CreateThread(function()
5353
RefreshMoney()
5454

5555
RMenu.Add('rageui', 'personal', RageUI.CreateMenu(Config.MenuTitle, _U('mainmenu_subtitle'), 0, 0, 'commonmenu', 'interaction_bgd', 255, 255, 255, 255))
56-
5756
RMenu.Add('personal', 'wallet', RageUI.CreateSubMenu(RMenu.Get('rageui', 'personal'), _U('wallet_title')))
5857
RMenu.Add('personal', 'billing', RageUI.CreateSubMenu(RMenu.Get('rageui', 'personal'), _U('bills_title')))
5958
RMenu.Add('personal', 'clothes', RageUI.CreateSubMenu(RMenu.Get('rageui', 'personal'), _U('clothes_title')))
6059
RMenu.Add('personal', 'accessories', RageUI.CreateSubMenu(RMenu.Get('rageui', 'personal'), _U('accessories_title')))
6160
RMenu.Add('personal', 'animation', RageUI.CreateSubMenu(RMenu.Get('rageui', 'personal'), _U('animation_title')))
62-
63-
RMenu.Add('personal', 'boss', RageUI.CreateSubMenu(RMenu.Get('rageui', 'personal'), _U('bossmanagement_title')), function()
64-
if ESX.PlayerData.job ~= nil and ESX.PlayerData.job.grade_name == 'boss' then
65-
return true
66-
end
67-
68-
return false
69-
end)
70-
7161
RMenu.Add('personal', 'admin', RageUI.CreateSubMenu(RMenu.Get('rageui', 'personal'), _U('admin_title')), function()
72-
if Player.group ~= nil and (Player.group == 'mod' or Player.group == 'admin' or Player.group == '_dev') then
62+
if Player.group ~= nil and (Player.group == 'mod' or Player.group == 'admin') then
7363
return true
7464
end
7565

@@ -465,78 +455,6 @@ function RenderAnimationsSubMenu(menu)
465455
end)
466456
end
467457

468-
function RenderBossMenu()
469-
RageUI.DrawContent({header = true, instructionalButton = true}, function()
470-
if societymoney ~= nil then
471-
RageUI.Button(_U('bossmanagement_chest_button'), nil, {RightLabel = '$' .. societymoney}, true, function() end)
472-
end
473-
474-
RageUI.Button(_U('bossmanagement_hire_button'), nil, {}, true, function(Hovered, Active, Selected)
475-
if (Selected) then
476-
if ESX.PlayerData.job.grade_name == 'boss' then
477-
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
478-
479-
if closestPlayer == -1 or closestDistance > 3.0 then
480-
ESX.ShowNotification(_U('players_nearby'))
481-
else
482-
TriggerServerEvent('bpt_menu:Boss_recruterplayer', GetPlayerServerId(closestPlayer))
483-
end
484-
else
485-
ESX.ShowNotification(_U('missing_rights'))
486-
end
487-
end
488-
end)
489-
490-
RageUI.Button(_U('bossmanagement_fire_button'), nil, {}, true, function(Hovered, Active, Selected)
491-
if (Selected) then
492-
if ESX.PlayerData.job.grade_name == 'boss' then
493-
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
494-
495-
if closestPlayer == -1 or closestDistance > 3.0 then
496-
ESX.ShowNotification(_U('players_nearby'))
497-
else
498-
TriggerServerEvent('bpt_menu:Boss_fireplayer', GetPlayerServerId(closestPlayer))
499-
end
500-
else
501-
ESX.ShowNotification(_U('missing_rights'))
502-
end
503-
end
504-
end)
505-
506-
RageUI.Button(_U('bossmanagement_promote_button'), nil, {}, true, function(Hovered, Active, Selected)
507-
if (Selected) then
508-
if ESX.PlayerData.job.grade_name == 'boss' then
509-
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
510-
511-
if closestPlayer == -1 or closestDistance > 3.0 then
512-
ESX.ShowNotification(_U('players_nearby'))
513-
else
514-
TriggerServerEvent('bpt_menu:Boss_promoteplayer', GetPlayerServerId(closestPlayer))
515-
end
516-
else
517-
ESX.ShowNotification(_U('missing_rights'))
518-
end
519-
end
520-
end)
521-
522-
RageUI.Button(_U('bossmanagement_demote_button'), nil, {}, true, function(Hovered, Active, Selected)
523-
if (Selected) then
524-
if ESX.PlayerData.job.grade_name == 'boss' then
525-
local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
526-
527-
if closestPlayer == -1 or closestDistance > 3.0 then
528-
ESX.ShowNotification(_U('players_nearby'))
529-
else
530-
TriggerServerEvent('bpt_menu:Boss_fireplayer', GetPlayerServerId(closestPlayer))
531-
end
532-
else
533-
ESX.ShowNotification(_U('missing_rights'))
534-
end
535-
end
536-
end)
537-
end)
538-
end
539-
540458
function RenderAdminMenu()
541459
RageUI.DrawContent({header = true, instructionalButton = true}, function()
542460
for i = 1, #Config.Admin, 1 do
@@ -611,13 +529,6 @@ Citizen.CreateThread(function()
611529
RenderVehicleMenu()
612530
end
613531

614-
if RageUI.Visible(RMenu.Get('personal', 'boss')) then
615-
if not RMenu.Settings('personal', 'boss', 'Restriction')() then
616-
RageUI.GoBack()
617-
end
618-
RenderBossMenu()
619-
end
620-
621532
if RageUI.Visible(RMenu.Get('personal', 'admin')) then
622533
if not RMenu.Settings('personal', 'admin', 'Restriction')() then
623534
RageUI.GoBack()

bpt_menu/config.lua

+8-44
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ Config.Admin = {
186186
{
187187
name = 'goto',
188188
label = _U('admin_goto_button'),
189-
groups = {'_dev', 'admin', 'mod'},
189+
groups = {'admin', 'mod'},
190190
command = function()
191191
local plyId = KeyboardInput('BPT_BOX_ID', _U('dialogbox_playerid'), '', 8)
192192

@@ -204,7 +204,7 @@ Config.Admin = {
204204
{
205205
name = 'bring',
206206
label = _U('admin_bring_button'),
207-
groups = {'_dev', 'admin', 'mod'},
207+
groups = {'admin', 'mod'},
208208
command = function()
209209
local plyId = KeyboardInput('BPT_BOX_ID', _U('dialogbox_playerid'), '', 8)
210210

@@ -219,28 +219,10 @@ Config.Admin = {
219219
RageUI.CloseAll()
220220
end
221221
},
222-
{
223-
name = 'tpxyz',
224-
label = _U('admin_tpxyz_button'),
225-
groups = {'_dev', 'admin'},
226-
command = function()
227-
local pos = KeyboardInput('BPT_BOX_XYZ', _U('dialogbox_xyz'), '', 50)
228-
229-
if pos ~= nil and pos ~= '' then
230-
local _, _, x, y, z = string.find(pos, '([%d%.]+) ([%d%.]+) ([%d%.]+)')
231-
232-
if x ~= nil and y ~= nil and z ~= nil then
233-
SetEntityCoords(plyPed, x + .0, y + .0, z + .0)
234-
end
235-
end
236-
237-
RageUI.CloseAll()
238-
end
239-
},
240222
{
241223
name = 'noclip',
242224
label = _U('admin_noclip_button'),
243-
groups = {'_dev', 'admin', 'mod'},
225+
groups = {'admin', 'mod'},
244226
command = function()
245227
Player.noclip = not Player.noclip
246228

@@ -272,7 +254,7 @@ Config.Admin = {
272254
{
273255
name = 'godmode',
274256
label = _U('admin_godmode_button'),
275-
groups = {'_dev', 'admin'},
257+
groups = {'admin'},
276258
command = function()
277259
Player.godmode = not Player.godmode
278260

@@ -288,7 +270,7 @@ Config.Admin = {
288270
{
289271
name = 'ghostmode',
290272
label = _U('admin_ghostmode_button'),
291-
groups = {'_dev', 'admin'},
273+
groups = {'admin'},
292274
command = function()
293275
Player.ghostmode = not Player.ghostmode
294276

@@ -304,7 +286,7 @@ Config.Admin = {
304286
{
305287
name = 'repairveh',
306288
label = _U('admin_repairveh_button'),
307-
groups = {'_dev', 'admin'},
289+
groups = {'admin'},
308290
command = function()
309291
local plyVeh = GetVehiclePedIsIn(plyPed, false)
310292
SetVehicleFixed(plyVeh)
@@ -314,7 +296,7 @@ Config.Admin = {
314296
{
315297
name = 'flipveh',
316298
label = _U('admin_flipveh_button'),
317-
groups = {'_dev', 'admin'},
299+
groups = {'admin'},
318300
command = function()
319301
local plyCoords = GetEntityCoords(plyPed)
320302
local newCoords = plyCoords + vector3(0.0, 2.0, 0.0)
@@ -363,7 +345,7 @@ Config.Admin = {
363345
{
364346
name = 'showname',
365347
label = _U('admin_showname_button'),
366-
groups = {'_dev', 'admin', 'mod'},
348+
groups = {'admin', 'mod'},
367349
command = function()
368350
Player.showName = not Player.showName
369351

@@ -374,23 +356,5 @@ Config.Admin = {
374356
end
375357
end
376358
end
377-
},
378-
{
379-
name = 'changeskin',
380-
label = _U('admin_changeskin_button'),
381-
groups = {'_dev', 'admin'},
382-
command = function()
383-
RageUI.CloseAll()
384-
Citizen.Wait(100)
385-
TriggerEvent('esx_skin:openSaveableMenu')
386-
end
387-
},
388-
{
389-
name = 'saveskin',
390-
label = _U('admin_saveskin_button'),
391-
groups = {'_dev', 'admin'},
392-
command = function()
393-
TriggerEvent('esx_skin:requestSaveSkin')
394-
end
395359
}
396360
}

bpt_menu/fxmanifest.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ lua54 'yes'
55

66
author 'bitpredator'
77
description 'bpt_menu developed for fivem, compatible with esx'
8-
version '0.0.2'
8+
version '0.0.3'
99

1010
dependency 'es_extended'
1111

@@ -16,7 +16,7 @@ shared_scripts {
1616
}
1717

1818
server_scripts {
19-
'@mysql-async/lib/MySQL.lua',
19+
'@oxmysql/lib/MySQL.lua',
2020
'server/main.lua'
2121
}
2222

0 commit comments

Comments
 (0)