SA-MP Forums Archive
playerteam - 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: playerteam (/showthread.php?tid=90114)



playerteam - dafel2 - 06.08.2009

Код:
#define TEAM_MYTEAM 0
Код:
enum pInfo
{
	team,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Код:
SetPlayerClass(playerid, classid)
{
 switch(classid) {

  case 0: {
  PlayerInfo[playerid][team] = TEAM_TEACHER;
	}
 }
}
Код:
public OnPlayerSpawn(playerid)
{
  if(IsPlayerAdmin(playerid))
  {
       SendClientMessageToAll(0xDEEE20FF, "A Admin has Spawned!");
  }
  	 switch(PlayerInfo[playerid][team])
  {
	 case TEAM_TEACHER:
 {
	 PlayerPlaySound(playerid, 1069, 0.0, 0.0, 0.0);
        SetPlayerColor(playerid,COLOR_YELLOW);
  }
 }
ERRORS
Код:
 : warning 217: loose indentation
 : error 017: undefined symbol "PlayerInfo"
: error 029: invalid expression, assumed zero
: fatal error 107: too many error messages on one line
i really have no idea why those errors are showing!


Re: playerteam - refshal - 06.08.2009

pawn Код:
new PlayerInfo[MAX_PLAYERS][pInfo];
But I can't help you with the others, since you didn't show which lines that causes the errors.


Re: playerteam - Correlli - 06.08.2009

PlayerInfo is not defined and you should indent your code.


Re: playerteam - dafel2 - 06.08.2009

Quote:
Originally Posted by еddy
pawn Код:
new PlayerInfo[MAX_PLAYERS][pInfo];
But I can't help you with the others, since you didn't show which lines that causes the errors.
as you can see i already have that line.
And i have commented that line where the errors are.

Quote:
Originally Posted by Don Correlli
PlayerInfo is not defined and you should indent your code.
I am very bad at indenting.

FIXED: in my script there was unnecesary lines that must be deleted. And becouse of those unnecesary lines i got those errors. Thanks for helping.


Re: playerteam - refshal - 06.08.2009

Quote:
Originally Posted by revenngeR
Quote:
Originally Posted by еddy
pawn Код:
new PlayerInfo[MAX_PLAYERS][pInfo];
But I can't help you with the others, since you didn't show which lines that causes the errors.
as you can see i already have that line.
And i have commented that line where the errors are.
Shit, I didn't notice that.

Quote:
Originally Posted by revenngeR
And i have commented that line where the errors are.
No you didn't. You just wrote this:

Quote:
Originally Posted by revenngeR
ERRORS

Code:
Код:
: warning 217: loose indentation
 : error 017: undefined symbol "PlayerInfo"
: error 029: invalid expression, assumed zero
: fatal error 107: too many error messages on one line
i really have no idea why those errors are showing!



Re: playerteam - Andom - 06.08.2009

Did you put new PlayerInfo[bla bla bla....]; into the top of your script?
and not in a public or lower then it would be called or something, or in a filterscript or include?