16.03.2015, 17:30
Not quite sure why you're using 'PlayerWeapons' in the first place, this is all you really need:
EDIT: What's the difference between model and ID? Does ID refer to the weapon slot in which they are held?
pawn Code:
CMD:weptest(playerid, params[])
{
new weapname[25];
if(sscanf(params, "s[25]", weapname)) return SendClientMessage(playerid, COLOUR_GREY, "Usage: /weptest [weapon]");
for(new w = 0; w < sizeof(WeaponNames); w++)
{
if(!strcmp(WeaponNames[w], weapname, true))
{
new string[65];
format(string, sizeof(string), "Weapon: %s | Ammo: %d | Weapon ID: %d", WeaponNames[w], WepAmmo[w], w);
SendClientMessage(playerid, COLOUR_WHITE, string);
break;
}
}
return 1;
}