How Can i Fix This Command?
#1

Okay So This Is My Command

Код:
COMMAND:admins(playerid, params[])
{
     new count = 0;
        new string[128];
        new ChangeColor;
  		SendClientMessage(playerid, LIGHTBLUE, " ");
	SendClientMessage(playerid, LIGHTBLUE, "| -=-=-=-=-=- Online Administrators -=-=-=-=-=- |");
	SendClientMessage(playerid, LIGHTBLUE, " ");
		for(new i = 0; i < MAX_PLAYERS; i++)
		{
	 		if (IsPlayerConnected(i))
 			{
				if(AccInfo[i][Level] >= 1 && AccInfo[i][Hide] == 0)
 				{
					if(AccInfo[i][Level] > 6)
					{
						AdmRank = "Owner";
						ChangeColor = Color_Owner;
					}
 					if(IsPlayerAdmin(i))
				  	{
				  		AdmRank = "RCON Administrator";
				  		ChangeColor = Color_RCON_Administrator;
				  	}
				    else
				    {
				 		switch(AccInfo[i][Level])
						{
							case 1: {
							AdmRank = "Trail Moderator";
							ChangeColor = Color_Trail_Moderator;
							}
							case 2: {
							AdmRank = "Moderator";
							ChangeColor = Color_Moderator;
							}
							case 3: {
							AdmRank = "Administrator";
							ChangeColor = Color_Administrator;
							}
							case 4: {
							AdmRank = "Head Administrator";
							ChangeColor = Color_Head_Administrator;
							}
							case 5: {
							AdmRank = "Co-owner";
							ChangeColor = Color_Co-owner;
							}
							case 6: {
							AdmRank = "Mod Owner";
							ChangeColor = Color_Mod_Owner;
							}
						}
					}
		 			switch(AccInfo[i][OnDuty])
					{
						case 0: AdmDuty = "Playing";
						case 1: AdmDuty = "On Duty";
					}
					format(string, 128, "Level %d: %s(%i)",AccInfo[i][Level], PlayerName2(i),i);
					SendClientMessage(playerid, ChangeColor, string);
					count++;
				}
			}
		}
		{if (count == 0)
  		SendClientMessage(playerid,red,"No admin online in the list");}
  		SendClientMessage(playerid,red," ");
		SendClientMessage(playerid, LIGHTBLUE, "| -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- |");

		return 1;
}
This is my Error

Код:
C:\Documents and Settings\Chris\My Documents\HayZaticFreeRoam\filterscripts\HZadmin.pwn(837) : error 017: undefined symbol "AccInfo"
C:\Documents and Settings\Chris\My Documents\HayZaticFreeRoam\filterscripts\HZadmin.pwn(837) : warning 215: expression has no effect
C:\Documents and Settings\Chris\My Documents\HayZaticFreeRoam\filterscripts\HZadmin.pwn(837) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Chris\My Documents\HayZaticFreeRoam\filterscripts\HZadmin.pwn(837) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Chris\My Documents\HayZaticFreeRoam\filterscripts\HZadmin.pwn(837) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

you create on top:
pawn Код:
enum  c_c
{
    Level,
    Hide,
    Onduty
}
new
    AccInfo[MAX_PLAYERS][c_c];
Reply
#3

Dude stop copying and pasting codes without knowing shit about them.

Look at the wiki and read some tutorials instead of spamming this forum asking for help.

And just like the d00d above said, make an enum then use a variable with it..
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)