im currently working on making a gun type menu for L4d but im having issue with giving players weapons ive tryed GivePlayerItem(client, "gun here") and that didnt work so i looked up the cvars and saw it has a give command so i change it to give(client, "gun") and still nothing code provided below. also im pretty sure the gun names are right but i could be wrong cant really find an offical list of gun names so please correct me if there typed wrong
any help would be super awesome
PHP Code:
/***************GUNS***************
*Pistol
*Shotgun
*SMG
*Assault Rifle
*Hunting Rifle
*Autoshotgun
*Pipe Bomb
*Molotov
*Dual Pistols
*Chaingun/Minigun/Whatever it is
************END LIST***************/
#pragma semicolon 1
#include <sourcemod>
#define PLUGIN_VERSION "1.0.0"
public Plugin:myinfo =
{
name = "[L4D] Tank Buster Wepons Menu",
author = "{7~11} TROLL",
description = "Gives Clients Gun Menu Incase There Out Of Ammo",
version = PLUGIN_VERSION,
url = "www.711clan.net"
}
public OnPluginStart()
{
//tank buster weapons menu cvar
RegConsoleCmd("tankbuster", TankBusterMenu);
//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);
}
public Action:TankBuster(clientId) {
new Handle:menu = CreateMenu(TankBusterMenuHandler);
SetMenuTitle(menu, "Tank Buster Weapons Menu");
AddMenuItem(menu, "option1", "Shotgun");
AddMenuItem(menu, "option2", "SMG");
AddMenuItem(menu, "option3", "Assault Rifle");
AddMenuItem(menu, "option4", "Hunting Rifle");
AddMenuItem(menu, "option5", "Auto Shotgun");
AddMenuItem(menu, "option6", "Pipe Bomb");
AddMenuItem(menu, "option7", "Molotov");
AddMenuItem(menu, "option8", "Dual Pistols");
SetMenuExitButton(menu, true);
DisplayMenu(menu, clientId, MENU_TIME_FOREVER);
return Plugin_Handled;
}
public TankBusterMenuHandler(Handle:menu, MenuAction:action, client, itemNum) {
if ( action == MenuAction_Select ) {
new String:info[32];
GetMenuItem(menu, itemNum, info, sizeof(info));
//menu item 1 (shotgun)
if ( strcmp(info,"option1") == 0 ) {
//gives shotgun
{
Give(client, "weapon_shotgun");
}
}
//menu item 2 (SMG)
else if ( strcmp(info,"option2") == 0 ) {
{
Give(client, "weapon_smg");
}
}
//menu item 3 (Assault Rifle)
else if ( strcmp(info,"option3") == 0 ) {
{
Give(client, "weapon_assault_rifle");
}
}
//menu item 4 (Hunting Rifle)
else if ( strcmp(info,"option4") == 0 ) {
{
Give(client, "weapon_hunting_rifle");
}
}
//menu item 5 (Auto Shotgun)
else if ( strcmp(info,"option4") == 0 ) {
{
Give(client, "weapon_auto_shotgun");
}
}
//menu item 6 (Pipe Bomb)
else if ( strcmp(info,"option4") == 0 ) {
{
Give(client, "weapon_pipe_bomb");
}
}
//menu item 7 (Molotov)
else if ( strcmp(info,"option4") == 0 ) {
{
Give(client, "weapon_molotov");
}
}
//menu item 8 (Dual Pistols)
else if ( strcmp(info,"option4") == 0 ) {
{
Give(client, "weapon_dual_pistols");
}
}
}
else if ( action == MenuAction_End )
CloseHandle(menu);
}
__________________