Garry's Mod

Garry's Mod

评价数不足
Permanent Weapons [Menu | System]
   
奖励
收藏
已收藏
取消收藏
素材类型: 插件
插件类型: 服务器内容
插件标签: 快乐, 角色扮演
文件大小
发表于
3.794 KB
2018 年 10 月 6 日 下午 3:24
1 项改动说明 ( 查看 )

订阅以下载
Permanent Weapons [Menu | System]

描述
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 条留言
KoG Runey 2022 年 2 月 25 日 下午 2:44 
Is there a way to make it so only SuperAdmin & Owner can access this menu?
HITRALPH [FR] 2021 年 4 月 23 日 下午 4:08 
i don't know why but even with my steam id the add refuse to work
Skila 2020 年 7 月 19 日 上午 6:02 
Oh cheers for that mate
Merdeus  [作者] 2020 年 7 月 16 日 上午 6:18 
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 2020 年 7 月 15 日 上午 8:50 
How do you reset all players permweapons?
Hatsune Miku 2020 年 7 月 13 日 下午 4:51 
It worked when I reset the server to find out the error. Sorry for the trouble.
Merdeus  [作者] 2020 年 7 月 13 日 下午 3:18 
Look into your console. You will definitly find an error.
Hatsune Miku 2020 年 7 月 13 日 下午 3:02 
Whenever I type the command in chat, no menu opens. Am I doing something wrong?
Merdeus  [作者] 2020 年 2 月 7 日 上午 5:09 
Not really, you would have to use lua.
Exp:

lua_run player.GetBySteamID("STEAM_0:0:170982737"):GrantPermWeapon( "weapon_some" )
Hoptilic 2020 年 2 月 6 日 下午 11:18 
is there a a console command?