compiler error -
crukk11 - 12.02.2017
how to add this code
COMMAND:agiveweapon(playerid, params[])
{
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,
weaponid,
ammo;
if(sscanf(params, "uii", targetid, weaponid ammo))
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;
}
i compile it and i get error like this
C:\Users\Cyber\Desktop\SSSS\GL.pwn(1857) : error 017: undefined symbol "logged"
C:\Users\Cyber\Desktop\SSSS\GL.pwn(1857) : warning 215: expression has no effect
C:\Users\Cyber\Desktop\SSSS\GL.pwn(1857) : error 001: expected token: ";", but found "]"
C:\Users\Cyber\Desktop\SSSS\GL.pwn(1857) : error 029: invalid expression, assumed zero
C:\Users\Cyber\Desktop\SSSS\GL.pwn(1857) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
or how to short this code to zcmd code
crukk11 is online now Add to crukk11's Reputation Report Post
crukk11 is online now Add to crukk11's Reputation Report Post
Re: compiler error -
SyS - 12.02.2017
You just copy pasted the code to your script without declaring variables. The variable
logged can be declared as global array of
MAX_PLAYERS with
bool tag.And set it as true on the part login confirms (probably a dialog's response in which you
checks player
types correct password). And also reset this variable on player's
disconnection too.
Start referring from
here
Re: compiler error -
crukk11 - 12.02.2017
it means
Re: compiler error -
crukk11 - 12.02.2017
and how to short the code to zcmd code