SA-MP Forums Archive
All teams are green!!!!!!!! - 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: All teams are green!!!!!!!! (/showthread.php?tid=276170)

Pages: 1 2


All teams are green!!!!!!!! - samtey - 12.08.2011

OMG, like the title says!

I did this:

PHP код:
#define TEAM_GROVE_COLOR 0x00FF00AA // Bright Green (in RGBA format)
    #define TEAM_BALLA_COLOR 0xFF00FFAA // Bright Purple
    #define TEAM_VAGOS_COLOR 0xFFFF00AA // Yellow 
And:

PHP код:
    SetPlayerTeamFromClass(playeridclassid)
    {
        if (
classid == 0)
        {
            
gTeam[playerid] = BALLA;
        }
        else if(
classid == 1)
        {
            
gTeam[playerid] = GROVE;
        }
        else if(
classid == 2)
        {
            
gTeam[playerid] = VAGOS;
        }
    }
    
SetPlayerToTeamColor(playerid)
    {
            if (
gTeam[playerid] == GROVE)
            {
                    
SetPlayerColor(playeridTEAM_GROVE_COLOR);
            }
            else if (
gTeam[playerid] == BALLA)
            {
                    
SetPlayerColor(playeridTEAM_BALLA_COLOR);
            }
            else if (
gTeam[playerid] == VAGOS)
            {
                
SetPlayerColor(playeridTEAM_VAGOS_COLOR);
            }
    } 
When I see a player on the map, he's green! EVERY PLAYER!

Also, I got the same problem in the CHAT! When somebody says something, it is only green, too!


Re: All teams are green!!!!!!!! - MadeMan - 12.08.2011

How many classes you added with AddPlayerClass?


AW: All teams are green!!!!!!!! - samtey - 12.08.2011

PHP код:
//Ballas
        
AddPlayerClass(1021974.4895,-1157.0608,20.9505,95.6222303502935027350); //Ballas1
        
AddPlayerClass(1031976.7120,-1183.5504,26.0188,98.0542223503435029350); //Ballas2
        
AddPlayerClass(1042092.0271,-1166.3419,26.5859,89.4869283502335040); //Ballas3
       //Grove
        
AddPlayerClass(2692486.7598,-1647.5186,14.0703,187.5500303502535024350); //Smoke
        
AddPlayerClass(2712459.9001,-1688.4135,13.5280,2.9949333503235031350); //Ryder
        
AddPlayerClass(270,2516.3430,-1674.3085,13.9348,81.6422,32,350,31,350,34,350); // Sweet
        
AddPlayerClass(0,2495.4890,-1688.2717,13.7022,5.9233,1,0,29,350,27,350); // CJ
        
AddPlayerClass(105,2451.6484,-1642.4531,13.7357,182.6713,28,350,33,350,22,350); // grove1
        
AddPlayerClass(106,2413.7170,-1647.2096,14.0119,174.8622,26,350,30,350,23,350); // grove2
        
AddPlayerClass(107,2408.6982,-1674.0126,13.6037,356.5973,34,350,30,350,32,350); // grove3
       //Vagos
        
AddPlayerClass(108,2571.8352,-1091.2091,66.9639,48.7203,29,350,9,0,31,350); // Vagos1
        
AddPlayerClass(109,2569.7373,-1088.5804,67.0079,220.8869,22,350,33,350,30,350); // Vagos2
        
AddPlayerClass(110,2576.0371,-1070.5568,69.8322,89.5007,27,350,24,350,32,350); // Vagos3 



Re: All teams are green!!!!!!!! - MadeMan - 12.08.2011

pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
    switch(classid)
    {
        case 0 .. 2:
        {
            gTeam[playerid] = BALLA;
        }
        case 3 .. 9:
        {
            gTeam[playerid] = GROVE;
        }
        case 10 .. 12:
        {
            gTeam[playerid] = VAGOS;
        }
    }
}

SetPlayerToTeamColor(playerid)
{
    switch(gTeam[playerid])
    {
        case GROVE:
        {
            SetPlayerColor(playerid, TEAM_GROVE_COLOR);
        }
        case BALLA:
        {
            SetPlayerColor(playerid, TEAM_BALLA_COLOR);
        }
        case VAGOS:
        {
            SetPlayerColor(playerid, TEAM_VAGOS_COLOR);
        }
    }
}



AW: All teams are green!!!!!!!! - samtey - 12.08.2011

Код:
D:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\gamemodes\deathmatch.pwn(330) : error 008: must be a constant expression; assumed zero
D:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\gamemodes\deathmatch.pwn(334) : error 008: must be a constant expression; assumed zero
D:\Program Files\Rockstar Games\GTA San Andreas\eigener SAMP\gamemodes\deathmatch.pwn(338) : error 008: must be a constant expression; assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
lines:

pawn Код:
case GROVE:
case BALLA:
case VAGOS:



Re: All teams are green!!!!!!!! - MadeMan - 12.08.2011

Don't change SetPlayerToTeamColor then.


AW: All teams are green!!!!!!!! - samtey - 12.08.2011

Well, so far no errors, I can't test it yet 'cause nobody else is online!

What about the chat, why the hell is there every person who speaks green?

I have this, but this does not work!

PHP код:
public OnPlayerText(playeridtext[])
{
    new 
sendername[MAX_PLAYER_NAME], string[128];
    if(
chatmode)
    {
        
GetPlayerName(playeridsendernamesizeof(sendername));
        
format(stringsizeof(string), "%s: %s"sendernametext);
        if(
gTeam[playerid] == GROVE)
        {
            
SendLocalChat(playerid,0x00FF00AA,string,20.0);
            return 
0;
        }
        if(
gTeam[playerid] == BALLA)
        {
            
SendLocalChat(playerid,0xFF00FFAA,string,20.0);
            return 
0;
        }
        if(
gTeam[playerid] == VAGOS)
        {
            
SendLocalChat(playerid,0xFFFF00AA,string,20.0);
            return 
0;
        }
    }
    return 
0;




Re: All teams are green!!!!!!!! - Wesley221 - 12.08.2011

pawn Код:
CMD:test(playerid, params[])
{
    new string[128];
    format(string, sizeof string, "gTeam[playerid] = %s", gTeam[playerid]);
    SendClientMessage(playerid, -1, string);
    return 1;
}
Check if the gTeams are right with each team


AW: All teams are green!!!!!!!! - samtey - 12.08.2011

But I need to know if the colors of the teams are right also!


Re: All teams are green!!!!!!!! - Wesley221 - 12.08.2011

First just check if the gTeams are right


Re: All teams are green!!!!!!!! - MadeMan - 12.08.2011

Your teams were wrongly set in SetPlayerTeamFromClass.


AW: All teams are green!!!!!!!! - samtey - 12.08.2011

Does this also improve the Localchat? Is the localchat right now, too?


Re: All teams are green!!!!!!!! - MadeMan - 12.08.2011

Should be.


AW: All teams are green!!!!!!!! - samtey - 12.08.2011

Hmm, we tested it, still all names are green and the dots on the map, too!
Also the chat!


Re: All teams are green!!!!!!!! - Zonoya - 12.08.2011

simple to fix look at my code this works PERFECTLY all u have to do is add the classes and do this


if(GetPlayerSkin(playerid, 116))
if(GetPlayerSkin(playerid, 115))
if(GetPlayerSkin(playerid, 114))
SetPlayerColor(playerid, Purpley);
SetPlayerMarkerForPlayer( i, playerid, Purpley );


thats all u do so say its Balla's u use if(getPlayerSkin(playerid, Balla skin 1))
then after SetPlayerColor(playerid, (Balla Purple);

same with vangos and Grove
if it works give me +rep plz


AW: All teams are green!!!!!!!! - samtey - 12.08.2011

Omg, where to add this?^^


Re: All teams are green!!!!!!!! - Zonoya - 12.08.2011

under OnPlayerSpawn so if they have the skin when they spawn they get the color


AW: All teams are green!!!!!!!! - samtey - 13.08.2011

Oh man, I'm such too stupid, can you do it in the callback please?

PHP код:
public OnPlayerSpawn(playerid)
    {
        
GangZoneShowForPlayer(playeridballas1, -2147418167);
        
GangZoneShowForPlayer(playeridballas2, -2147418167);
        
GangZoneShowForPlayer(playeridballas3, -2147418167);
        
GangZoneShowForPlayer(playeridgrove116711888);
        
GangZoneShowForPlayer(playeridgrove216711888);
        
GangZoneShowForPlayer(playeridgrove316711888);
        
GangZoneShowForPlayer(playeridvagos1, -65332);
        
GangZoneShowForPlayer(playeridvagos2, -65332);
        
        
        
PlayerPlaySound(playerid11860.00.00.0);
        
SetPlayerToTeamColor(playerid);
        
PlayerInfo[playerid][pDead] = false;
        
//PreloadAnimLib(playerid,animlib[]);
        
return 1;
    } 



Re: All teams are green!!!!!!!! - MadeMan - 13.08.2011

Remove this

pawn Код:
new GROVE,BALLA,VAGOS;
add this

pawn Код:
#define GROVE 1
#define BALLA 2
#define VAGOS 3
change this

pawn Код:
SetPlayerToTeamColor(playerid)
{
    switch(gTeam[playerid])
    {
        case GROVE:
        {
            SetPlayerColor(playerid, TEAM_GROVE_COLOR);
        }
        case BALLA:
        {
            SetPlayerColor(playerid, TEAM_BALLA_COLOR);
        }
        case VAGOS:
        {
            SetPlayerColor(playerid, TEAM_VAGOS_COLOR);
        }
    }
}



Re: All teams are green!!!!!!!! - Zonoya - 13.08.2011

yeah thats a good way