Colour problem - 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: Colour problem (
/showthread.php?tid=124621)
Colour problem -
E-Rage - 31.01.2010
guys i tried to change to teams colour but what happend is that all the teams have changed chat colour to green why ?
Код:
public OnPlayerSpawn(playerid)
{
SetPlayerTeam(playerid, 1);
SetPlayerColor(playerid, 0x95DFECFF);
SetPlayerTeam(playerid, 2);
SetPlayerColor(playerid, 0x33AA33AA);
return 1;
}
Edit:
when i tried to fix with this:
Код:
#define TEAM_1
#define TEAM_2
Код:
new gTeam[MAX_PLAYERS];
if(gTeam[playerid] == TEAM_1) { //line 40
SetPlayerTeam(playerid, 1);
SetPlayerColor(playerid, 0x95DFECFF);
}
else if(gTeam[playerid] == TEAM_2) { //line 46
SetPlayerTeam(playerid, 2);
SetPlayerColor(playerid, 0x33AA33AA);
}
return 1;
}
it by my self this errors happend:
Код:
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(40) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\example.pwn(46) : error 029: invalid expression, assumed zero
Re: Colour problem -
Jeffry - 31.01.2010
Okay, this is untested, but try it:
At top of your GM
and this is the OnPlayerSpawn
pawn Код:
public OnPlayerSpawn(playerid)
{
{
switch (Team)
{
case 0: { SetPlayerTeam(playerid, 1);
SetPlayerColor(playerid, 0x95DFECFF);
Team++;
}
case 1: { SetPlayerTeam(playerid, 2);
SetPlayerColor(playerid, 0x33AA33AA);
Team=0;
}
}
}
return 1;
}
I hope that is what you want.
Re: Colour problem -
mansonh - 31.01.2010
edit - you reedited your code as i was posting. The last part still stands.
You have no if statements in here.
So whenever a player connects you do all of these.
You set player team 1, colour 0x95DFECFF then reset team 2 and colour to 0x33AA33AA.
SetPlayerTeam(playerid, 1);
SetPlayerColor(playerid, 0x95DFECFF);
SetPlayerTeam(playerid, 2);
SetPlayerColor(playerid, 0x33AA33AA);
If you didn't notice the lack of if statements then here is your solution:
Are you a scripting beginner?
https://sampwiki.blast.hk/wiki/Main_Page
Re: Colour problem -
E-Rage - 31.01.2010
Quote:
Originally Posted by Jeffry
Okay, this is untested, but try it:
At top of your GM
and this is the OnPlayerSpawn
pawn Код:
public OnPlayerSpawn(playerid) {
{ switch (Team) { case 0: { SetPlayerTeam(playerid, 1); SetPlayerColor(playerid, 0x95DFECFF); Team++; }
case 1: { SetPlayerTeam(playerid, 2); SetPlayerColor(playerid, 0x33AA33AA); Team=0; } } } return 1; }
I hope that is what you want.
|
it worked ok ,but the problem is some of the number 1 team got the blue talk
and the the others got green
and team 2 all got blue
did i reverse the colours ? lol
i use the:
AddPlayerClassEx(1
AddPlayerClassEx(2
is it right to use this ?
Re: Colour problem -
Jeffry - 31.01.2010
I dont know that. Sorry.