[c++ QUESTION]typedef and unitname menu

User Tag List

Results 1 to 8 of 8
  1. #1
    Holdlang's Avatar Member
    Reputation
    1
    Join Date
    Apr 2007
    Posts
    5
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [c++ QUESTION]typedef and unitname

    I'm trying to get access to UnitName with typedef.
    CastSpellById works fine but Unitname crash the wow. :/

    And yes it's 3.1.3.
    Im trying this way:
    Code:
    long ptrUnitName = 0x006A3650;
    
    typedef string (__cdecl * tUnitName)(string Unit);
    tUnitName oUnitName = 0;
    
    ....
    
    oUnitName = (tUnitName)ptrUnitName;
    string Return = oUnitName("player");
    Any idea what am i doing wrong?
    Ty.

    [c++ QUESTION]typedef and unitname
  2. #2
    berserk85's Avatar Member
    Reputation
    8
    Join Date
    Apr 2008
    Posts
    35
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hummm ...

    If you are using lua_UnitName keep in mind that the correct signature for it is
    typedef int (__cdecl * tUnitName)(luastate *L);
    where L is the pointer to the luastate and you must push in the the unitid string ...

    so one of the correct way to call it in pseudo code is

    L = GetLuaState();
    lua_pusstring(L,"unitid);
    oUnitName(L);
    if(gettype(L,1) == String)
    name = tostring(L,1);

    Different is if you are trying to call the Virtual ObjectName() ...
    Last edited by berserk85; 10-12-2009 at 08:06 AM.

  3. #3
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    MMOwned: Because actually debugging code* yourself is for losers.
    * The code you ripped and don't understand.

  4. #4
    flo8464's Avatar Active Member
    Reputation
    30
    Join Date
    Apr 2009
    Posts
    434
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I highly doubt anything in WoW returns standard C++-strings.

  5. #5
    Holdlang's Avatar Member
    Reputation
    1
    Join Date
    Apr 2007
    Posts
    5
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    berserk85: Thank you for your answer. I will try do that way. +Rep

    Cyhper: I'm trying to learn. And i asked because i don't understand. It's true.

  6. #6
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Holdlang View Post
    berserk85: Thank you for your answer. I will try do that way. +Rep

    Cyhper: I'm trying to learn. And i asked because i don't understand. It's true.
    Actually, if you really wanted to learn, you'd start at the beginning and learn the basics first like the rest of us had to.

    What you ACTUALLY want to do is scrape together enough to copypasta a quick bot/hack together.

    Stop being a lazy ****tard and learn the basics before you come here asking for "help" with something way out of your skill level.

  7. #7
    Holdlang's Avatar Member
    Reputation
    1
    Join Date
    Apr 2007
    Posts
    5
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i realised and i will do that.
    But i think you need to cool down a little...
    c++ is something i skipped in my life, but i'd like to do thinks in it now.
    peace

  8. #8
    luciferc's Avatar Contributor
    Reputation
    90
    Join Date
    Jul 2008
    Posts
    373
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    to do thinks *things*

Similar Threads

  1. [Question] Noggit and me
    By Demonshade in forum WoW ME Questions and Requests
    Replies: 4
    Last Post: 12-03-2007, 07:22 PM
  2. [Question] Upper And Lower Torso Issue
    By Xcynic in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 10-14-2007, 08:35 AM
  3. [Question] sound and changable hair
    By ovre in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 10-07-2007, 06:37 PM
  4. Question: TOS and Model Changing
    By Sergioz in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 07-22-2007, 05:25 PM
  5. [Question] Action and change of race ?
    By Werteur in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 06-06-2007, 06:20 AM
All times are GMT -5. The time now is 09:58 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search