Raised This Month: $ Target: $400
 0% 

[L4D] give player weapon


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
{7~11} TROLL
Senior Member
Join Date: Oct 2008
Location: Atlanta,Georgia
Old 02-26-2009 , 15:40   [L4D] give player weapon
Reply With Quote #1

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(menutrue);
 
DisplayMenu(menuclientIdMENU_TIME_FOREVER);
 
 return 
Plugin_Handled;
}
public 
TankBusterMenuHandler(Handle:menuMenuAction:actionclientitemNum) {
 if ( 
action == MenuAction_Select ) {
  new 
String:info[32];
 
  
GetMenuItem(menuitemNuminfosizeof(info));
  
//menu item 1 (shotgun)
  
if ( strcmp(info,"option1") == ) {
        
//gives shotgun
     
{
      
Give(client"weapon_shotgun");
        }
 
  }
  
//menu item 2 (SMG)
  
else if ( strcmp(info,"option2") == ) {
     {
      
Give(client"weapon_smg");
        }
 
  }
  
//menu item 3 (Assault Rifle)
  
else if ( strcmp(info,"option3") == ) {
     {
      
Give(client"weapon_assault_rifle");
        }
  }
  
//menu item 4 (Hunting Rifle)
  
else if ( strcmp(info,"option4") == ) {
     {
      
Give(client"weapon_hunting_rifle");
        }
        }
  
//menu item 5 (Auto Shotgun)
  
else if ( strcmp(info,"option4") == ) {
   {
      
Give(client"weapon_auto_shotgun");
        }  
  }
  
//menu item 6 (Pipe Bomb)
  
else if ( strcmp(info,"option4") == ) {
   {
      
Give(client"weapon_pipe_bomb");
        }  
  }
  
//menu item 7 (Molotov)
  
else if ( strcmp(info,"option4") == ) {
   {
      
Give(client"weapon_molotov");
        }  
  }
  
//menu item 8 (Dual Pistols)
  
else if ( strcmp(info,"option4") == ) {
   {
      
Give(client"weapon_dual_pistols");
        }  
  }
 }
 else if ( 
action == MenuAction_End )
  
CloseHandle(menu);

__________________
{7~11} TROLL is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode