Problem with GetPlayerColor
#1

Hey i have a little problem i want to set the string Color to the Color from the Player but if i say SendClientMessage(playerid,GetPlayerColor(playerid ),string)

The String is Black i don't understand why.

Ps: Sorry for my English i can't speak or write well in english
Reply
#2

https://sampwiki.blast.hk/wiki/GetPlayerColor
Check the note. Have you used SetPlayerColor before using GetPlayerColor. If not, there is solution.
Reply
#3

I have this Code from the Wiki in my Script but it is black and no i dont Use SetPlayerColor

Here The Part of my Script where i need to set the string color

pawn Код:
if(ChatChannel[pID] == 1)
        {
            if(ChatChannel[pID] == ChatChannel[playerid])
            {
                new Float:Chat_RadiusX,Float:Chat_RadiusY,Float:Chat_RadiusZ;
                format(string,sizeof(string),"%s: {FFFFFF}%s",name,text);
                GetPlayerPos(pID,Chat_RadiusX,Chat_RadiusY,Chat_RadiusZ);
                if(IsPlayerInRangeOfPoint(pID,7.0,Chat_RadiusX,Chat_RadiusY,Chat_RadiusZ))
                {              
                    SendClientMessage(pID,GetPlayerColor(playerid),string);
                }          
            }
        }
Reply
#4

You need to set player colors OnPlayerConnect. If you want to set default colors check this tutorial: https://sampwiki.blast.hk/wiki/ColorFix
Reply
#5

Thanks it works ^^ didn't know that i need to set the Color First
Reply
#6

Or alternatively, you can always use SendPlayerMessageToAll.

https://sampwiki.blast.hk/wiki/SendPlayerMessageToAll
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)