Script Error
#1

Yo,

I got a few little errors, I've been indenting and fixing but can't seem to figure out these few:

Код:
C:\Users\PC_01\Desktop\SpitFire Gaming\gamemodes\PR-RP.pwn(414) : error 017: undefined symbol "playerid"
C:\Users\PC_01\Desktop\SpitFire Gaming\gamemodes\PR-RP.pwn(414) : error 021: symbol already defined: "PlayerInfo"
../gamemodes/OnGameMode.pwn(11591) : warning 204: symbol is assigned a value that is never used: "amount"
../gamemodes/OnCommand.pwn(11) : error 017: undefined symbol "Available"
../gamemodes/OnCommand.pwn(13) : error 017: undefined symbol "Available"
../gamemodes/OnCommand.pwn(18) : error 017: undefined symbol "Available"
../gamemodes/OnCommand.pwn(17893) : error 017: undefined symbol "Available"
../gamemodes/OnCommand.pwn(17936) : error 017: undefined symbol "COLOR_WHTIE"
../gamemodes/OnCommand.pwn(24157) : warning 204: symbol is assigned a value that is never used: "devtext"
../gamemodes/OnCommand.pwn(24157) : warning 204: symbol is assigned a value that is never used: "sendername"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


7 Errors.
All i'm trying to do is simply get a normal helper command to show all the helpers online but at the same time, Show their status, Example:

Код:
Desmond_Barthomolew - Level 6 ( Available )
I've assigned the variable on the top of the script as:

Код:
new PlayerInfo[playerid][Available];
The actual command to change the status:

Код:
COMMAND:hs(playerid, params[])
{
     if(PlayerInfo[playerid][Available] == 1)
     {
          PlayerInfo[playerid][Available] = 0;
          SendClientMessage(playerid, 0xFF0000, "> Status Unavailable");
     }
     else
     {
          PlayerInfo[playerid][Available] = 1;
          SendClientMessage(playerid, 0x00FF00, "> Status Available");
     }
     return 1;
}
And finally the actual helpers command:

Код:
COMMAND:helpers(playerid, params[])
{
    new sendername[MAX_PLAYER_NAME],string[128],helptext[128];
    if (GetPVarInt(playerid, "PlayerLogged") == 0) return SendClientMessage(playerid, COLOR_WHITE, "You must be logged in to use this.");
    new found = 0;
    new status[30], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name));
	if(PlayerInfo[playerid][Available] == 1) status = "{00FF00}Available{FFFFFF}";
	else status = "{FF0000}Unavailable{FFFFFF}";
    foreach (Player,i)
    {
        if(GetPVarInt(i, "Helper") >= 1)
		{
		    found++;
		}
	}
	SendClientMessage(playerid, COLOR_WHITE, ".:: {FF0000}Helpers Online{FFFFFF} ::.");
	if(found == 0) return SendClientMessage(playerid, COLOR_WHITE, "> There Are Currently {FF0000}0{FFFFFF} Helpers Online.");
    foreach (Player,i)
    {
        if(GetPVarInt(i, "Helper") >= 1)
        {
            format(sendername, sizeof(sendername), "%s", PlayerName(i));
      		GiveNameSpace(sendername);
      		switch(GetPVarInt(i, "Helper"))
            {
                case 3: helptext = "Helper";
                case 2: helptext = "Helper";
                case 1: helptext = "Helper";
            }
			switch(GetPVarInt(i, "HelperDuty"))
			{
			    case 0:
			    {
			        if(strcmp(PlayerInfo[i][pAdmName], "None", true) == 0)
			        {
		     	        format(string, sizeof(string), "%s - %s ( %d ) ( %s )", helptext, sendername, i, status);
			            SendClientMessage(playerid, COLOR_WHITE, string);
					}
					else
					{
					    format(string, sizeof(string), "%s - (%s) %s ( %d ) ( %s )", helptext, PlayerInfo[i][pAdmName], sendername, i, status);
			            SendClientMessage(playerid, COLOR_WHITE, string);
					}
			    }
			    case 1:
			    {
			        if(strcmp(PlayerInfo[i][pAdmName], "None", true) == 0)
			        {
		     	        format(string, sizeof(string), "%s - %s ( %d ) ( %s )", helptext, sendername, i, status);
			            SendClientMessage(playerid, COLOR_WHTIE, string);
					}
					else
					{
					    format(string, sizeof(string), "%s - (%s) %s ( %d ) ( %s )", helptext, PlayerInfo[i][pAdmName], sendername, i, status);
			            SendClientMessage(playerid, COLOR_WHITE, string);
					}
			    }
			}
        }
    }
	return 1;
}
Reply
#2

"Available" needs to go in your new PlayerInfo enum, you can't just place "new PlayerInfo[playerid][Available];" on the top of the script. By that I mean on this:
pawn Код:
enum pInfo
{
    pAdmin,
        PMoney,
        // other indexes
        Available
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Reply
#3

Sorry, I have. I just forgot to include it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)