02.02.2013, 09:57
Can anyone please fix this command:
ERRORS:
pawn Код:
CMD:weaps(playerid, params[])
{
new id,string[128];
if(PlayerInfo[playerid][Level] < 1)
return SendClientMessage(playerid, COLOR_RED,"You need to be Basic Moderator to use this command");
if(sscanf(params,"i",id)) {
SendClientMessage(playerid, COLOR_RED,""Server_Grey"USAGE: /weaps [id]");
SendClientMessage(playerid, COLOR_RED,""Server_Grey"Function: This will show what weapon player have");
return 1;
}
if(!IsPlayerConnected(id))
return SendClientMessage(playerid, COLOR_RED,"Player is not connected");
new Count,w,a,wName[24];
for(new solt = 0; solt != 12; solt ++) {
GetPlayerWeaponData(id, solt, w, a);
if( w != 0 && a != 0)
Count ++;
}
}
if(Count < 1)
return SendClientMessage(playerid, COLOR_RED,"This player dont have weapon!");
if(Count >= 1)
{
for(new solt = 0; solt != 12; solt ++)
{
new nName[24];
GetPlayerWeaponData(id, solt, w, a);
if(w != 0 && a != 0)
{
GetWeaponName(w, nName, 24);
format(string,128,"Weapon: %s. Ammo: %d.",wName,a);
SendClientMessage(playerid, COLOR_WHITE,string);
}
}
}
return 1;
}
Код:
D:\DOCUME~1\DR0517~1.LOZ\Desktop\MyServer\GAMEMO~1\gm.pwn(1261) : warning 204: symbol is assigned a value that is never used: "wName" D:\DOCUME~1\DR0517~1.LOZ\Desktop\MyServer\GAMEMO~1\gm.pwn(1248) : warning 204: symbol is assigned a value that is never used: "string" D:\DOCUME~1\DR0517~1.LOZ\Desktop\MyServer\GAMEMO~1\gm.pwn(1248 -- 1270) : warning 209: function "cmd_weaps" should return a value D:\DOCUME~1\DR0517~1.LOZ\Desktop\MyServer\GAMEMO~1\gm.pwn(1248 -- 1272) : error 010: invalid function or declaration D:\DOCUME~1\DR0517~1.LOZ\Desktop\MyServer\GAMEMO~1\gm.pwn(1248 -- 1273) : error 010: invalid function or declaration D:\DOCUME~1\DR0517~1.LOZ\Desktop\MyServer\GAMEMO~1\gm.pwn(1248 -- 1275) : error 010: invalid function or declaration D:\DOCUME~1\DR0517~1.LOZ\Desktop\MyServer\GAMEMO~1\gm.pwn(1248 -- 1275) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.