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



SetPlayerTeamToColor - MiGu3X - 08.02.2013

I got this:

Код:
 * * * SetPlayerToTeamColor(playerid)
  * {
  * * * * * if (gTeam[playerid] == TEAM_HOMELESS)
  * * * * * {
  * * * * * * * * * SetPlayerColor(playerid, TEAM_HOMELESS_COLOR);
  * * * * * }
  * * * * * else if (gTeam[playerid] == TEAM_HOMELESS_2
  * * * * * {
  *                 SetPlayerColor(playerid, TEAM_HOMELESS_2_COLOR);
  *          }
  * }
  *
Im getting this error msg:

[CODE] (44): unknown directive
(347): undefined symbol "gTeam"
(347): expression has no effect
(347): expected token: ";", but found "]"
(347): invalid expression, assumed zero
Fatal: too many errorr msg on a line.[CODE]

Line 44 says:#new gTeam[MAX_PLAYERS]


Re: SetPlayerTeamToColor - Patrick - 08.02.2013

you forgot to put ; at the end
try this
pawn Код:
gTeam[MAX_PLAYERS];

  SetPlayerToTeamColor(playerid)
{
    if (gTeam[playerid] == TEAM_HOMELESS)
    {
    SetPlayerColor(playerid, TEAM_HOMELESS_COLOR);
    }
    else if (gTeam[playerid] == TEAM_HOMELESS_2)
    {
    SetPlayerColor(playerid, TEAM_HOMELESS_2_COLOR);
    }
}



Re: SetPlayerTeamToColor - ThePhenix - 08.02.2013

PHP код:
else if (gTeam[playerid] == TEAM_HOMELESS_2)//Missing ) 



Respuesta: Re: SetPlayerTeamToColor - MiGu3X - 08.02.2013

Quote:
Originally Posted by ThePhenix
Посмотреть сообщение
PHP код:
else if (gTeam[playerid] == TEAM_HOMELESS_2)//Missing ) 
I missed it on while typing cauz was on phone. + line 347 is this:

if(gTeam[playerid] == TEAM_HOMELESS)


Re: SetPlayerTeamToColor - MechaTech - 08.02.2013

Can I see this line? (44): unknown directive
So line 44.


Re: SetPlayerTeamToColor - ThePhenix - 08.02.2013

It must fix then:

new gTeam[MAX_PLAYERS];


Respuesta: SetPlayerTeamToColor - MiGu3X - 08.02.2013

no, it doesn'ts :S


Re: SetPlayerTeamToColor - Scrillex - 08.02.2013

without # just new gTeam[MAX_PLAYERS];

SetPlayerToTeamColor + question did you forward it?


Respuesta: SetPlayerTeamToColor - MiGu3X - 08.02.2013

np, i didn't forward, what how do i do?


Respuesta: SetPlayerTeamToColor - MiGu3X - 08.02.2013

NOW IT says:

[CODE]C:\Users\user7\Desktop\Server\gamemodes\new.pwn(63 ) : error 001: expected token: ";", but found "-identifier-"
C:\Users\user7\Desktop\Server\gamemodes\new.pwn(47 3) : warning 203: symbol is never used: "SetPlayerTeamFromClass"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
[CODE]

Line 63 says main()