where do i find the colours of the teams?
#1

Hi,

I got a question! Where do I find the colours of the teams? For example:
Код:
#define TEAM_BALLA_COLOR 0xFF00FFAA // Bright Purple
And when I defined them, I should add them here?

Код:
SetPlayerTeamFromClass(playerid, classid)
{
    if (classid == 0)
    {
        gTeam[playerid] = TEAM_GROVE;
    }
    else
    {
        gTeam[playerid] = TEAM_BALLA;
    }
}
But when there are more teams, like Vagos and Police, how should I add them in this if-else thing??
Reply
#2

pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
    switch(classid)
    {
        case 0 .. 2: gTeam[playerid] = TEAM_GROVE; // Case 0, 1, 2 are TEAM_GROVE
        case 3 .. 5: gTeam[playerid] = TEAM_BALLA; // Case 3, 4, 5 are TEAM_BALLA
        case 6 .. 8: gTeam[playerid] = TEAM_VAGOS; // Case 6, 7, 8 are TEAM_VAGOS
        case 9: gTeam[playerid] = TEAM_CJ; // Case 9 is TEAM_CJ
    }
}
Change the teams you use, and the classid's aswell

Edit:
pawn Код:
SetPlayerToTeamColour(playerid)
{
    if(gTeam[playerid] == TEAM_GROVE)
    {
        SetPlayerColor(playerid, color here);
    }
    else if (gTeam[playerid] == TEAM_BALLA)
    {
        SetPlayerColor(playerid, color here);
    }
    else if (gTeam[playerid] == TEAM_VAGOS)
    {
        SetPlayerColor(playerid, color here);
    }
    else if (gTeam[playerid] == TEAM_CJ)
    {
        SetPlayerColor(playerid, color here);
    }
}
Reply
#3

Ok, thank u^^

Only one question left: Where do I find the colours of the teams? I told above ur post, which colours I mean!
Reply
#4

Oh, and something else:

Which of ur Codes above should I take?
Reply
#5

RR GG BB

Red Green Blue

Thats the HEX format, forgot the other format to the code

0x FF FF FF FF
RR GG BB Transparency ( Think so )

Theres many programs for this as well.
Reply
#6

https://sampforum.blast.hk/showthread.php?tid=157789
+ what Lorenc said, there are some progams for this aswell: ****** around
Reply
#7

Thanks! Only, which of ur Codes above should I take, Wesley?
Reply
#8

This one will set the team from class. I missreaded your question in the first place, so i made the second one
pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
    switch(classid)
    {
        case 0 .. 2: gTeam[playerid] = TEAM_GROVE; // Case 0, 1, 2 are TEAM_GROVE
        case 3 .. 5: gTeam[playerid] = TEAM_BALLA; // Case 3, 4, 5 are TEAM_BALLA
        case 6 .. 8: gTeam[playerid] = TEAM_VAGOS; // Case 6, 7, 8 are TEAM_VAGOS
        case 9: gTeam[playerid] = TEAM_CJ; // Case 9 is TEAM_CJ
    }
}
This one changes your colour
pawn Код:
SetPlayerToTeamColour(playerid)
{
    if(gTeam[playerid] == TEAM_GROVE)
    {
        SetPlayerColor(playerid, color here);
    }
    else if (gTeam[playerid] == TEAM_BALLA)
    {
        SetPlayerColor(playerid, color here);
    }
    else if (gTeam[playerid] == TEAM_VAGOS)
    {
        SetPlayerColor(playerid, color here);
    }
    else if (gTeam[playerid] == TEAM_CJ)
    {
        SetPlayerColor(playerid, color here);
    }
}
Reply
#9

@Wesley

So I should take both, one time for "SetPlayerTeamFromClass" and the other one for "SetPlayerToTeamColor"!
Reply
#10

Well, its what you want.
You can use your own "SetPlayerTeamFromClass", or just use mines. Just use what you want
Reply
#11

But u wrote SetPlayerToTeamColour!
This doesn't exist in my gamemode, where should I add it, if I want to take this?
Reply
#12

Just like how u did SetPlayerTeamFromClass
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)