![](images/misc/post_spacer.gif) |
Member
|
![Old](images/statusicon/post_old.svg)
12-01-2020
, 10:07
Re: [INS] Guns Menu - modifacation
|
#6
|
I did this, but no weapon mods are given
Quote:
#include <sourcemod>
#include <sdktools>
public Plugin myinfo =
{
name = "[INS] Guns Menu",
author = "",
description = "Guns Menu",
version = "0.4",
url = ""
};
char CurrentGameMode[30];
public void OnPluginStart()
{
RegConsoleCmd("guns", WeaponMenu);
LoadTranslations("common.phrases");
}
public void OnConfigsExecuted()
{
ConVar mp_gamemode = FindConVar("mp_gamemode");
if(mp_gamemode != null)
{
mp_gamemode.GetString(CurrentGameMode, sizeof(CurrentGameMode));
delete mp_gamemode;
return;
}
CurrentGameMode[0] = '\0';
}
public Action:WeaponMenu(client,args)
{
Weapons(client);
}
public Action:Weapons(clientId) {
if(clientId > 0)
{
new Handle:menu = CreateMenu(AdminWeaponMenuHandlerUS);
SetMenuTitle(menu, "Guns Menu");
AddMenuItem(menu, "option1", "AT4");
AddMenuItem(menu, "option2", "RPG");
SetMenuExitButton(menu, true);
DisplayMenu(menu, clientId, 15);
}
return Plugin_Handled;
}
public AdminWeaponMenuHandlerUS(Handle:menu, MenuAction:action, client, itemNum)
{
if(client > 0)
{
SetConVarBool(FindConVar("sv_cheats"), true, false);
if (action == MenuAction_Select)
{
switch (itemNum)
{
case 0:
{
FakeClientCommand(client, "give weapon_at4");
}
case 1:
{
FakeClientCommand(client, "give weapon_rpg7");
}
}
}
FakeClientCommand(client, "give_ammo 5");
SetConVarBool(FindConVar("sv_cheats"), false, false);
}
}
|
Last edited by puma133; 12-01-2020 at 10:09.
|
|
|
|