All teams are green!!!!!!!!
#1

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

How many classes you added with AddPlayerClass?
Reply
#3

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 
Reply
#4

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);
        }
    }
}
Reply
#5

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

Don't change SetPlayerToTeamColor then.
Reply
#7

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;

Reply
#8

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
Reply
#9

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

First just check if the gTeams are right
Reply
#11

Your teams were wrongly set in SetPlayerTeamFromClass.
Reply
#12

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

Should be.
Reply
#14

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

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
Reply
#16

Omg, where to add this?^^
Reply
#17

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

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;
    } 
Reply
#19

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);
        }
    }
}
Reply
#20

yeah thats a good way
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)