SA-MP Forums Archive
Help Chat colors - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help Chat colors (/showthread.php?tid=608500)



Help Chat colors - TheThirdNeo - 02.06.2016

Hello guys I need someone to help me
I want to script something..
when someone from a group and when he talk in main chat his name would be colored as his badge color g_hDutyColour can someone help me?


Re: Help Chat colors - Crayder - 02.06.2016

Well, by default the chat is like this:
(name in player's color, settable with SetPlayerColor): (what the player typed)

So technically all you need to do is set the players color to the badge color. However, you may have the player's color set to something you want separate.

If g_hDutyColour is in RGB format, you can simply send it like this in OnPlayerText:
pawn Код:
OnPlayerText(playerid, text[]) {
    SendClientMessageToAll(g_hDutyColour[playerid], text);
    return 0; // so the default message isn't sent
}
If it's in RGBA format, you need to right shift the color (which I will not go into depth with here).
pawn Код:
OnPlayerText(playerid, text[]) {
    SendClientMessageToAll(g_hDutyColour[playerid] >> 8, text);
    return 0; // so the default message isn't sent
}



Re: Help Chat colors - TheThirdNeo - 02.06.2016

Okay thank you I will test it and I will tell you please keep checking on the post ^_^


Re: Help Chat colors - Crayder - 02.06.2016

That was just example code, you have to know how to implement it.


Re: Help Chat colors - Micko123 - 02.06.2016

You know what is problem with almost everyone @Crayder. If you give them exaple of code, they say "Okay i will go test it now", and because they didn't learned pawno properly they will come again saying "Damn idiot that didn't worked. Don't help me anymore". I just don't know...


Re: Help Chat colors - Crayder - 02.06.2016

I'd call it laziness. Getting someone else to do the work you could be doing with just a little effort. And trust me, PAWN doesn't take much effort to learn the base of.


Re: Help Chat colors - Micko123 - 02.06.2016

They are going like "Okay lets start learning PAWN. First thing i will go to forum and ask them to make me commands, But one at time so they don't suspect anything. Okay half of job done. Now I will put my name as scripter and put GM online. YEA!!". But on first problem they will be f***** up


Re: Help Chat colors - iKevin - 02.06.2016

PAWN isnt really a language, its a broken down version of C.


Re: Help Chat colors - Crayder - 02.06.2016

Quote:
Originally Posted by KevinExec
Посмотреть сообщение
PAWN isnt really a language, its a broken down version of C.
Not to go off topic but...

Bullshit it's not a language! What makes you think it's not a language? And no it's not a "broken down version of C". It's similar to C-like languages because it was built to be.

I seriously want you to explain to all of us how PAWN is not a language.


Re: Help Chat colors - Micko123 - 02.06.2016

You said that pawn is broken version of C. You realise that most languages are written in C and by following your example only C is language