setting samp hex color - 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: setting samp hex color (
/showthread.php?tid=307808)
setting samp hex color -
Tanush123 - 01.01.2012
Fixed...
Re: setting samp hex color -
fangoth1 - 01.01.2012
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
Re: setting samp hex color -
Tanush123 - 01.01.2012
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
яя
Re: setting samp hex color -
THE_KNOWN - 01.01.2012
pawn Код:
if(sscanf(params,"ix",orgid,ohex)) return SendClientMessage(playerid,grey,"USAGE: /setocol [orgid] [SA-MP HEX]");
Re: setting samp hex color -
Tanush123 - 01.01.2012
That doesn't do it, is it problem with my mysql because for Hex i put Char
Re: setting samp hex color -
LiamM - 01.01.2012
I made a post today too, having problems with MySQL and the hex my self bro, its a pain in the arse.
Re: setting samp hex color -
Tanush123 - 01.01.2012
Liam aren't you from IvB?
Re: setting samp hex color -
Dark_Kostas - 02.01.2012
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.
Re: setting samp hex color -
LiamM - 02.01.2012
Quote:
Originally Posted by Tanush123
Liam aren't you from IvB?
|
Cant be bro, I dont even know what IvP is :P
Re: setting samp hex color -
AKA_Cross - 04.01.2012
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