Results 1 to 9 of 9
  1. #1
    Nordiii's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    150
    Reputation
    61
    Thanks
    733
    My Mood
    Angelic

    Converting a String( "10") into a Byte ("10")

    Hello,
    I want to convert a String like "1B 30 00" into a byte array and write this
    When i show at the address 01D08B3C (change weapon) as Byte array it looks like this :
    "1B 00 00 00 43 00 00 00 00 00 00"

    the 1B is the weapon (ACR 6.8 weapon id hex(27) = 1B the following two blocks of "00" shows which attachment this weapon have

    "1B 10 00 00 43 00 00 00 00 00 00" = ACR with ACOG
    "1B 30 00 00 43 00 00 00 00 00 00" = ACR with red dot

    "1B 10 10 00 43 00 00 00 00 00 00" = ACR with ACOG and Silencer

    and I want to edit this I write in a Textbox the code "1B 30 00"
    and he convert this to the bytes and write it to this address
    But I doesn't get it q.q

    I use @Jorndel 's class.
    May some on could give me a hint? Would be awsome !

    Sincerely Nordiii

  2. #2
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,113
    My Mood
    Angelic
    @ @Nordiii
    Code:
    Integer.Parse("A1", System.Globalization.NumberStyles.HexNumber)
    Suppose that's what you want.

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  3. The Following User Says Thank You to Jorndel For This Useful Post:

    Nordiii (01-09-2013)

  4. #3
    Nordiii's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    150
    Reputation
    61
    Thanks
    733
    My Mood
    Angelic
    Thank you so much <3
    Works perfekt!

  5. #4
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,113
    My Mood
    Angelic
    Quote Originally Posted by Nordiii View Post
    Thank you so much <3
    Works perfekt!
    When I think about it, you code VB so you can easy do:
    Dim MyHex As Integer = Hex("A1")

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  6. #5
    Nordiii's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    150
    Reputation
    61
    Thanks
    733
    My Mood
    Angelic
    Quote Originally Posted by Jorndel View Post


    When I think about it, you code VB so you can easy do:
    that this is the wrong type because you doesn't add &H

    it must look like this or not?
    Dim MyHex As Byte = "&H" + Hex("A1")

    Sry im not so good with VB

  7. #6
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,113
    My Mood
    Angelic
    Quote Originally Posted by Nordiii View Post
    that this is the wrong type because you doesn't add &H

    it must look like this or not?
    Dim MyHex As Byte = "&H" + Hex("A1")

    Sry im not so good with VB
    Why would you add: &H to a Hex Convert-function?
    So no.

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  8. #7
    Nordiii's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    150
    Reputation
    61
    Thanks
    733
    My Mood
    Angelic
    Quote Originally Posted by Jorndel View Post


    Why would you add: &H to a Hex Convert-function?
    So no.
    I tried to convert a String (hex) to an integer but that always throws me a error message because he doesn't know this is a Hex :/

    Wayne ! your code befor works perfekt
    Thank you again !

  9. #8
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,113
    My Mood
    Angelic
    Quote Originally Posted by Nordiii View Post
    I tried to convert a String (hex) to an integer but that always throws me a error message because he doesn't know this is a Hex :/

    Wayne ! your code befor works perfekt
    Thank you again !
    Oki then, suppose it's solved then?

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  10. #9
    Nordiii's Avatar
    Join Date
    Jan 2013
    Gender
    male
    Posts
    150
    Reputation
    61
    Thanks
    733
    My Mood
    Angelic
    Quote Originally Posted by Jorndel View Post


    Oki then, suppose it's solved then?
    Yes thread can get closed

Similar Threads

  1. Favorite Quote
    By EleMentX in forum Spammers Corner
    Replies: 13
    Last Post: 01-04-2020, 04:36 PM
  2. [Help Request] Converting a String containing a Memory Address to Integer
    By x2Sorcer in forum Call of Duty Modern Warfare 3 Coding, Programming & Source Code
    Replies: 19
    Last Post: 11-16-2012, 05:25 PM
  3. [Help] how do i convert a string to a float?
    By _corn_ in forum CrossFire Hack Coding / Programming / Source Code
    Replies: 3
    Last Post: 12-22-2011, 08:41 AM
  4. MPGH AIM Chat Quote Thread
    By ace76543 in forum Entertainment
    Replies: 30
    Last Post: 09-25-2011, 12:14 PM
  5. MPGH IRC Chat Quote Thread
    By i eat trees in forum Entertainment
    Replies: 746
    Last Post: 07-02-2011, 10:07 PM