Black Chat Text Help?
#1

All chat is fine except my /n command I decided to try add in to my gamemode. It's all black which is strange because the hex code isn't black. I've tested with other colors and come to the conclusion that somewhere my coding is wrong. Someone mind pointing out my error? Heres my code below, thanks in advance
Code:
CMD:n(playerid, params[])
{
    new tmpstring[164], name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
    if(sscanf(params, "s[128]", tmpstring))
    {
    	SendClientMessage(playerid, LIME, "ERROR: Usage /n [message]");
        return 1;
    }
    else
    {
        format(tmpstring, sizeof(tmpstring), "(NEWBIE) %s: %s ", name, tmpstring);
        SendClientMessageToAll(GetPlayerColor(playerid), tmpstring);
    }
    return 1;
}
Reply
#2

Try using something else then GetPlayerColor();
Reply
#3

Quote:
Originally Posted by JhnzRep
View Post
Try using something else then GetPlayerColor();
Mind helping me out? :P
EDIT: Meaning, showing me how. So I can learn!
Reply
#4

like for white

pawn Code:
SendClientMessageToAll(0xFFFFFF, tmpstring);
Reply
#5

Quote:
Originally Posted by Jonny5
View Post
like for white

pawn Code:
SendClientMessageToAll(0xFFFFFF, tmpstring);
Ohhh thanks, I'm still new to this but I'm starting to get it!
Rep +1
Reply
#6

not sure if relevant here, but i remember i read a comment in fixes.inc stating that GetPlayerColor() always returns "0" if SetPlayerColor() is never used.

link to the thread -> https://sampforum.blast.hk/showthread.php?tid=278090
Reply
#7

pawn Code:
#define NEWBIE_COLOR        0x7DAEFFFF
#define TCOLOR_WHITE        0xFFFFFF00
#define COLOR_GRAD1         0xB4B5B7FF
#define COLOR_GRAD2         0xBFC0C2FF
#define COLOR_GRAD3         0xCBCCCEFF
#define COLOR_GRAD4         0xD8D8D8FF
#define COLOR_GRAD5         0xE3E3E3FF
#define COLOR_GRAD6         0xF0F0F0FF
#define COLOR_FADE1         0xE6E6E6E6
#define COLOR_FADE2         0xC8C8C8C8
#define COLOR_FADE3         0xAAAAAAAA
#define COLOR_FADE4         0x8C8C8C8C
#define COLOR_FADE5         0x6E6E6E6E
#define COLOR_PURPLE        0xC2A2DAAA
#define COLOR_RED           0xAA3333AA
#define COLOR_GREY          0xAFAFAFAA
#define COLOR_GREEN         0x33AA33AA
#define COLOR_BLACK         0x000001FF
#define COLOR_BLUE          0x007BD0FF
#define COLOR_LIGHTORANGE   0xFFA100FF
#define COLOR_FLASH         0xFF000080
#define COLOR_LIGHTRED      0xFF6347AA
#define COLOR_LIGHTBLUE     0x01FCFFC8
#define COLOR_LIGHTGREEN    0x9ACD32AA
#define COLOR_YELLOW        0xFFFF00AA
#define COLOR_LIGHTYELLOW   0xFFFF91FF
#define COLOR_YELLOW2       0xF5DEB3AA
#define COLOR_WHITE         0xFFFFFFAA
Few usefull defines for colors, so you don't always have to put the hex in, just for example "COLOR_LIGHTYELLOW".
Reply
#8

Yea, I need help with this too.. I've alot of #define colors, and I have GetPlayerColor, so that their namecolor is going to the chattext too. But when they log on to the server, their text is black, but i would like it to randomize the colours i have, and add a random color to each player or something. How can I do this?
Reply
#9

Quote:
Originally Posted by [Diablo]
View Post
not sure if relevant here, but i remember i read a comment in fixes.inc stating that GetPlayerColor() always returns "0" if SetPlayerColor() is never used.

link to the thread -> https://sampforum.blast.hk/showthread.php?tid=278090
You're correct.

@Kudoz
- If you want random colors, use this which is included to fixes.inc
pawn Code:
// By KoczkaHUN

// --

// Global Variable
new _colorfixPlayerColors[100] = {
0xFF8C13FF,0xC715FFFF,0x20B2AAFF,0xDC143CFF,0x6495EDFF,0xf0e68cFF,0x778899FF,0xFF1493FF,0xF4A460FF,
0xEE82EEFF,0xFFD720FF,0x8b4513FF,0x4949A0FF,0x148b8bFF,0x14ff7fFF,0x556b2fFF,0x0FD9FAFF,0x10DC29FF,
0x534081FF,0x0495CDFF,0xEF6CE8FF,0xBD34DAFF,0x247C1BFF,0x0C8E5DFF,0x635B03FF,0xCB7ED3FF,0x65ADEBFF,
0x5C1ACCFF,0xF2F853FF,0x11F891FF,0x7B39AAFF,0x53EB10FF,0x54137DFF,0x275222FF,0xF09F5BFF,0x3D0A4FFF,
0x22F767FF,0xD63034FF,0x9A6980FF,0xDFB935FF,0x3793FAFF,0x90239DFF,0xE9AB2FFF,0xAF2FF3FF,0x057F94FF,
0xB98519FF,0x388EEAFF,0x028151FF,0xA55043FF,0x0DE018FF,0x93AB1CFF,0x95BAF0FF,0x369976FF,0x18F71FFF,
0x4B8987FF,0x491B9EFF,0x829DC7FF,0xBCE635FF,0xCEA6DFFF,0x20D4ADFF,0x2D74FDFF,0x3C1C0DFF,0x12D6D4FF,
0x48C000FF,0x2A51E2FF,0xE3AC12FF,0xFC42A8FF,0x2FC827FF,0x1A30BFFF,0xB740C2FF,0x42ACF5FF,0x2FD9DEFF,
0xFAFB71FF,0x05D1CDFF,0xC471BDFF,0x94436EFF,0xC1F7ECFF,0xCE79EEFF,0xBD1EF2FF,0x93B7E4FF,0x3214AAFF,
0x184D3BFF,0xAE4B99FF,0x7E49D7FF,0x4C436EFF,0xFA24CCFF,0xCE76BEFF,0xA04E0AFF,0x9F945CFF,0xDCDE3DFF,
0x10C9C5FF,0x70524DFF,0x0BE472FF,0x8A2CD7FF,0x6152C2FF,0xCF72A9FF,0xE59338FF,0xEEDC2DFF,0xD8C762FF,
0xD8C762FF
};

public OnPlayerConnect(playerid)
{
    SetPlayerColor(playerid, _colorfixPlayerColors[ (playerid % 100) ]);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)