Hm didn't work..
I'll post the code
Almost everything is credited to the "{7~11} TROLL" for the Tankbuster menu
I just edited it..
Code:
/***************GUNS***************
] give ammo - not included
] give autoshotgun
] give first_aid_kit - not included
] give health - not included
] give pipe_bomb
] give molotov
] give rifle
] give smg
] give hunting_rifle
] give pain_pills
] give pistol
] give pumpshotgun
************END LIST***************/
/**********Thanks To**************
* CrimsonGt - helped me with give player item issues
*********************************/
/*********Todo/Features To Add********
] heal me - heals client
] refill me - gives client more ammo
] add menu for health,pills and ammo
] H.H.E (hand held explosives menu - allows clients to get pipebomb or molotov
**************************************/
#pragma semicolon 1
#include <sourcemod>
#define PLUGIN_VERSION "1.1.1"
#include <swarmtools>
public Plugin:myinfo =
{
name = "[L4D] Tank Buster Wepons Menu",
author = "{7~11} TROLL",
description = "Allows Clients To Get Weapons From The Weapon Menu",
version = PLUGIN_VERSION,
url = "www.711clan.net"
}
public OnPluginStart()
{
//tank buster weapons menu cvar
RegConsoleCmd("tankbuster", TankBusterMenu);
RegConsoleCmd("tankbustergive", TankBusterMenu2);
RegConsoleCmd("tankbustergive2", TankBusterMenu3);
//plugin version
CreateConVar("tank_buster_version", PLUGIN_VERSION, "Tank_Buster_Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
}
public Action:TankBusterMenu(client,args)
{
TankBuster(client);
return Plugin_Handled;
}
public Action:TankBusterMenu2(client,args)
{
TankBusterGive1(client);
return Plugin_Handled;
}
public Action:TankBusterMenu3(client,args)
{
TankBusterGive2(client);
return Plugin_Handled;
}
public Action:TankBuster(clientId) {
new Handle:menu = CreateMenu(TankBusterMenuHandler);
SetMenuTitle(menu, "TankBuster Weapons Menu");
AddMenuItem(menu, "option1", "Give Sniper");
AddMenuItem(menu, "option2", "Spawn Sniper");
SetMenuExitButton(menu, true);
DisplayMenu(menu, clientId, MENU_TIME_FOREVER);
return Plugin_Handled;
}
public Action:TankBusterGive1(client) {
Swarm_SetMarineHealth(Swarm_GetMarine(client), Swarm_GetMarineMaxHealth(Swarm_GetMarine(client)));
return Plugin_Handled;
}
public Action:TankBusterGive2(client) {
if ( Swarm_IsMarineInfested(Swarm_GetMarine(client)) == true ) {
Swarm_CureMarineInfestation(Swarm_GetMarine(client));
}
return Plugin_Handled;
}
public TankBusterMenuHandler(Handle:menu, MenuAction:action, client, itemNum)
{
//Strip the CHEAT flag off of the "give" command
new flags = GetCommandFlags("give");
new flags2 = GetCommandFlags("ent_create");
SetCommandFlags("give", flags & ~FCVAR_CHEAT);
SetCommandFlags("ent_create", flags2 & ~FCVAR_CHEAT);
if ( action == MenuAction_Select ) {
switch (itemNum)
{
case 0: //Give
{
//Give the player a shotgun
FakeClientCommand(client, "asw_gimme_ammo");
}
case 1: //Spawn
{
//Give the player a smg
FakeClientCommand(client, "asw_gimme_health");
}
}
}
//Add the CHEAT flag back to "give" command
SetCommandFlags("give", flags|FCVAR_CHEAT);
SetCommandFlags("give", flags2|FCVAR_CHEAT);
}
__________________