30.01.2012, 14:52
hi there everybody!
I have a problem,
My /checkweapons only returns slot 1.
What am I doing wrong?
I have a problem,
My /checkweapons only returns slot 1.
What am I doing wrong?
pawn Код:
CMD:checkweapons(playerid, params[])
{
if(PlayerInfo[playerid][AdminLevel] >= 2)
{
new id;
if(!sscanf(params, "u", id))
{
new weaponid, ammo, weapon[24];
new string[128];
for (new c = 0; c < 13; c++)
for (new i = 0; i < 13; i++)
{
GetPlayerWeaponData(i, c, weaponid, ammo);
if (weaponid != 0 && ammo != 0)
{
GetWeaponName(weaponid, weapon, 24);
format(string, sizeof(string), "Slot %d: %s [ID: %d Ammo: %d]", i, weapon, weaponid, ammo);
SendClientMessage(playerid, COLOR_RED, string);
return 1;
}
}
return 1;
}
else return SendClientMessage(playerid, COLOR_GREY, "USAGE: /checkweapons [Player ID]");
}
else return SendClientMessage(playerid, COLOR_GREY, "You are not allowed to use that command!");
}