Color green = blue and green?
#1

Hi, I got a major problem in my GM with my colors...
so I have 4 colors that I use for teams:

pawn Код:
#define COLOR_ROYALBLUE 0x4169FFAA
#define COLOR_SEXYGREEN 0x18F000AA
#define COLOR_ORANGE 0xFFA500AA
#define COLOR_GREY 0xAFAFAFAA
Green is drivers
Blue is cops
Orange is bandits
Grey is unspawned...

I use this colors for many functions, the players map icon, gangzones, teamchat, sendclientmessages... etc.
And also for SetPlayerColor

Instead of a spawn menu, I made a map, where a player has to chose a pickup, if they enter that pickup they will be set to their team.

so under that OnPlayerPickup
I set the player's color
however if I put COLOR_SEXYGREEN in gangzones, clientmessages and more, it will become green, however if I use COLOR_SEXYGREEN in SetPlayerColor the player's color will turn blue -.-

I have the same problem with the cops, they are ROYALBLUE, but they turn green, their gangzones and clientmessages will be blue, but the players' name will be Green...

anyhelp?

note, there is not an option that I used SetPlayerColor twice for one team with 2 different colors, I only use SetPlayerColor 4 times, for each team one time...
Reply
#2

Show some code.
Reply
#3

onplayerconnect
pawn Код:
SetPlayerColor(playerid,COLOR_GREY);
my spawn system

pawn Код:
//==============================================================================
//Bandit spawn
//==============================================================================

    if(pickupid == banditpickupspawn)
    {
        SetPlayerPos(playerid, 696.0515,-1444.0397,13.5391);

        gTeam[playerid] = TEAM_BANDIT;
        SetPlayerColor(playerid,COLOR_ORANGE); // orange
        new name[MAX_PLAYER_NAME], string[44];
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "%s Joined team Bandits!",name);
        SendClientMessageToAllBandits(string);
        SendClientMessage(playerid, COLOR_SEXYGREEN, "|=========================|");
        SendClientMessage(playerid, COLOR_SEXYGREEN, "U have joined Team Bandits!");
        SendClientMessage(playerid, COLOR_SEXYGREEN, "|=========================|");
       
        SetPlayerWantedLevel(playerid, 0);
        ResetPlayerWeapons(playerid);
       
        SetTimer("bandwepstim", 300000, true);

        if(IsLevel[playerid] == 1)
            {
                SetPlayerHealth(playerid, 100);
                SetPlayerSkin(playerid,BandSkinsL1[random(sizeof(BandSkinsL1))]);
           
                GivePlayerWeapon(playerid, 30, 200); //slot 5
                GivePlayerWeapon(playerid, 28, 500); //slot 4
                GivePlayerWeapon(playerid, 24, 20); //slot 2
                GivePlayerWeapon(playerid, 1, 0); //slot 2

                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your current level: 1 -car stealer- (/l1 for more info)");
            }

        if(IsLevel[playerid] == 2)
            {
                SetPlayerHealth(playerid, 100);
                SetPlayerArmour(playerid, 50);
                SetPlayerSkin(playerid,BandSkinsL2[random(sizeof(BandSkinsL2))]);
           
                GivePlayerWeapon(playerid, 30, 400); //slot 5
                GivePlayerWeapon(playerid, 28, 1000); //slot 4
                GivePlayerWeapon(playerid, 24, 40); //slot 2
                GivePlayerWeapon(playerid, 26, 50); //slot 3

                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your current level: 2 -Badass- (/l2 for more info)");
            }

        if(IsLevel[playerid] == 3)
            {
                SetPlayerHealth(playerid, 100);
                SetPlayerArmour(playerid, 100);
                SetPlayerSkin(playerid,BandSkinsL3[random(sizeof(BandSkinsL3))]);
           
                GivePlayerWeapon(playerid, 30, 800); //slot 5
                GivePlayerWeapon(playerid, 28, 2000); //slot 4
                GivePlayerWeapon(playerid, 24, 80); //slot 2
                GivePlayerWeapon(playerid, 26, 100); //slot 3
                GivePlayerWeapon(playerid, 18, 20); //slot 8

                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your current level: 3 -Maffia Boss- (/l3 for more info)");
            }


    }
//==============================================================================
//COP Spawn
//==============================================================================
 if(pickupid == coppickupspawn)
    {
        SetPlayerPos(playerid, 1580.4596,-1634.8533,13.5612);

        gTeam[playerid] = TEAM_COPS;

        SetPlayerColor(playerid,COLOR_ROYALBLUE);
        SetPlayerWantedLevel(playerid, 0);
        ResetPlayerWeapons(playerid);

        new name[MAX_PLAYER_NAME], string[44];
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "%s Joined team Cops!",name);
        SendClientMessageToAllCops(string);
        SendClientMessage(playerid, COLOR_SEXYGREEN, "|=========================|");
        SendClientMessage(playerid, COLOR_SEXYGREEN, "U have joined Team Cops!");
        SendClientMessage(playerid, COLOR_SEXYGREEN, "|=========================|");

        SetTimer("copwepstim", 300000, true);

        if(IsLevel[playerid] == 1)
            {
                SetPlayerHealth(playerid, 100);
                SetPlayerSkin(playerid,CopSkinsL1[random(sizeof(CopSkinsL1))]);

                GivePlayerWeapon(playerid, 23, 20); //slot 2
                GivePlayerWeapon(playerid, 41, 1000); //slot 9

                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your current level: 1 -Cop- (/l1 for more info)");
            }

        if(IsLevel[playerid] == 2)
            {
                SetPlayerHealth(playerid, 100);
                SetPlayerArmour(playerid, 50);
                SetPlayerSkin(playerid,CopSkinsL2[random(sizeof(CopSkinsL2))]);

                GivePlayerWeapon(playerid, 23, 40); //slot 2
                GivePlayerWeapon(playerid, 41, 2000); //slot 9
                GivePlayerWeapon(playerid, 29, 200); //slot 8

                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your current level: 2 -S.W.A.T.- (/l2 for more info)");
            }

        if(IsLevel[playerid] == 3)
            {
                SetPlayerHealth(playerid, 100);
                SetPlayerArmour(playerid, 100);
                SetPlayerSkin(playerid,CopSkinsL3[random(sizeof(CopSkinsL3))]);

                GivePlayerWeapon(playerid, 23, 80); //slot 2
                GivePlayerWeapon(playerid, 41, 4000); //slot 9
                GivePlayerWeapon(playerid, 29, 400); //slot 4
                GivePlayerWeapon(playerid, 30, 400); //slot 5
                GivePlayerWeapon(playerid, 34, 50); //slot 6
                GivePlayerWeapon(playerid, 26, 200); //slot 3

                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your current level: 3 -FBI- (/l3 for more info)");

            }
        }

//==============================================================================
//Driver Spawn
//==============================================================================

    if(pickupid == driverpickupspawn)
    {
        SetPlayerPos(playerid, 722.0700,-1276.4917,17.6484);
        gTeam[playerid] = TEAM_DRIVERS;
        SetPlayerColor(playerid,COLOR_SEXYGREEN);

        SetPlayerWantedLevel(playerid, 0);
        ResetPlayerWeapons(playerid);

        new name[MAX_PLAYER_NAME], string[44];
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "%s Joined team Drivers!",name);
        SendClientMessageToAllDrivers(string);
        SendClientMessage(playerid, COLOR_SEXYGREEN, "|=========================|");
        SendClientMessage(playerid, COLOR_SEXYGREEN, "U have joined Team Drivers!");
        SendClientMessage(playerid, COLOR_SEXYGREEN, "|=========================|");

        SetTimer("drivwepstim", 300000, true);

        if(IsLevel[playerid] == 1)
        {
                SetPlayerHealth(playerid, 100);
                GivePlayerWeapon(playerid, 22, 10); //slot 2
                SetPlayerSkin(playerid,DrivSkinsL1[random(sizeof(DrivSkinsL1))]);

                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your current level: 1 -Chauffeur- (/l1 for more info)");
        }

        if(IsLevel[playerid] == 2)
        {
                SetPlayerHealth(playerid, 100);
                SetPlayerArmour(playerid, 50);

                GivePlayerWeapon(playerid, 22, 20); //slot 2
                GivePlayerWeapon(playerid, 41, 20); //slot 9
                SetPlayerSkin(playerid,DrivSkinsL2[random(sizeof(DrivSkinsL2))]);

                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your current level: 2 -Moderate Driver- (/l2 for more info)");
        }

        if(IsLevel[playerid] == 3)
        {
                SetPlayerHealth(playerid, 100);
                SetPlayerArmour(playerid, 100);
                SetPlayerSkin(playerid,DrivSkinsL3[random(sizeof(DrivSkinsL3))]);

                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your current level: 3 -Security Chauffeur- (/l3 for more info)");

        }
    }

    if(iPickups[pickupid] != 0){
        new vehicleid = GetPlayerVehicleID(playerid);
        if(vehicleid != 0){
            new panels, doors, lights, tires;
            GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
            UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, 15);
        }
    }
Reply
#4

Debug your code:
pawn Код:
SetPlayerColor(playerid,COLOR_ORANGE); // orange
SendClientMessage(playerid, COLOR_ORANGE, "|=========================|");//Put this
Reply
#5

Maybe the colours arent correct?

Try this:

pawn Код:
#define COLOR_ROYALBLUE 0xADD8E6AA
#define COLOR_SEXYGREEN 0x00FF00FF
#define COLOR_ORANGE 0xF88017FF
#define COLOR_GREY0xAFAFAFAA
I don't if it will be same, But i guess that's the colors problem just try.
Reply
#6

Quote:
Originally Posted by varthshenon
Посмотреть сообщение
Debug your code:
pawn Код:
SetPlayerColor(playerid,COLOR_ORANGE); // orange
SendClientMessage(playerid, COLOR_ORANGE, "|=========================|");//Put this
Where do i put it?
Reply
#7

pawn Код:
if(pickupid == banditpickupspawn)
    {
        SetPlayerPos(playerid, 696.0515,-1444.0397,13.5391);

        gTeam[playerid] = TEAM_BANDIT;
        SetPlayerColor(playerid,COLOR_ORANGE); // orange
        SendClientMessage(playerid, COLOR_ORANGE, "|=========================|");//Put this
        new name[MAX_PLAYER_NAME], string[44];
In each team with their player color.
Reply
#8

Quote:
Originally Posted by varthshenon
Посмотреть сообщение
pawn Код:
if(pickupid == banditpickupspawn)
    {
        SetPlayerPos(playerid, 696.0515,-1444.0397,13.5391);

        gTeam[playerid] = TEAM_BANDIT;
        SetPlayerColor(playerid,COLOR_ORANGE); // orange
        SendClientMessage(playerid, COLOR_ORANGE, "|=========================|");//Put this
        new name[MAX_PLAYER_NAME], string[44];
In each team with their player color.
nope does not work, but the blue that u get on a driver spawn is not ROYALBLUE but is now just blue...
but still the colors changed for cops and drivers :/
Reply
#9

Ok, to test I changed the cop color , under setplayercolor to pink, and when I joined ingame the cop did not turn pink but green, wich means my defines are not the problem...
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)