SA-MP Forums Archive
[SOLVED] Save 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [SOLVED] Save colors? (/showthread.php?tid=120502)



[SOLVED] Save colors? - RyDeR` - 11.01.2010

Hello, I want to save colors so I use %d but for example for the violet color I have this 0x8000FFC9 after save I got this as output: -2147418167.. What can be the problem? I also used %x and %s these are even worser.


Re: Save colors? - Miguel - 11.01.2010

Quote:
Originally Posted by » RэРиR «
Hello, I want to save colors so I use %d but for example for the violet color I have this 0x8000FFC9 after save I got this as output: -2147418167.. What can be the problem? I also used %x and %s these are even worser.
%s should work... %d is only for integers and hex numbers contain letters and numers.


Re: Save colors? - RyDeR` - 11.01.2010

Quote:
Originally Posted by SAWC™
%s should work... %d is only for integers and hex numbers contain letters and numers.
Quote:
Originally Posted by » RэРиR «
I also used %x and %s these are even worser.
Edit: I tested it again and check the output lol:
Код:
 З.м\м



Re: Save colors? - dice7 - 11.01.2010

Hex numbers are integers. When applying the color, just use -2147418167


Re: Save colors? - RyDeR` - 11.01.2010

Quote:
Originally Posted by dice7
Hex numbers are integers. When applying the color, just use -2147418167
Oh! Will it work?


Re: Save colors? - GTAguillaume - 11.01.2010

https://sampwiki.blast.hk/wiki/Format
Quote:
Originally Posted by SAMP wiki
%x Inserts a number in hexadecimal notation.

EDIT: Or try: HexToInt(colorinhex); (returns an integer.)


Re: Save colors? - RyDeR` - 11.01.2010

Quote:
Originally Posted by GTAguillaume
https://sampwiki.blast.hk/wiki/Format
Quote:
Originally Posted by SAMP wiki
%x Inserts a number in hexadecimal notation.
Yeah I know. But It didn't work. It was completly something else..


Re: Save colors? - RyDeR` - 11.01.2010

It was already correct but It's my fault lol I didn't test it first in game.. Whatever thanx dice.