error 001: expected token: ")", but found "["
#1

I get
Quote:

error 001: expected token: ")", but found "["

For;
Код:
if (!isnull(PlayerInfo[playerid][pAdminName])) return SendClientMessage(playerid, COLOR_LIGHTRED, "You have not got an administration name.");
Why?
Reply
#2

There's nothing wrong with that line. Post the lines around it. (It is either the line above it or the one below it.)
Also, that happens when you forgot to close the angle brackets (notice there is a missing angle bracket at the end):
Код:
if (!isnull(PlayerInfo[playerid][pAdminName)) return SendClientMessage(playerid, COLOR_LIGHTRED, "You have not got an administration name.");
Reply
#3

Whole command:

Код:
CMD:aduty(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 2)
	{
			new string[128];
		    switch(AdminDuty[playerid])
			{
				case 0:
				{
					if (!isnull(PlayerInfo[playerid][pAdminName])) return SendClientMessage(playerid, COLOR_LIGHTRED, "You have not got an administration name.");
				    AdminDuty[playerid] = 1;
					SetPlayerHealth(playerid, 500000);
					SetPlayerArmour(playerid, 500000);
					format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s is now on administrative duty.", GetNameEx(playerid));
					SendClientMessageToAll(COLOR_LIGHTBLUE, "   A administrative team member is now on duty.");
					SetPlayerColor(playerid,COLOR_LIGHTBLUE);
					SendClientMessageToAll(COLOR_YELLOW, string);
					SetPlayerName(playerid, PlayerInfo[playerid][pAdminName]);
				}
				case 1:
				{
				    AdminDuty[playerid] = 0;
					SetPlayerHealth(playerid, 100);
					SetPlayerArmour(playerid, 100);
					format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s is now off administrative duty.", GetNameEx(playerid));
					SetPlayerColor(playerid,-1);
					SendClientMessageToAll(COLOR_YELLOW, string);
					if (!isnull(PlayerInfo[playerid][pName1])) SetPlayerName(playerid, PlayerInfo[playerid][pName1]);
			}
		}
	}
	else
	{
		return SendClientMessage(playerid, COLOR_RED, "You are not authorized to use this command.");
	}
	return 1;
}
Reply
#4

Show your isnull define and PlayerInfo declaration.
Reply
#5

There's nothing wrong with that code you posted either, as far as I can see.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)