06.01.2012, 18:17
I assume you are using zcmd and sscanf, so try this:
pawn Код:
CMD:frisk(playerid, params[])
{
new ID;
if (sscanf(params, "u", ID)) return SendClientMessage(playerid, -1, "Usage: /frisk [id]");
new weapons[13][2], string[100], weapname[32], count;
for (new i=0;i<13;i++)
{
GetPlayerWeaponData(ID, i, weapons[i][0], weapons[i][1]);
if (weapons[i][0] != 0)
{
GetWeaponName(weapons[i][0], weapname,sizeof(weapname));
format(string,sizeof(string),"Weapon: %s || Ammo: %d || Weapon ID: %d", weapname,weapons[i][1], weapons[i][0]);
SendClientMessage(playerid, -1, string);
count++;
}
}
if (count == 0) SendClientMessage(playerid, -1,"That user has no weapons");
return 1;
}