View Single Post
Old 05-29-2013   #1
WaffleHouseTits
Registered User
 
Join Date: May 2013
Posts: 13
WaffleHouseTits is an unknown quantity at this point
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 is offline   Reply With Quote