playerteam
#1

Код:
#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!
Reply
#2

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.
Reply
#3

PlayerInfo is not defined and you should indent your code.
Reply
#4

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.
Reply
#5

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!
Reply
#6

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)