SA-MP Forums Archive
StrToHex - 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: StrToHex (/showthread.php?tid=290947)



StrToHex - Zh3r0 - 17.10.2011

I've tried to search for it bug failed, I only found 2 threads that where telling to original poster to search for the keyword "StrToHex"

Anyone here got the function, if yes, pleased to share?

Thanks...


Re : StrToHex - Naruto_Emilio - 17.10.2011

pawn Код:
Description:
StrToHex function allow you to easily convert a string to its hex value.
Syntax:
hexstring = StrToHex(String)
Example:
<%
Response.Write StrToHex("Nice code")
'--- returns: 4E69636520636F6465
%>
ASP Source Code:
<%
Function StrToHex(ByRef Str)
    Dim Length
    Dim Max
    Dim strHex
    Max = Len(Str)
    For Length = 1 To Max
        strHex = strHex & Right("0" & Hex(Asc(Mid(Str, Length, 1))), 2)
    Next
    StrToHex = strHex
End function
%>
Your talking about this?


Re: StrToHex - ServerScripter - 17.10.2011

"StrToHex" what is it ? Variable/FS/... ?


Re: Re : StrToHex - Zh3r0 - 17.10.2011

Quote:
Originally Posted by Naruto_Emilio
Посмотреть сообщение
pawn Код:
Description:
StrToHex function allow you to easily convert a string to its hex value.
Syntax:
hexstring = StrToHex(String)
Example:
<%
Response.Write StrToHex("Nice code")
'--- returns: 4E69636520636F6465
%>
ASP Source Code:
<%
Function StrToHex(ByRef Str)
    Dim Length
    Dim Max
    Dim strHex
    Max = Len(Str)
    For Length = 1 To Max
        strHex = strHex & Right("0" & Hex(Asc(Mid(Str, Length, 1))), 2)
    Next
    StrToHex = strHex
End function
%>
Your talking about this?
Mostly for colors actually.. I found that on ****** too but have absolute no idea how to convert it to pawn.

But nevermind, got another way. Sorry for creating a uselesss topic.
(I needed it for 0Sprites Editor which will be released tomorrow)


Re : Re: Re : StrToHex - Naruto_Emilio - 17.10.2011

Quote:
Originally Posted by Zh3r0
Посмотреть сообщение
Mostly for colors actually.. I found that on ****** too but have absolute no idea how to convert it to pawn.

But nevermind, got another way. Sorry for creating a uselesss topic.
(I needed it for 0Sprites Editor which will be released tomorrow)
Alright, good luck .