GTAGaming Forums

GTAGaming Forums (http://www.gtagaming.com/forums/index.php)
-   Grand Theft Auto IV Mods (http://www.gtagaming.com/forums/forumdisplay.php?f=318)
-   -   Scripthook C++ Custom Blip Colours (http://www.gtagaming.com/forums/showthread.php?t=141489)

WaffleHouseTits 05-29-2013 01:48 AM

Scripthook C++ Custom Blip Colours
 
I have been beating my head against the wall with this one for hours now, perhaps I am just fried. If someone could enlighten me, I would be most grateful.

I am trying to determine the network players assigned colour (seems like ID 0 is ALWAYS orange), and assign a custom blip to that player. I can get blips just fine, however, not the proper colour. The orange player ends up pink or something. Anyways, I figure you'll want a code sample so here is my function.

Code:

void SpeedoThread::AddBlipsToPlayers(Scripting::Ped &ped, b8 ForAll)
{
        Blip plyr;
        ColourIndex poo;

        u32 netplayerindex;
        Ped loopped;

        if (ForAll) {
                for (u32 n=0; n<=31; n++) {       
                        netplayerindex = ConvertIntToPlayerIndex(n);
                        if ((strcmp(GetPlayerName(netplayerindex ), InvalidName)) && (!HasNetworkPlayerLeftGame(netplayerindex))
                                && IsPlayerPlaying(netplayerindex) && IsNetworkPlayerActive(netplayerindex) && netplayerindex != GetPlayer()) {       
                               
                                GetPlayerChar(netplayerindex , &loopped);
                                SetBlipAsFriendly(plyr, true);
                                ChangeBlipNameFromAscii(plyr, GetPlayerName(netplayerindex));
                                ChangeBlipScale(plyr, .6);

                                //ChangeBlipColour(plyr, n);
                                ChangeBlipColour(plyr, GetPlayerColour(netplayerindex));

                                AddBlipForChar(loopped, &plyr);

                        }       
                }
        } else {
                GetBlipInfoIdPedIndex(plyr);
                AddBlipForChar(ped, &plyr);
        }
}


WaffleHouseTits 06-01-2013 02:26 AM

Solved


All times are GMT -6. The time now is 05:58 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.