Question: Hex to Embed -
Sniper Kitty - 19.09.2012
Is there a function out there that turns:
0xFF0000FF
to
"{FF0000}"
?
You know:
new string[100];
SendClientMessage(playerid, -1, (format(string, 100, "%sHello World!",
HexToEmbed(0xFF0000FF)), string));
Or something similar.
If you could also include the inverse, that'd be great!
Re: Question: Hex to Embed -
YourLord - 19.09.2012
about the hextoembed i don't know if it exist, the other, i guess it's this what you want.
http://forum.sa-mp.com/showpost.php?...&postcount=149
Re: Question: Hex to Embed -
Sniper Kitty - 19.09.2012
No, I have something better.
pawn Код:
#define MaxStringSize 1024
new formatString[MaxStringSize];
#define Format(%0) (format(formatString, MaxStringSize, %0), formatString) // Thanks to KoczkaHUN for the idea from sprintf [PHP].
#define SendMessageToPlayer(%0,%1) SendClientMessage((%0), -1, (Format(%1)))
I want a function that converts HEX to string.
But thanks.
Re: Question: Hex to Embed -
YourLord - 19.09.2012
i really recommend you get low with this string, only if you're working with big ones.
Re: Question: Hex to Embed -
Sniper Kitty - 19.09.2012
But those macros aren't the problem nor the solution.
I want a function that converts HEX to string.
Re: Question: Hex to Embed -
XtremeR - 19.09.2012
well here you go the link download it and then you can convert Hex to String
http://www.mediafire.com/?67c2gsj98g7hqoc
+rep if that helps
Re: Question: Hex to Embed -
Sniper Kitty - 19.09.2012
...
A function... that converts... HEX to string...
=/ A function, a function, THAT CONVERTS, Hex to string, Hex to string, HEX TO FREAKIN STRING.
Sorry for nerd rage, but how hard is it to understand.
Re: Question: Hex to Embed -
XtremeR - 19.09.2012
oh sorry here you go you can convert it online
http://www.string-functions.com/hex-string.aspx
Re: Question: Hex to Embed -
Sniper Kitty - 19.09.2012
I give up, just nevermind it.
Re: Question: Hex to Embed - Emmet_ - 19.09.2012
Same thing you asked for:
pawn Код:
#define HexToEmbed(%0) HexToEmbed_Final(#%0)
stock HexToEmbed_Final(szHex[])
{
new
szVal[16];
format(szVal, sizeof(szVal), "{%s}", szHex);
strdel(szVal, 1, 3);
strdel(szVal, strlen(szVal) - 3, strlen(szVal) - 1);
return szVal;
}
// Example: printf("%s", HexToEmbed(0xFFFF00FF));
// Output: {FFFF00}