Garry's Mod

Garry's Mod

Not enough ratings
Permanent Weapons [Menu | System]
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Server content
Addon Tags: Fun, Roleplay
File Size
Posted
3.794 KB
6 Oct, 2018 @ 3:24pm
1 Change Note ( view )

Subscribe to download
Permanent Weapons [Menu | System]

Description
Here is another addon from me.

With the chatcommand "!permweapons" you can open the permweapon menu.
As an admin you can grant or take other people permanent weapons.

All data is saved trough the inbuild sql libary, so there will be no stupid txt files



For people who know how Gmod Lua works:

PLAYER:CheckPermWeaps()
- Reloads the permweapons profile of the player

PLAYER:SavePermWeapons()
- Save all permweapons ( is getting executed immediately after changing )

PLAYER:ResetPermWeapons()
- Resets all permweapons

PLAYER:GrantPermWeapon( wep )
- Grants a player a permweapon ( wep is the classname of the weapon )

PLAYER:TakePermWeapon( wep )
- Takes a permweapon from the player ( wep is the classname of the weapon )

PLAYER:GivePermWeapons()
- Give the player all his permweapons ( is getting executed at PlayerLoadout )


If you have any suggestions or question, you can write a comment or add me on steam
18 Comments
KoG Runey 25 Feb, 2022 @ 2:44pm 
Is there a way to make it so only SuperAdmin & Owner can access this menu?
HITRALPH [FR] 23 Apr, 2021 @ 4:08pm 
i don't know why but even with my steam id the add refuse to work
Skila 19 Jul, 2020 @ 6:02am 
Oh cheers for that mate
Merdeus  [author] 16 Jul, 2020 @ 6:18am 
There isn't a direct function for it so you would have to execute a lua command


Write this in your server console:

lua_run sql.Query("DELETE FROM permweaponsmerd")
Skila 15 Jul, 2020 @ 8:50am 
How do you reset all players permweapons?
Hatsune Miku 13 Jul, 2020 @ 4:51pm 
It worked when I reset the server to find out the error. Sorry for the trouble.
Merdeus  [author] 13 Jul, 2020 @ 3:18pm 
Look into your console. You will definitly find an error.
Hatsune Miku 13 Jul, 2020 @ 3:02pm 
Whenever I type the command in chat, no menu opens. Am I doing something wrong?
Merdeus  [author] 7 Feb, 2020 @ 5:09am 
Not really, you would have to use lua.
Exp:

lua_run player.GetBySteamID("STEAM_0:0:170982737"):GrantPermWeapon( "weapon_some" )
Hoptilic 6 Feb, 2020 @ 11:18pm 
is there a a console command?