Big problem
#1

so i have done all these things over here right:

Код:
#include <a_samp>
#define Green 0x33AA33AA
#define Blue 0x33CCFFAA
#define Yellow 0xFFFF00AA
#define White 0xFFFFFFAA
#define Red 0xAA3333AA
#define Policebiker
#define Policeman
#define Gang
#define FBI
#define SWAT

static gTeam[MAX_PLAYERS];
new
	gPlayer0,
	gPlayer1,
	gPlayer2,
	gPlayer3,
	gPlayer4,
	gPlayer5,
	gPlayer6;
	
	new
	gPlayers[MAX_PLAYERS];

SetPlayerValue(playerid, value)
{
	gPlayers[playerid] = value;
}
and i got problems in:

Код:
public SetPlayerTeamFromClass(playerid,classid)
{
  if(classid == 4)
	{
    gTeam[playerid] = Policebiker;
	}
	else if(classid == 0 || classid == 1)

	{
	  gTeam[playerid] = Policeman;
	}
	else if(classid == 5 || classid == 6)
	{
	  gTeam[playerid] = Gang;
	}
	else if(classid == 3 )
	{
	  gTeam[playerid] = FBI;
	}
else if(classid == 2)
	{
	  gTeam[playerid] = SWAT;
	}


}

public SetPlayerToTeamColor(playerid)
{
  if(gTeam[playerid] == Policebiker) {
		SetPlayerColor(playerid,Blue);
	}
	else if(gTeam[playerid] == Policeman) {
		SetPlayerColor(playerid,White);
	}
	else if(gTeam[playerid] == Gang) {
		SetPlayerColor(playerid,Green);
  }
	else if(gTeam[playerid] == FBI) {
		SetPlayerColor(playerid,Yellow);
	}
	else if(gTeam[playerid] == SWAT) {
		SetPlayerColor(playerid,Red);
	}
it says:

Код:
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(193) : warning 235: public function lacks forward declaration (symbol "SetPlayerTeamFromClass")
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(197) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(202) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(206) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(210) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(212) : warning 217: loose indentation
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(214) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(220) : warning 235: public function lacks forward declaration (symbol "SetPlayerToTeamColor")
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(222) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(225) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(228) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(231) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(234) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(237) : error 030: compound statement not closed at the end of file (started at line 222)
what did i done wrong?
Reply
#2

add
forward SetPlayerTeamFromClass(playerid,classid);

and you need to set your variables to something
#define Policebiker
#define Policeman
#define Gang
#define FBI
#define SWAT
they are just defined, but have no value, ex
#define Policebiker 0
#define Policeman 1
#define Gang 2
#define FBI 3
#define SWAT 4

a loose indentation, easy fix

and your last one
public SetPlayerToTeamColor(playerid)
{

needs a }
Reply
#3

Quote:
Originally Posted by mansonh
add
forward SetPlayerTeamFromClass(playerid,classid);

and you need to set your variables to something
#define Policebiker
#define Policeman
#define Gang
#define FBI
#define SWAT
they are just defined, but have no value, ex
#define Policebiker 0
#define Policeman 1
#define Gang 2
#define FBI 3
#define SWAT 4

a loose indentation, easy fix

and your last one
public SetPlayerToTeamColor(playerid)
{

needs a }
thanks my error has gone but my Warnings has just began

Код:
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(215) : warning 217: loose indentation
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(242) : warning 203: symbol is never used: "SetPlayerValue"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(242) : warning 203: symbol is never used: "Team"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(242) : warning 203: symbol is never used: "gPlayer0"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(242) : warning 203: symbol is never used: "gPlayer1"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(242) : warning 203: symbol is never used: "gPlayer2"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(242) : warning 203: symbol is never used: "gPlayer3"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(242) : warning 203: symbol is never used: "gPlayer4"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(242) : warning 203: symbol is never used: "gPlayer5"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(242) : warning 203: symbol is never used: "gPlayer6"
Reply
#4

Well Delete them, gPlayer0, gPlayer1, gPlayer2 . ETC.
Reply
#5

Quote:
Originally Posted by John Rockie
Well Delete them, gPlayer0, gPlayer1, gPlayer2 . ETC.
yeah do that.
Reply
#6

Quote:
Originally Posted by John Rockie
Well Delete them, gPlayer0, gPlayer1, gPlayer2 . ETC.
i did but i got one last problem

Код:
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(233) : warning 203: symbol is never used: "SetPlayerValue"
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(233) : warning 203: symbol is never used: "Team"
Reply
#7

Delete those two things
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)