Dosent Set player to team color
#1

Hello i made the team color
and it worked for a while fine but then it dosent set the player to the team color the team civi dosent get his color
the team cop gets his color as i setted it

here is my code
pawn Код:
public SetPlayerToTeamColor(playerid)
{
    if(gTeam[playerid] == Team_Cop)
    {
        SetPlayerColor(playerid, COLOR_BLUE);
    }
    if(gTeam[playerid] == Team_Civi && gTeam[playerid] == Team_Rape && gTeam[playerid] == Team_Kidnapper)
    {
        SetPlayerColor(playerid, -1);
    }
    return 1;
}
Reply
#2

Quote:
Originally Posted by DarkLored
Посмотреть сообщение
Hello i made the team color
and it worked for a while fine but then it dosent set the player to the team color the team civi dosent get his color
the team cop gets his color as i setted it

here is my code
pawn Код:
public SetPlayerToTeamColor(playerid)
{
    if(gTeam[playerid] == Team_Cop)
    {
        SetPlayerColor(playerid, COLOR_BLUE);
    }
    if(gTeam[playerid] == Team_Civi && gTeam[playerid] == Team_Rape && gTeam[playerid] == Team_Kidnapper)
    {
        SetPlayerColor(playerid, -1);
    }
    return 1;
}
SetPlayerColor must be a hex or decimal notation change -1 to 0xFFFFFFFF

/do You would hear pds2k12 sighing
Код:
This forum requires that you wait 240 seconds between posts. Please try again in 54 seconds.
Reply
#3

NVM YOU WERE RIGHT REPED +1
Reply
#4

pawn Код:
public SetPlayerToTeamColor(playerid)
{
    if(gTeam[playerid] == Team_Cop)
    {
        SetPlayerColor(playerid, COLOR_BLUE);
    }
    if(gTeam[playerid] == Team_Civi || gTeam[playerid] == Team_Rape || gTeam[playerid] == Team_Kidnapper)
    {
        SetPlayerColor(playerid, 0xFFFFFFFF);
    }
    return 1;
}
Edit: You had && (and), but that would check if the player is in all three teams altogether, so it should be || (or), also changed -1 to 0xFFFFFFFF, just in case it does not work with -1.
Reply
#5

change - 1 ,it will be like this:
public SetPlayerToTeamColor(playerid)
{
if(gTeam[playerid] == Team_Cop)
{
SetPlayerColor(playerid, COLOR_BLUE);
}
if(gTeam[playerid] == Team_Civi || gTeam[playerid] == Team_Rape || gTeam[playerid] == Team_Kidnapper)
{
SetPlayerColor(playerid, 0xFFFFFFFF);
}
return 1;
}
Reply
#6

public SetPlayerToTeamColor(playerid)
{
if(gTeam[playerid] == Team_Cop)
{
SetPlayerColor(playerid, COLOR_BLUE);
}
if(gTeam[playerid] == Team_Civi || gTeam[playerid] == Team_Rape || gTeam[playerid] == Team_Kidnapper)
{
SetPlayerColor(playerid, 0xFFFFFFFF);
}
return 1;
}
Reply
#7

The problem was that a player cannot be 3 different teams at the same time, you had to use || instead of && (Like Dragonsaurus said).

I'd also like to point out that: 0xFFFFFFFF is -1
Hex are also numbers, so the problem was not that!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)