hey everyone i was making a cmd to check to check players weapons and im in problem im getting these erors
pawn Код:
CMD:getweaps(playerid,params[])
{
if(gPlayerInfo[playerid][Level] >= 1 || IsPlayerAdmin(playerid))
{
new target, pname[MAX_PLAYER_NAME];
new Count, x;
new string[128], string2[64];
new WeapName[24], slot, weap, ammo;
if(sscanf(params, "u", target)) return SendClientMessage(playerid, -1, "USAGE: /getweaps (playername/ID)");
if(IsPlayerConnected(target) && target != INVALID_PLAYER_ID)
{
GetPlayerName(target, pname, sizeof(pname));
format(string2,sizeof(string2),"_______|- (%d)%s Weapons -|_______", target, pname);
SendClientMessage(playerid,COLOR_YELLOW,string2);
for(slot = 0; slot < 14; slot++)
{
GetPlayerWeaponData(target, slot, weap, ammo);
if( ammo != 0 && weap != 0)
Count++;
}
if(Count < 1)
return SendClientMessage(playerid,COLOR_ORANGE,"No Weapons found!");
if(Count >= 1)
{
for (slot = 0; slot < 14; slot++)
{
GetPlayerWeaponData(target, slot, weap, ammo);
if( ammo != 0 && weap != 0)
{
GetWeaponName(weap, WeapName, sizeof(WeapName));
if(ammo == 65535 || ammo == 1)
format(string,sizeof(string),"%s%s (1)",string, WeapName);
else format(string,sizeof(string),"%s%s (%d)",string, WeapName, ammo);
x++;
if(x >= 5)
{
SendClientMessage(playerid, COLOR_ORANGE, string);
x = 0;
format(string, sizeof(string), "");
}
else format(string, sizeof(string), "%s, ", string);
}
}
if(x <= 4 && x > 0)
{
string[strlen(string)-3] = '.';
SendClientMessage(playerid, COLOR_ORANGE, string);
}
}
return 1;
}
else return ErrorMessages(playerid, 2);
}
else return ErrorMessages(playerid, 1);
}