SA-MP Forums Archive
HELP MEEEEE [DONT IGNJOR] - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: HELP MEEEEE [DONT IGNJOR] (/showthread.php?tid=269495)



HELP MEEEEE [DONT IGNJOR] - sanrock - 16.07.2011

Код:
 public OnPlayerRequestClass(playerid, classid)
{
new gTeam[MAX_PLAYERS],
gPlayerClass[playerid];

  switch (classid)
   {

	   case 0:

	    {
      gTeam[playerid] = TEAM_Party;
	       GameTextForPlayer(playerid, "~g~Party", 1000, 6);

	    }
	   case 1:

	    {
      gTeam[playerid] = TEAM_Guard;
      GameTextForPlayer(playerid, "~r~Guard", 1000, 6);
  }
Код:
C:\Users\Jo\Desktop\samp server\gamemodes\test.pwn(266) : error 008: must be a constant expression; assumed zero
C:\Users\Jo\Desktop\samp server\gamemodes\test.pwn(266) : error 009: invalid array size (negative, zero or out of bounds)
C:\Users\Jo\Desktop\samp server\gamemodes\test.pwn(266) : error 036: empty statement
C:\Users\Jo\Desktop\samp server\gamemodes\test.pwn(266) : fatal error 107: too many error messages on one line

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


4 Errors.
anyone know how to fix problem?


266 is gPlayerClass[playerid];


Re: HELP MEEEEE [DONT IGNJOR] - MoroDan - 16.07.2011

Quote:
Originally Posted by sanrock
Посмотреть сообщение
Код:
 public OnPlayerRequestClass(playerid, classid)
{
new gTeam[MAX_PLAYERS],
gPlayerClass[playerid];

  switch (classid)
   {

	   case 0:

	    {
      gTeam[playerid] = TEAM_Party;
	       GameTextForPlayer(playerid, "~g~Party", 1000, 6);

	    }
	   case 1:

	    {
      gTeam[playerid] = TEAM_Guard;
      GameTextForPlayer(playerid, "~r~Guard", 1000, 6);
  }
Код:
C:\Users\Jo\Desktop\samp server\gamemodes\test.pwn(266) : error 008: must be a constant expression; assumed zero
C:\Users\Jo\Desktop\samp server\gamemodes\test.pwn(266) : error 009: invalid array size (negative, zero or out of bounds)
C:\Users\Jo\Desktop\samp server\gamemodes\test.pwn(266) : error 036: empty statement
C:\Users\Jo\Desktop\samp server\gamemodes\test.pwn(266) : fatal error 107: too many error messages on one line

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


4 Errors.
anyone know how to fix problem?


266 is gPlayerClass[playerid];
The problem comes from here:
Код:
new gTeam[MAX_PLAYERS],
gPlayerClass[playerid];
Change this to:
PHP код:
new gTeam[MAX_PLAYERS],
gPlayerClass[MAX_PLAYERS];