SA-MP Forums Archive
How would I do it? - 0.3c QUESTION - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How would I do it? - 0.3c QUESTION (/showthread.php?tid=200511)



How would I do it? - 0.3c QUESTION - blackwave - 18.12.2010

Well, most of you know the color format are different from the hex decimal.

on www.colorpicker.com


The red is that: FF0000 || On my samp color picker, the red is that: 0xFF0006FF


How would I do for use:

pawn Код:
SetPlayerColor(playerid, {FF0000});
?


Since I want to do a color selection dialog menu, and doesn't works with hexadecimal, and had to set player's color with the same one of the dialog. If anyone knows, please..


Re: How would I do it? - 0.3c QUESTION - Benjo - 18.12.2010

This would be better suited in the 0.3c scripting section ^_^

I know what you means though. Atm I am just using two sets of color defines; my old ones and the new color-embed ones. So this means I have for example COLOR_RED and COLORE_RED. It doesn't feel like much of an elegant solution, but it works for now!

I'm hoping some clever clogs will come along and post a better way of doing it


Re: How would I do it? - 0.3c QUESTION - blackwave - 18.12.2010

Quote:
Originally Posted by Benjo
Посмотреть сообщение
This would be better suited in the 0.3c scripting section ^_^

I know what you means though. Atm I am just using two sets of color defines; my old ones and the new color-embed ones. So this means I have for example COLOR_RED and COLORE_RED. It doesn't feel like much of an elegant solution, but it works for now!

I'm hoping some clever clogs will come along and post a better way of doing it
e_e. I tried by other way. You get the color like this: B7FF00

And I tried putting the "0x" on before this hex. So: 0xB7FF00

Didn't work. Didn't get same color =x.
Think won't be possible to convert "B7FF00" for hexdecimal


Respuesta: How would I do it? - 0.3c QUESTION - JM - 18.12.2010

Isnt B7FF00 = 0xB7FF00FF ?

You forgot to add the transparency at the end.


Re: Respuesta: How would I do it? - 0.3c QUESTION - blackwave - 18.12.2010

Quote:
Originally Posted by JM
Посмотреть сообщение
Isnt B7FF00 = 0xB7FF00FF ?

You forgot to add the transparency at the end.
Nope =S. I think colors from http://www.colorpicker.com/

Are different from the hexadecimal. Thought these colors might be used anywhere else except formatted messages


Re: How would I do it? - 0.3c QUESTION - blackwave - 18.12.2010

I'll make another example:
> color which will be used now: RED | From: colorpicker.com <

pawn Код:
SendClientMessage(playerid, FF0000, "text: 1234");
Result:
Код:
 C:\Documents and Settings\F e L i P e\Desktop\0.3c - RC5\filterscripts\adminx.pwn(570) : error 017: undefined symbol "FF0000"
Another test:
> color which be used: RED | From: SA-MP color picker
pawn Код:
SendClientMessage(playerid, 0xFF0000FF, "lol");
Result:
Код:
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
That's the insue: I can't use colors from colorpicker.com for send normal messages. Just for formatted messages, but not for
pawn Код:
SendClientMessage(playerid,COLOR_HERE,"MESSAGE);



Re: How would I do it? - 0.3c QUESTION - Mean - 18.12.2010

Quote:
Originally Posted by Hoborific
Посмотреть сообщение
oh, do it as such


pawn Код:
command(shithere)
{if(someshit)
{
SendClientMessage(playerid,RED,"THIS IS RED {HEX}This is another colour {HEX} This is yet another colour!");
}
return 1;
}
Kinda loled at if(someshit)
but, yeah, you should use a color you don't want ATM, and then in message, you just embedd it, and maybe, thoose colors aren't the same.