Converting a string into an hex.
#1

Hi.
So, I'll explain here.
I made a gamemode where I save the gang zones in a SQL table called 'gangzones' where i put the gang zone color in another field called 'color'. So I just take it with "mysql_fetch_field_row", but then I have the string and not the hexadecimal number, so I can't compile my .pwn because the compiler says there's an error..
How can I convert a string into an hexadecimal number?
PS: my field "color" is already defined as 0xAABBCCFF, for example.. so there's already "0x".
Reply
#2

A hex value is just a integer so instead of saving it as a string save it as an integer you could also use sscanf() with the h specifier.
Reply
#3

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
A hex value is just a integer so instead of saving it as a string save it as an integer you could also use sscanf() with the h specifier.
I tried with an integer but it doesn't work, it doesn't show any gang zone..
How can I do with the sscanf?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)