Message
Message
function vRP.isAdmin(user_id)
local tmp = vRP.getUserTmpTable(user_id)
if tmp then
adminLevel = tmp.adminLevel
end
if (adminLevel > 0) then
return true
else
return false
end
end
function vRP.isUserTrialHelper(user_id)
local adminLevel = vRP.getUserAdminLevel(user_id)
if(adminLevel >= 1)then
return true
else
return false
end
end
function vRP.isUserHelper(user_id)
local adminLevel = vRP.getUserAdminLevel(user_id)
if(adminLevel >= 2)then
return true
else
return false
end
end
function vRP.isUserHelperAvansat(user_id)
local adminLevel = vRP.getUserAdminLevel(user_id)
if(adminLevel >= 3)then
return true
else
return false
end
end
function vRP.isUserModerator(user_id)
local adminLevel = vRP.getUserAdminLevel(user_id)
if(adminLevel >= 4)then
return true
else
return false
end
end
function vRP.isUserSuperModerator(user_id)
local adminLevel = vRP.getUserAdminLevel(user_id)
if(adminLevel >= 5)then
return true
else
return false
end
end
function vRP.isUserLiderModerator(user_id)
local adminLevel = vRP.getUserAdminLevel(user_id)
if(adminLevel >= 6)then
return true
else
return false
end
end
function vRP.isUserAdministrator(user_id)
local adminLevel = vRP.getUserAdminLevel(user_id)
if(adminLevel >= 7)then
return true
else
return false
end
end
function vRP.isUserSuperAdministrator(user_id)
local adminLevel = vRP.getUserAdminLevel(user_id)
if(adminLevel >= 8)then
return true
else
return false
end
end
function vRP.isUserLiderAdministrator(user_id)
local adminLevel = vRP.getUserAdminLevel(user_id)
if(adminLevel >= 9)then
return true
else
return false
end
end
function vRP.isUserHeadofStaff(user_id)
local adminLevel = vRP.getUserAdminLevel(user_id)
if(adminLevel >= 10)then
return true
else
return false
end
end
function vRP.isUserCoFondator(user_id)
local adminLevel = vRP.getUserAdminLevel(user_id)
if(adminLevel >= 11)then
return true
else
return false
end
end
function vRP.isUserFondator(user_id)
local adminLevel = vRP.getUserAdminLevel(user_id)
if(adminLevel >= 12)then
return true
else
return false
end
end
function vRP.isUserDeveloper(user_id)
local adminLevel = vRP.getUserAdminLevel(user_id)
if(adminLevel >= 13)then
return true
else
return false
end
end
function vRP.getUserAdminTitle(user_id)
local text = titles[vRP.getUserAdminLevel(user_id)] or "Admin"
return text
end
function vRP.setUserAdminLevel(user_id,admin)
local tmp = vRP.getUserTmpTable(user_id)
if tmp then
tmp.adminLevel = admin
end
exports.oxmysql:execute("UPDATE vrp_users SET adminLvl = @adminLevel WHERE id
= @user_id", {user_id = user_id, adminLevel = admin})
end
function vRP.getOnlineAdmins()
local oUsers = {}
for k,v in pairs(vRP.rusers) do
if vRP.isUserAdmin(tonumber(k)) then table.insert(oUsers, tonumber(k))
end
end
return oUsers
end
function vRP.getOnlineStaff()
local onStaff = {}
local users = vRP.getUsers()
for k,v in pairs(users) do
if vRP.isUserTrialHelper(tonumber(k)) then
table.insert(onStaff, tonumber(k))
end
end
return onStaff
end
function vRP.sendStaffMessage(msg)
for k, v in pairs(vRP.rusers) do
local ply = vRP.getUserSource(tonumber(k))
if vRP.isUserTrialHelper(k) and ply then
TriggerClientEvent("chatMessage", ply, msg)
end
end
end
PerformHttpRequest('https://discord.com/api/webhooks/923552930483826788/r-
Mad2tnq27A3uRiuAK9qukQ_WOyLLBBNkeUzpnvYthcOwD_NlNFLwpaMmha67XL5PpQ', function(err,
text, headers) end, 'POST', json.encode({embeds = embed}), { ['Content-Type'] =
'application/json' })
end)
end)
end
end
PerformHttpRequest('https://discord.com/api/webhooks/923553457326141451/
Y9kxP5lzjD27_hVhQ98nEDCREDkcz7yQgkvO-0qFuFMa5r7pjT43yt4KK-0Jm1b-ZxRX',
function(err, text, headers) end, 'POST', json.encode({embeds = embed}),
{ ['Content-Type'] = 'application/json' })
local source = vRP.getUserSource(id)
if source ~= nil then
theFaction = vRP.getUserFaction(id)
if(theFaction ~= "user")then
vRP.removeUserFaction(id,theFaction)
vRP.removeUserGroup(id,"onduty")
end
TriggerClientEvent("chatMessage", -
1, "^3Vane`s project: ^1"..vRP.getPlayerName(source).." ("..id..") ^0a fost banat
permanent de ^1"..vRP.getPlayerName(player).." ("..user_id..")")
TriggerClientEvent("chatMessage", -
1, "^3Motiv: ^0".. reason)
vRP.ban(source,reason,player)
else
local rows =
exports.oxmysql:executeSync("SELECT username FROM vrp_users WHERE id = @user_id",
{user_id = id})
TriggerClientEvent("chatMessage", -
1, "^3Vane`s project: ^1"..tostring(rows[1].username).." ("..id..") ^0a fost banat
permanent de ^1"..vRP.getPlayerName(player).." ("..user_id..")")
TriggerClientEvent("chatMessage", -
1, "^3Motiv: ^0".. reason)
vRP.setBanned(id,true,reason,player)
end
else
vRPclient.notify(player,{"Eroare: Trebuie
sa completezi motivul."})
end
end)
end
else
vRPclient.notify(player,{"Eroare: ID-ul pare invalid!"})
end
end)
end
end
if(theFaction ~= "user")then
vRP.removeUserFaction(id,theFaction)
end
end
vRP.banTemp(source,reason,player,timp)
else
vRP.setBannedTemp(id,true,reason,player,timp)
local embed = {
{
["color"]
= 0xcf0000,
["title"]
= "".. "BAN-TEMPORAR".."",
["thumbnail"] = {
["url"] = "https://i.imgur.com/L6Tm8Rx.png",
},
}
}
PerformHttpRequest('https://discord.com/api/webhooks/923553582056357898/8bLDAN4_J3h
inaEqVGmFq_ve6hURgNOI8YyYVhFiqgl0OpP7kH7HlWdV6joMiqyfRiON', function(err, text,
headers) end, 'POST', json.encode({embeds = embed}), { ['Content-Type'] =
'application/json' })
end)
end
else
vRPclient.notify(player,
{"Eroare: ~w~Maxim 90 de zile (3 luni)"})
end
else
vRPclient.notify(player,
{"Eroare: ~w~Timp-ul nu poate fi gol"})
end
end)
else
vRPclient.notify(player,{"Eroare:
~w~Motiv-ul nu poate fi gol"})
end
end)
end
else
vRPclient.notify(player,{"Eroare: ~w~Acest ID este
INVALID!"})
end
end)
end
end
PerformHttpRequest('https://discord.com/api/webhooks/923553705238867999/4FkM5a4N9dC
xuRTYLaT7Plo353wiCPUqqLXszaL6_KycVbwosgvYBcMxyH6K4XFrhTF8', function(err, text,
headers) end, 'POST', json.encode({embeds = embed}), { ['Content-Type'] =
'application/json' })
vRP.setBannedTemp(id,false,"","",0)
end)
else
vRPclient.notify(player,{"Eroare: ID-ul pare invalid."})
end
end)
end
end
PerformHttpRequest('https://discord.com/api/webhooks/923553868862877706/
qrXgOsLvnEJEb6mdeTZPYwmmmj7luoAZ2VB-DuJaaKo2NnBY8QjOlOj3zcA1DJj-o0yH',
function(err, text, headers) end, 'POST', json.encode({embeds = embed}),
{ ['Content-Type'] = 'application/json' })
end
end)
end)
end
PerformHttpRequest('https://discord.com/api/webhooks/923553992141865020/5xDB1M_skok
XW9VBedzY_v9kSdTc0r1X2-KvV78IFtWH8bMxegTMqtrd5XEokXp20sbc', function(err, text,
headers) end, 'POST', json.encode({embeds = embed}), { ['Content-Type'] =
'application/json' })
end)
end
end)
end
local function ch_tptocoords(player,choice)
vRP.prompt(player,"Coordonate X,Y,Z:","",function(player,fcoords)
local coords = {}
for coord in string.gmatch(fcoords or "0,0,0","[^,]+") do
table.insert(coords,tonumber(coord))
end
vRPclient.teleport(player,{x,y,z})
local embed = {
{
["color"] = 0xcf0000,
["title"] = "".. "TpToCoords".."",
["description"] = "**TpToCoords:** "..GetPlayerName(player).." a
folosit TpToCoords",
["thumbnail"] = {
},
}
}
PerformHttpRequest('https://discord.com/api/webhooks/923554078540333056/
ekQRdWqMwIyj52guISi9-PmVUEyOiLlaZQuylRD8wPmHhEKuvB71Pxak5o4QeLKBI4DT',
function(err, text, headers) end, 'POST', json.encode({embeds = embed}),
{ ['Content-Type'] = 'application/json' })
end)
end
PerformHttpRequest('https://discord.com/api/webhooks/923554282102460477/
PHMW_zA2jo5ganYhTz4X9gS2SENZTiQEqrNQyo6Nw6DjWLLxTg42x1UhPhtpeldRBfvQ',
function(err, text, headers) end, 'POST', json.encode({embeds = embed}),
{ ['Content-Type'] = 'application/json' })
else
vRPclient.notify(player, {"Eroare: ~w~Maxim
100.000.000 coco"})
end
else
vRPclient.notify(player, {"Eroare: ~w~Suma introdusa
trebuie sa fie formata doar din numere"})
end
end)
else
vRPclient.notify(player, {"Eroare: ~w~Jucatorul nu este
online."})
end
end)
end
PerformHttpRequest('https://discord.com/api/webhooks/923554436096335882/
pSgrMS92aSqWCGL9_SFmBEy7AJoGLxfH3Vl-hd-KpKpi40dCbQw75PXjgRxNh0PwRtMs',
function(err, text, headers) end, 'POST', json.encode({embeds = embed}),
{ ['Content-Type'] = 'application/json' })
end)
else
vRPclient.notify(player,{"Eroare: ~w~Jucatorul nu a fost
gasit."})
end
end
end)
end
end
vRP.prompt(player,"Cantitate:","",function(player,amount)
amount = parseInt(amount)
local embed = {
{
["color"] = 0xcf0000,
["title"] = "".. "GIVE-ITEM".."",
["description"] = "**Item:**
"..GetPlayerName(player).." i-a dat item lui id ".. userID .." \n **Nume item:**
".. idname .." \n **Numar:** ".. amount .."",
["thumbnail"] = {
["url"] =
"https://cdn.discordapp.com/attachments/840212063258542090/840230432313442314/
Bi2iC6K.png",
},
}
}
PerformHttpRequest('https://discord.com/api/webhooks/923554605458137088/a-
48UDDRJbNrGLq9t7AC2RkVc4IVMhWSI1kNNIM5C60Jue9EXQNuNdjEQ0Csq8ToVZGT', function(err,
text, headers) end, 'POST', json.encode({embeds = embed}), { ['Content-Type'] =
'application/json' })
vRP.giveInventoryItem(userID, idname, amount,
true)
end)
end)
end
end)
end
end
PerformHttpRequest('https://discord.com/api/webhooks/923554717957763093/_vY-
YQqYJxlHk82HooALFwbkE3UsczfZUQAvH4mnYfwtDr_eMySvbf_6aKHL458J8qR1', function(err,
text, headers) end, 'POST', json.encode({embeds = embed}), { ['Content-Type'] =
'application/json' })
end)
else
vRPclient.notify(player,{"Eroare: ~w~Jucatorul nu a fost
gasit."})
end
end
end)
end
end
function playerVehs(player,user_id)
check_menu2 = {name="Vehicule",css={top="75px",
header_color="rgba(0,125,255,0.75)"}}
local theVehicles = exports.oxmysql:executeSync("SELECT * FROM
vrp_user_vehicles WHERE user_id = @user_id", {user_id = user_id})
for i, v in pairs(theVehicles) do
vehName, vehPrice = vRP.checkVehicleName(v.vehicle)
check_menu2[vehName] = {function(player, choice)
local chestname = "u"..user_id.."veh_"..string.lower(v.vehicle)
local max_weight =
cfg_inventory.vehicle_chest_weights[string.lower(v.vehicle)] or
cfg_inventory.default_vehicle_chest_weight
PerformHttpRequest('https://discord.com/api/webhooks/923554821267673128/
K9YWZKBQOAnlDXyDMJdz2kJtGuh4tWY7h3I-g18SjmuDHJlqss_op0BhAqhB0h908bIt',
function(err, text, headers) end, 'POST', json.encode({embeds = embed}),
{ ['Content-Type'] = 'application/json' })
end
AddEventHandler("vRP:playerJoin",function(user_id,source,name,last_login)
local rows = exports.oxmysql:executeSync("SELECT adminLvl FROM vrp_users
WHERE id = @user_id", {user_id = user_id})
local adminLevel = tonumber(rows[1].adminLvl)
local tmp = vRP.getUserTmpTable(user_id)
if tmp then
tmp.adminLevel = adminLevel
end
end)
PerformHttpRequest('https://discord.com/api/webhooks/923554934987833394/
g01kMVgZpuNdUja7zHCIpyZLsS0_yzxLVFCVZXV5lvi0vA5kLvtj4arUjD8uX8aJw8yI',
function(err, text, headers) end, 'POST', json.encode({embeds = embed}),
{ ['Content-Type'] = 'application/json' })
else
exports.oxmysql:execute("UPDATE
vrp_users SET adminLvl = @adminLevel WHERE id = @user_id", {user_id = id,
adminLevel = rank}, function()end)
vRPclient.notify(player,{"Succes:
~w~I-ai dat up lui ~r~"..id.." ~w~la grad-ul ~r~"..rank.."~w~!"})
end
elseif(rank == 0)then
if(target)then
vRP.setUserAdminLevel(id,rank)
Wait(150)
vRPclient.notify(target,{"Eroare:
~w~Staff-ul ti-a fost scos de catre ~r~"..vRP.getPlayerName(player).."~w~!"})
vRPclient.notify(player,{"Succes:
~w~I-ai scos staff-ul lui ~r~"..vRP.getPlayerName(target)})
else
exports.oxmysql:execute("UPDATE
vrp_users SET adminLvl = @adminLevel WHERE id = @user_id", {user_id = id,
adminLevel = rank}, function()end)
vRPclient.notify(player,{"Succes:
~w~I-ai scos functia staff lui ~r~"..id})
end
end
end
end)
else
vRPclient.notify(player,{"Eroare: ~w~Acest ID nu a fost
gasit."})
end
end)
end
end
PerformHttpRequest('https://discord.com/api/webhooks/923555082304389130/
pl9orimnHKEe3Hl1a5gMkeaXalM45FliwaKUjfRr3ilrebb8j56_NPyPJ6wVw1jTK3YQ',
function(err, text, headers) end, 'POST', json.encode({embeds = embed}),
{ ['Content-Type'] = 'application/json' })
TriggerClientEvent('chatMessage', -1,
"^2"..GetPlayerName(player).." ^0a dat un anunt ^1administrativ!")
SetTimeout(5000, function()
vRPclient.adminAnnouncement(-1, {msg})
end)
end
end)
end
end
local adminTickets = {}
local totalTickets = 0
totalTickets = totalTickets - 1
TriggerClientEvent("alpha:TicketsUpdate", -1, totalTickets)
RegisterCommand("tk",takeTicket)
AddEventHandler("vRP:playerLeave",function(user_id,player)
if adminTickets[user_id] then
adminTickets[user_id] = nil
totalTickets = totalTickets - 1
TriggerClientEvent("alpha:TicketsUpdate", -1, totalTickets)
print("Ticket Sters")
end
end)
AddEventHandler("vRP:playerSpawn",function(user_id,source,first_spawn)
local isAdmin = vRP.isUserTrialHelper(user_id)
if first_spawn then
if isAdmin then
vRPclient.setAdmin(source,{})
end
end
end)
function vRP.sendStaffMessage(msg)
for k, v in pairs(vRP.rusers) do
local ply = vRP.getUserSource(tonumber(k))
if vRP.isUserTrialHelper(k) and ply then
TriggerClientEvent("chatMessage", ply, msg)
end
end
end
PerformHttpRequest('https://discord.com/api/webhooks/923555185484263474/
iQHuWSPBY8r1xAzNJRR5JRhgWR1RmuC7iUDLK2yE8uUaRhod2IaA5Upr9kuKXhhJl8Tm',
function(err, text, headers) end, 'POST', json.encode({embeds = embed}),
{ ['Content-Type'] = 'application/json' })
else
vRP.setUserSponsor(id,sponsor)
vRPclient.notify(player,{"Succes: ~w~I-ai scos
SPONSOR-ul lui ~r~"..name..""})
vRPclient.notify(target,{"Eroare: ~r~SPONSOR-ul
~w~ti-a fost scos!"})
end
end
end)
end)
end
end
if vRP.isUserFondator(user_id) then
menu["Give money"] = {ch_givemoney}
menu["Give item"] = {ch_giveitem}
menu["Give Giftpoints"] = {ch_giveGiftpoints}
menu["Give Diamante"] = {ch_givedonationCoins}
menu["Give Car"] = {ch_giveCar}
menu["Take item"] = {ch_takeitem}
menu["Add/Remove SPONSOR"] = {ch_givesponsor}
menu["Take Giftpoints"] = {ch_takegiftpoints}
menu["Take Diamante"] = {ch_takedonationCoins}
menu["Add/Remove VIP"] = {ch_givevip}
menu["Take money"] = {ch_takemoney}
end
if vRP.isUserHeadofStaff(user_id) then
menu["Add/Remove Admin"] = {ch_addAdmin}
menu["Add group"] = {ch_addgroup}
menu["Remove group"] = {ch_removegroup}
end
if vRP.isUserAdministrator(user_id) then
menu["Check Player"] = {ch_checkplayer}
menu["Coords"] = {ch_coords}
menu["TpToCoords"] = {ch_tptocoords}
end
if vRP.isUserLiderModerator(user_id) then
menu["Anunt Admin"] = {ch_ann}
menu["Unban"] = {ch_unban}
end
if vRP.isUserSuperModerator(user_id) then
menu["Ban Permanent"] = {ch_ban}
menu["Noclip"] = {ch_noclip}
end
if vRP.isUserModerator(user_id) then
menu["Ban Temporar"] = {ch_banTemp}
end
if vRP.isUserHelper(user_id) then
menu["Kick"] = {ch_kick}
end
if vRP.isUserTrialHelper(user_id) then
menu["TpTo"] = {ch_tpto}
menu["TpToMe"] = {ch_tptome}
menu["TpToPlace"] = {ch_tptoplace}
end
if vRP.hasPermission(user_id,"supporter.menu") then
menu["Noclip Supporter"] = {ch_noclipsupporter}
menu["Fix Supporter"] = {ch_fixsupporter}
end
menu["Admin Ticket"] = {ch_adminTicket, "Fa ticket doar daca este
ceva importat. Pentru intrebari foloseste comanda /n."}
vRP.openMenu(player,menu)
end)
end}
add(choices)
end
end)