SA-MP Forums Archive
Invalid function - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Invalid function (/showthread.php?tid=441707)



Invalid function - whando - 03.06.2013

Код:
		if(strcmp(cmd, "/staff", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	    	if(PlayerInfo[playerid][pAdmin] >= 0)
	    	{
				SendClientMessage(playerid, COLOR_YELLOW, "Admins Online:");
				for(new i = 0; i<MAX_PLAYERS; i++)
				{
				    if(IsPlayerConnected(i))
				    {
						if(PlayerInfo[i][pAdmin] > 0)
						{
        					if(PlayerInfo[i][pAdmin] <= PlayerInfo[playerid][pAdmin])
        					{
        					    new atext[64];
 								if(PlayerInfo[i][pAdmin] == 2)
								{
									atext = "Junior Admin";
								}
								else if(PlayerInfo[i][pAdmin] == 3)
								{
									atext = "General Admin";
								}
								else if(PlayerInfo[i][pAdmin] == 4)
								{
									atext = "Senior Admin";
								}
								else if(PlayerInfo[i][pAdmin] == 1337)
								{
									atext = "Head Admin";
								}
								else if(PlayerInfo[i][pAdmin] == 1338)
								{
									atext = "Head Admin";
								}
								else if(PlayerInfo[i][pAdmin] == 99999)
								{
									atext = "Executive Admin";
								}
								format(string, sizeof(string), "%s: %s", atext, PlayerName(i));
				            	SendClientMessage(playerid, COLOR_WHITE, string);
								SendClientMessage(playerid, COLOR_GREEN, "Moderators Online:");
                				for(new i = 0; i<MAX_PLAYERS; i++)
       						    {
        							new atext[64];
									if(PlayerInfo[i][pAdmin] == 1)
									{
									atext = "Moderator";
									}
					    				format(string, sizeof(string), "%s: %s", atext, PlayerName(i));
       									SendClientMessage(playerid, COLOR_WHITE, string);
										SendClientMessage(playerid, COLOR_BLUE, "Helpers Online:");
      									for(new i = 0; i<MAX_PLAYERS; i++)
     						    		{
											if(PlayerInfo[i][pHelper] == 1)
											{
												atext = "Helper";
											}
											format(string, sizeof(string), "%s: %s", atext, PlayerName(i));
				            				SendClientMessage(playerid, COLOR_WHITE, string);
											}
										}
									}
								}
							}													}
						}
					}
				}
	    	}
		}
	    return 1;
	}
What's wrong?

'Invalid function or declaration' on every line


Re: Invalid function - [HiC]TheKiller - 04.06.2013

It would really help us if you could tell us what line you're getting the error on.


Re: Invalid function - whando - 04.06.2013

On every

Код:
if(PlayerInfo[i][pAdmin] == 2)
								{
									atext = "Junior Admin";
								}
line, also on the helper one.


Re: Invalid function - dusk - 04.06.2013

Are you sure this is placed under "OnPlayerCommandText" callback?


Re: Invalid function - whando - 04.06.2013

Yes it is