12.05.2012, 16:04
(
Последний раз редактировалось Jonny5; 12.05.2012 в 17:58.
)
that will break on id 18,44,45 Vini
heres a stock i just wrote for this
EDIT:
I updated the stock as it did not account for invalid ID's
should be perfect now, if anyone see's anything wrong please post.
heres a stock i just wrote for this
pawn Код:
stock GetWeaponNameByID(wid)
{
new gunname[32];
switch (wid)
{
case 1 .. 17,
22 .. 43,
46 : GetWeaponName(wid,gunname,sizeof(gunname));
case 0: format(gunname,32,"%s","Fist");
case 18: format(gunname,32,"%s","Molotov Cocktail");
case 44: format(gunname,32,"%s","Night Vis Goggles");
case 45: format(gunname,32,"%s","Thermal Goggles");
default: format(gunname,32,"%s","Invalid Weapon Id");
}
return gunname;
}
//usage
new str[47];
format(str,sizeof str, "Your weapon : %s" ,GetWeaponNameByID(wid));
EDIT:
I updated the stock as it did not account for invalid ID's
should be perfect now, if anyone see's anything wrong please post.