Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    ppl2pass's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    804
    Reputation
    5
    Thanks
    111
    My Mood
    Amused

    [D3D] Draw Current Ammo?

    I have this error converting from a string to const char.

    Code:
    1>.\Base.cpp(150) : error C2664: 'cDirectx::DrawString' : cannot convert parameter 5 from 'string' to 'const char *'
    How could it be fixed.

  2. #2
    ^...,^'s Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    New Zealand,Auckland
    Posts
    699
    Reputation
    4
    Thanks
    89
    My Mood
    Lonely
    [QUOTE=ppl2pass;2342440]I have this error converting from a string to const char.

    Code:
    1>.\Base.cpp(150) : error C2664: 'cDirectx::DrawString' : cannot convert parameter 5 from 'string' to 'const char *'
    By the sounds of it
    it cannot convert parameter 5 from string to 'const char *'

    could i please have some sacuce (source) of the error of the line?

  3. #3
    J's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    East Coast
    Posts
    2,159
    Reputation
    379
    Thanks
    5,762
    My Mood
    In Love
    On the argument the error is on, put this before it:

    Code:
    (const char*)
    Keep me motivated for my hack development!

  4. The Following User Says Thank You to J For This Useful Post:

    ppl2pass (07-24-2010)

  5. #4
    ^...,^'s Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    New Zealand,Auckland
    Posts
    699
    Reputation
    4
    Thanks
    89
    My Mood
    Lonely
    Quote Originally Posted by Blood View Post
    On the argument the error is on, put this before it:

    Code:
    (const char*)
    blood yes i was going to put he hasnt posted an he migth ask agin how do i do that...

  6. The Following User Says Thank You to ^...,^ For This Useful Post:

    J (07-24-2010)

  7. #5
    zmansquared's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Location
    Kickin it at Microsoft
    Posts
    2,088
    Reputation
    36
    Thanks
    221
    My Mood
    Cheerful
    people. you can also use google. it is sometimes a BIG help
    Need Help With Coding or Something??? MSN me
    zmansquared@hotmail.com


    I am the one and only Microsoft Fag!!!

    Quote:
    Originally Posted by Arhk
    All games should be hacked, if we don't do it someone else will. Hackers force the progress, of better programming methods.
    ~


    Take this Pic everyone!



    next-

  8. #6
    ppl2pass's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    804
    Reputation
    5
    Thanks
    111
    My Mood
    Amused
    Thanks for the feedback but i have this error now:
    Code:
    1>.\Base.cpp(150) : error C2440: 'type cast' : cannot convert from 'std::string' to 'const char *'

  9. #7
    scimmyboy's Avatar
    Join Date
    Jan 2008
    Gender
    male
    Location
    http://mpgh.net MPGHCash: $442,596,199
    Posts
    5,649
    Reputation
    26
    Thanks
    894
    My Mood
    Happy
    ur not gonna get help if u only put the error, and not the code

  10. The Following User Says Thank You to scimmyboy For This Useful Post:

    zmansquared (07-24-2010)

  11. #8
    zmansquared's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Location
    Kickin it at Microsoft
    Posts
    2,088
    Reputation
    36
    Thanks
    221
    My Mood
    Cheerful
    agreed. could it have to do with his .h file for his base?
    Need Help With Coding or Something??? MSN me
    zmansquared@hotmail.com


    I am the one and only Microsoft Fag!!!

    Quote:
    Originally Posted by Arhk
    All games should be hacked, if we don't do it someone else will. Hackers force the progress, of better programming methods.
    ~


    Take this Pic everyone!



    next-

  12. #9
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,035
    Reputation
    340
    Thanks
    2,784
    My Mood
    Sad
    Quote Originally Posted by ppl2pass View Post
    Thanks for the feedback but i have this error now:
    Code:
    1>.\Base.cpp(150) : error C2440: 'type cast' : cannot convert from 'std::string' to 'const char *'
    No code = we have no idea what you're doing, thus no idea how to help you.

    Also, you shouldn't try to make hacks when you've got NO idea how to code in C++.

  13. The Following User Says Thank You to freedompeace For This Useful Post:

    Crash (07-25-2010)

  14. #10
    ppl2pass's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    804
    Reputation
    5
    Thanks
    111
    My Mood
    Amused
    @freedompeace
    im learning through reading codes

    here is the error
    Code:
    Directx.DrawString(10, 22, D3DCOLOR_XRGB(255, 255, 255), Directx.pFont, (const char*) stringify(ammo));

  15. #11
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,035
    Reputation
    340
    Thanks
    2,784
    My Mood
    Sad
    Quote Originally Posted by ppl2pass View Post
    @freedompeace
    im learning through reading codes

    here is the error
    Code:
    Directx.DrawString(10, 22, D3DCOLOR_XRGB(255, 255, 255), Directx.pFont, (const char*) stringify(ammo));
    Why do you have "stringify" there in the first place?



    a little hint. Good luck in learning! Though I suggest you try to learn coding normally first. It'll give you much better coding practices than some of these hack coders do.

  16. #12
    Crash's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    JAville
    Posts
    2,889
    Reputation
    163
    Thanks
    3,289
    My Mood
    Sleepy
    If you have a string you can do this.

    Code:
    std::string str1 = "I am going to be a const char*";
    str1.c_str();

  17. The Following User Says Thank You to Crash For This Useful Post:

    ppl2pass (07-25-2010)

  18. #13
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,193
    Reputation
    205
    Thanks
    1,438
    My Mood
    Mellow
    Quote Originally Posted by ppl2pass View Post
    @freedompeace
    im learning through reading codes

    here is the error
    Code:
    Directx.DrawString(10, 22, D3DCOLOR_XRGB(255, 255, 255), Directx.pFont, (const char*) stringify(ammo));
    std::string comes with some functions you know, it helps a lot to know the basics..

    [php]
    Directx.DrawString(10, 22, D3DCOLOR_XRGB(255, 255, 255), Directx.pFont, stringify(ammo).c_str());
    [/php]

    c_str - C++ Reference

    Edit: God, damnit, Seal... beat me... My bad..

  19. The Following User Says Thank You to Void For This Useful Post:

    ppl2pass (07-25-2010)

  20. #14
    Crash's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Location
    JAville
    Posts
    2,889
    Reputation
    163
    Thanks
    3,289
    My Mood
    Sleepy
    Quote Originally Posted by Void View Post
    std::string comes with some functions you know, it helps a lot to know the basics..

    [php]
    Directx.DrawString(10, 22, D3DCOLOR_XRGB(255, 255, 255), Directx.pFont, stringify(ammo).c_str());
    [/php]

    c_str - C++ Reference
    Beat ya to the punch.


    I had a terrible time with char*, const char*, and strings when I needed to convert between them to allow the typing in the custom PTC window.

  21. The Following User Says Thank You to Crash For This Useful Post:

    ppl2pass (07-25-2010)

  22. #15
    mmbob's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    ja
    Posts
    655
    Reputation
    70
    Thanks
    1,156
    My Mood
    Bitchy
    Quote Originally Posted by Sealionone View Post
    Beat ya to the punch.


    I had a terrible time with char*, const char*, and strings when I needed to convert between them to allow the typing in the custom PTC window.
    Why didnt you just use C strings (char*) all the way?

Page 1 of 2 12 LastLast

Similar Threads

  1. [Release] D3d Draw Triangle
    By flameswor10 in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 23
    Last Post: 01-14-2011, 06:04 PM
  2. [Release] [18.11.10] SiroSix's Public D3D V4.0 *Unl. Ammo, Chams, Gm warning, userfinder...*
    By Crackenide in forum WarRock - International Hacks
    Replies: 83
    Last Post: 11-29-2010, 03:00 PM
  3. [Release] [24.11.10] SiroSix's Public D3D V4.3 PlayerOPK|Unl. Ammo|ZombieOPK
    By Crackenide in forum WarRock - International Hacks
    Replies: 55
    Last Post: 11-27-2010, 01:53 PM
  4. Question About D3D Drawing Text
    By BlackHaexGuns in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 23
    Last Post: 07-21-2010, 10:51 PM
  5. Drawing Images into D3D apps?
    By ThePro in forum C++/C Programming
    Replies: 1
    Last Post: 09-03-2008, 12:13 AM