Raised This Month: $ Target: $400
 0% 

[USEFUL/SNIPPET] CSS Weapon Index's & How to Give/Remove Players Weapons


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Davethegreat
Senior Member
Join Date: Nov 2007
Old 04-14-2008 , 07:48   Re: [USEFUL/SNIPPET] CSS Weapon Index's & How to Give/Remove Players Weapons
Reply With Quote #2

Well, I though i'ld edit the above to do HL2DM
Code:
0 -  Gravity Gun
1 - Pistol
2 - 357 Magnum
3 - smg1
4 - ar2
5 - shotgun
6 - crossbow
7 - Grenade
8 - Slam (trip mine)
9 - RPG
10 - Impact Grenades (alt ammo on the smg1)
11 - Orbs (alt ammo on the ar2)
PHP Code:
new String:g_HL_WClasses[11][13] = {
    
"physcannon"//Gravity Gun 
    
"pistol"//Pistol
    
"smg1"// Sub machine gun
    
"ar2"// Combine Assault Rifle
    
"shotgun"//Shotgun
    
"crossbow" //crossbow
    
"fraggrenade"//Grenade
    
"slam"//slam
    
"rpg",  //rpg
    
"smg1_altfire",   //impact grenade
    
"ar2_altfire",  //orb
};

public 
Action:_giveweapon(id,args)
{
    if (
args 1)
    {
        
ReplyToCommand(id"[SM] Usage: sm_giveweapon <weaponid>");
        return 
Plugin_Handled;
    }
    
    new 
String:wid_str[32];
    
GetCmdArg(1,wid_str,31);
    
    new 
wid StringToInt(wid_str);
    if(
wid 11)
    {
        
PrintToConsole(id,"[SM] WARNING: Don't be a newb. Weapon Indexes range from 0-11.");
        return 
Plugin_Handled;
    }
    
    new 
String:WClass[32] = "weapon_";
    
StrCat(WClass,31,g_CS_WClasses[wid]);
    
    
GivePlayerItem(id,WClass);
    return 
Plugin_Handled;


Last edited by Davethegreat; 04-14-2008 at 18:12.
Davethegreat is offline
Send a message via AIM to Davethegreat
 



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 21:48.


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