setting samp hex color
#1

Fixed...
Reply
#2

well hex codes loook like this in a string

Код HTML:
SendClientMessageToAll(COLOR_GREEN, {0000FF}Welcome to the server);//welcome will be a different color the rest will be green
Reply
#3

I mean for sa-mp hex colors, i am making dynamic faction so i wanna set a samp hex color in game but when i do for example
/setocol [orgid] 0xFF0000FF
On my mysql it shows
яя
Reply
#4

pawn Код:
if(sscanf(params,"ix",orgid,ohex)) return SendClientMessage(playerid,grey,"USAGE: /setocol [orgid] [SA-MP HEX]");
Reply
#5

That doesn't do it, is it problem with my mysql because for Hex i put Char
Reply
#6

I made a post today too, having problems with MySQL and the hex my self bro, its a pain in the arse.
Reply
#7

Liam aren't you from IvB?
Reply
#8

Quote:
Originally Posted by Tanush123
Посмотреть сообщение
That doesn't do it, is it problem with my mysql because for Hex i put Char
Do you mean that the column is defined as Char? Then yes.
Reply
#9

Quote:
Originally Posted by Tanush123
Посмотреть сообщение
Liam aren't you from IvB?
Cant be bro, I dont even know what IvP is :P
Reply
#10

Your best bet is to store it on the mysql database as a string then read it with hexstr

pawn Код:
stock hexstr(string[])
    {
        new
            ret,
            val,
            i;
        if (string[0] == '0' && string[1] | 0x20 == 'x') i = 2;
        while (string[i])
        {
            ret <<= 4;
            val = string[i++] - '0';
            if (val > 0x09) val -= 0x07;
            if (val > 0x0F) val -= 0x20;
            if (val < 0x01) continue;
            if (val < 0x10) ret += val;
        }
        return ret;
    }
Thank ****** for that from y_utils.inc

edit: coole210 got it didn't notice his post
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)