30.03.2013, 09:49
hey everyone i was making a cmd to check to check players weapons and im in problem im getting these erors
and this s my cmd
Код:
C:\Users\AyushSekhari\Desktop\Land of Paradise 0.3x\filterscripts\C-Admin.pwn(930) : warning 219: local variable "pname" shadows a variable at a preceding level C:\Users\AyushSekhari\Desktop\Land of Paradise 0.3x\filterscripts\C-Admin.pwn(937) : error 035: argument type mismatch (argument 2) C:\Users\AyushSekhari\Desktop\Land of Paradise 0.3x\filterscripts\C-Admin.pwn(937) : error 035: argument type mismatch (argument 2) C:\Users\AyushSekhari\Desktop\Land of Paradise 0.3x\filterscripts\C-Admin.pwn(930) : warning 204: symbol is assigned a value that is never used: "pname" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
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);
}