(2439) : error 003: declaration of a local variable must appear in a compound block (2439) : warning 217: loose indentation (2439) : error 017: undefined symbol "string" (2439) : warning 215: expression has no effect (2439) : error 001: expected token: ";", but found "]" (2439) : fatal error 107: too many error messages on one line
CMD:a(playerid, params[])
{
if(Player[playerid][pAdminLevel] >= 1)
{
if(!isnull(params))
new string[128];//This is the errors line 2439
if(Player[playerid][pAdminLevel] == 1) format(string, sizeof(string), "[Admin Chat] {kleur}Retired Admin{FFFFFF} %s: %s", GetName(playerid, params);
else if(Player[playerid][pAdminLevel] == 2) format(string, sizeof(string), "[Admin Chat] {kleur}Junior Admin{FFFFFF} %s: %s", GetName(playerid, params);
else if(Player[playerid][pAdminLevel] == 3) format(string, sizeof(string), "[Admin Chat] {kleur}General Admin{FFFFFF} %s: %s", GetName(playerid, params);
else if(Player[playerid][pAdminLevel] == 4) format(string, sizeof(string), "[Admin Chat] {kleur}Senior Admin{FFFFFF} %s: %s", GetName(playerid, params);
else if(Player[playerid][pAdminLevel] == 5) format(string, sizeof(string), "[Admin Chat] {kleur}Head Admin{FFFFFF} %s: %s", GetName(playerid, params);
else if(Player[playerid][pAdminLevel] == 6) format(string, sizeof(string), "[Admin Chat] {kleur}Server Owner{FFFFFF} %s: %s", GetName(playerid, params);
return SendClientMessage(playerid, -1, "Syntax: /a(dmin) [text]");
}
SendToAdmins(0xF2FF00FF, string);
}
return 1;
}
new string[128]
CMD:a(playerid, params[])
{
if(Player[playerid][pAdminLevel] >= 1)
{
if(!isnull(params))
{
SendClientMessage(playerid, 0x505000FF, "USAGE : /a [text]");
}
else
{
new string[128];//This is the errors line
if(Player[playerid][pAdminLevel] == 1) format(string, sizeof(string), "[Admin Chat] {kleur}Retired Admin{FFFFFF} %s: %s", GetName(playerid, params);
else if(Player[playerid][pAdminLevel] == 2) format(string, sizeof(string), "[Admin Chat] {kleur}Junior Admin{FFFFFF} %s: %s", GetName(playerid, params);
else if(Player[playerid][pAdminLevel] == 3) format(string, sizeof(string), "[Admin Chat] {kleur}General Admin{FFFFFF} %s: %s", GetName(playerid, params);
else if(Player[playerid][pAdminLevel] == 4) format(string, sizeof(string), "[Admin Chat] {kleur}Senior Admin{FFFFFF} %s: %s", GetName(playerid, params);
else if(Player[playerid][pAdminLevel] == 5) format(string, sizeof(string), "[Admin Chat] {kleur}Head Admin{FFFFFF} %s: %s", GetName(playerid, params);
else if(Player[playerid][pAdminLevel] == 6) format(string, sizeof(string), "[Admin Chat] {kleur}Server Owner{FFFFFF} %s: %s", GetName(playerid, params);
SendToAdmins(0xF2FF00FF, string);
}
}
return 1;
}
003: declaration of a local variable must appear in a compound block The declaration of a local variable must appear between braces ("{...}") at the active scope level. When the parser flags this error, a variable declaration appears as the only statement of a function or the only statement below an if, else, for, while or do statement. Note that, since local variables are accessible only from (or below) the scope that their declaration appears in, having a variable declaration as the only statement at any scope is useless. |
(2444) : warning 202: number of arguments does not match definition (2444) : error 001: expected token: ",", but found ";" (2445) : warning 202: number of arguments does not match definition (2445) : error 001: expected token: ",", but found ";" (2446) : warning 202: number of arguments does not match definition (2446) : error 001: expected token: ",", but found ";" (2447) : warning 202: number of arguments does not match definition (2447) : error 001: expected token: ",", but found ";" (2448) : warning 202: number of arguments does not match definition (2448) : error 001: expected token: ",", but found ";" (2449) : warning 202: number of arguments does not match definition (2449) : error 001: expected token: ",", but found ";" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 6 Errors.
Then I get these errors:
Код:
(2444) : warning 202: number of arguments does not match definition (2444) : error 001: expected token: ",", but found ";" (2445) : warning 202: number of arguments does not match definition (2445) : error 001: expected token: ",", but found ";" (2446) : warning 202: number of arguments does not match definition (2446) : error 001: expected token: ",", but found ";" (2447) : warning 202: number of arguments does not match definition (2447) : error 001: expected token: ",", but found ";" (2448) : warning 202: number of arguments does not match definition (2448) : error 001: expected token: ",", but found ";" (2449) : warning 202: number of arguments does not match definition (2449) : error 001: expected token: ",", but found ";" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 6 Errors. |
try to remember ";" cuz it's very important! replace it with this new string[128];
|
new string[128];
You're missing a parenthesis on the end of every format line. ' ) '
|
if(Player[playerid][pAdminLevel] == 1) format(string, sizeof(string), "[Admin Chat] {kleur}Retired Admin{FFFFFF} %s: %s", GetName(playerid, params);