#How to get weapons as admin
1 messages · Page 1 of 1 (latest)
For money, I recommend using the SQL database to avoid any issues, and for weapons, you'll need to check your armory script. Be careful, depending on the game version (DLC) you're using, you'll have fewer weapons. I recommend setting your server to fivem version 3323 to have all the weapons already in the game section.
Can you explain a bit I am new in this
Too long to write everything in detail XD And I don't speak English but French... good luck with someone else 🤞 
no worries
/setgroup (ur id) admin
if hes using a framework, then why would he need to use the database? thats just wrong, frameworks have specific commands to set money, just for that reason, going into the db to change is just wrong to tell someone with clearly no experience, why would u make it difficult for him?
both esx and qbcore has commands for both money,weapons and all that stuff, literally no need to change anything in the database, besides that he would need to restart or relog if he changes the db, it doesnt live update
so saying that is just dumb.
You're not wrong.
On the other hand, with the anti-cheat, he risks getting banned himself.
I've never heard of an anticheat banning admins for using admin commands 😂
what are the commands
What framework are you using?
I have installed qbcore
/giveitem - gives item to a player
don't think there's a built in command for that
ok thank you for your help
fxmanifest.lua
fx_version 'cerulean'
game 'gta5'
description 'Gives every weapon server-side via QBCore'
version '1.0.0'
dependency 'qb-core'
server_scripts {
'config.lua',
'server.lua'
}
config.lua
-- config.lua
Config = {}
-- default ammo per weapon if not passed as an arg
Config.Ammo = 250
server.lua
-- server.lua
local QBCore = exports['qb-core']:GetCoreObject()
QBCore.Commands.Add(
'allweapons',
'Give yourself every weapon',
{
{ name = 'ammo', help = 'How much ammo per weapon (optional)' }
},
false,
function(source, args)
local ammo = tonumber(args[1]) or Config.Ammo
-- iterate all defined weapons
for weaponName, _ in pairs(QBCore.Shared.Weapons) do
-- QBCore’s server-side function:
-- params: playerServerId, weaponName, ammoCount
QBCore.Functions.AddWeapon(source, weaponName, ammo)
end
-- notify client via QBCore’s notify event
TriggerClientEvent(
'QBCore:Notify',
source,
('You received all weapons with %d rounds each'):format(ammo),
'success'
)
end
)
in giveweapon folder
and in server.cfg I should add ensure giveweapon?
:rocket: Congratulations @umbral swift, you leveled up to <@&828359841512816671>!
Am I right?
sorry for being noob I have created a fivem server yesterday
what is ensured