30.04.2015, 21:19
Hello buddy, i made an example for you to understand;
pawn Код:
CMD:showplayerguns(playerid,params[])
{
new id,string[128],ammo[2],name[24];
if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "USAGE: /showplayerguns [Player Name/Player ID]");
for(new w = 0; w < 13; w++)
{
GetPlayerWeaponData(id, w, ammo[0], ammo[1]);
if(ammo[0] == 0) continue;
GetWeaponName(ammo[0], name, sizeof(name));
format(string, sizeof(string), "Player's Weapons: %s %s(%d),", string, name, ammo[1]);
}
string[strlen(string)-1] = 0;
SendClientMessage(playerid, -1, string);
return 1;
}