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;
}