14.08.2016, 01:48
Ok, so I #include <sscanf2> and I copy/past his code and I got 7 errors!
Vince's code:
My errors:
Vince's code:
pawn Код:
COMMAND:agiveweapon(playerid, params[]) // 4551
{
if(!logged[playerid])
return SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be logged in!");
if(PlayerInfo[playerid][pAdmin] < 1)
return SendClientMessage(playerid, COLOR_BRIGHTRED, "You are not allowed to use that command!");
new
targetid = INVALID_PLAYER_ID, // 4560
weaponid,
ammo;
if(sscanf(params, "uii", targetid, weaponid ammo)) // 4564
return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /agiveweapon [id] [arme] [munitions]");
if(!IsPlayerConnected(targetid))
{
format(string, sizeof(string), "ID:%d is not an active player.", targetid);
SendClientMessage(playerid, COLOR_BRIGHTRED, string);
return 1;
}
new
targetName[MAX_PLAYER_NAME],
weaponName[32];
GetPlayerName(targetid, targetName, sizeof targetName);
GetWeaponName(weaponid, weaponName, sizeof weaponName);
GivePlayerWeapon(targetid, weaponid, ammo);
format(string, sizeof(string), "You have given %s a %d with %d ammo.", targetName, weaponName, ammo);
SendClientMessage(playerid, COLOR_ORANGE, string);
return 1;
}
pawn Код:
\pawno\include\sscanf2.inc(27) : error 021: symbol already defined: "sscanf"
\pawno\include\sscanf2.inc(28) : error 021: symbol already defined: "unformat"
(4551) : error 017: undefined symbol "agiveweapon"
(4560) : warning 219: local variable "targetid" shadows a variable at a preceding level
(4564) : error 017: undefined symbol "params"
(4564) : warning 215: expression has no effect
(4564) : error 001: expected token: ";", but found ")"
(4564) : error 029: invalid expression, assumed zero
(4564) : fatal error 107: too many error messages on one line

