SA-MP Forums Archive
RGBA(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: RGBA(HEX) Color (/showthread.php?tid=641382)



RGBA(HEX) Color - Kraeror - 15.09.2017

Hello, I have a question! I'm using dini saving system and I want to save RGBA(HEX) colors how I can save it and load it? I tried to save it as string, but SetPlayerColor doesn't working!
Please help, +1 REP!

Thanks!


Re: RGBA(HEX) Color - GoldenLion - 15.09.2017

You could save it as an integer, but I believe it's also possible to save it as a string and then use sscanf and the "x" specifier when you load it.


Re: RGBA(HEX) Color - Kraeror - 15.09.2017

I'm not using sscanf!!! I'm using only dini!
+ If I make it as an integer, it saves as 0!


Re: RGBA(HEX) Color - Kraeror - 15.09.2017

Can I load it without using sscanf?


Re: RGBA(HEX) Color - Meller - 15.09.2017

What's the big deal? Everything DINI does is in strings, but you don't know what basic code tells you, so you don't know that right...

Download SSCANF R2, use it for defining a string for a hex using X or H in the format.


Re: RGBA(HEX) Color - OneDay - 15.09.2017

Quote:
Originally Posted by Kraeror
Посмотреть сообщение
I'm not using sscanf!!! I'm using only dini!
+ If I make it as an integer, it saves as 0!
use both


Re: RGBA(HEX) Color - Gammix - 15.09.2017

Hex is integer.

Just save the hex code using dini_IntSet. And then you'll get it back as a integer using dini_Int.


Re: RGBA(HEX) Color - Kraeror - 15.09.2017

When I save it as integer, it saves to 0!

Can you give me code for loading the color using Ysi_ini or Dini?