{HELP} How do i fix this error? menu

User Tag List

Results 1 to 12 of 12
  1. #1
    insignia96's Avatar Banned
    Reputation
    33
    Join Date
    Oct 2008
    Posts
    304
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    {HELP} How do i fix this error?

    I have written this custom command, it is .uninvisible and i am trying to make it have this kind of syntax

    .uninvisible PLAYER
    It is a counter of the .invisible command.

    The code i have written is here:
    Code:
    bool ChatHandler::HandleUnInvisible(const char* args, WorldSession *m_session)
    {
        char msg[256];
        Player* pChar =m_session->GetPlayer(*args);
            
     snprintf(msg, 256, "Attempting to remove invisibility and invincibility from player...");
        if(pChar->m_isGmInvisible)
        {
            pChar->m_isGmInvisible = false;
            pChar->m_invisible = false;
            pChar->bInvincible = false;
            pChar->Social_TellFriendsOnline();
            snprintf(msg, 256, "Now UnInvisible", msg);
        } else {    
            snprintf(msg, 256, "That player is not GM Invisible.", msg);
        }
    
        snprintf(msg, 256, "UnInvisible Command was a success!", msg);
    
        GreenSystemMessage(m_session, (const char*)msg);
        return true;
    }
    The error is on the highlighted line. How do i fix it.


    the error is:

    Error C Some# Function WorldSession::GetPlayer has not 1 argument.

    any help on how to make this work? will +rep the person who helps.
    Last edited by insignia96; 01-01-2009 at 05:47 PM. Reason: Fixed Title

    {HELP} How do i fix this error?
  2. #2
    insignia96's Avatar Banned
    Reputation
    33
    Join Date
    Oct 2008
    Posts
    304
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    anyone help me out here?

  3. #3
    Clain's Avatar Banned
    Reputation
    179
    Join Date
    Jan 2008
    Posts
    1,396
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    GetPlayer doesn't have any arguements... so its just
    Code:
    Player* pChar = m_session->GetPlayer();
    Although I don't see why your doing this, the "invisible" command either makes you visible OR invisible specified by what state you are already in.

  4. #4
    insignia96's Avatar Banned
    Reputation
    33
    Join Date
    Oct 2008
    Posts
    304
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know the reason i am doing this is so when my friends and I are on the server i host they can't use .invisible against me, which they do alot.

    EDIT: Also will the command w/ no args still uninvisible the player i specify like if i say .uninvisible Theicekings will it Affect him?

  5. #5
    Clain's Avatar Banned
    Reputation
    179
    Join Date
    Jan 2008
    Posts
    1,396
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know anything about C++ or the framework of the chat commands sadly. Now I know what you want though... took a quick look through the command stuff. Try this though, no promises :P

    Code:
    bool ChatHandler::HandleUnInvisible(const char* args, WorldSession *m_session)
    {
        if(!*args) return false;
    
        char msg[256];
        Player *ptarget = objmgr.GetPlayer(args, false);
    	if(!ptarget) return false;
            
     snprintf(msg, 256, "Attempting to remove invisibility and invincibility from player...");
        if(ptarget->m_isGmInvisible)
        {
            ptarget->m_isGmInvisible = false;
            ptarget->m_invisible = false;
            ptarget->bInvincible = false;
            ptarget->Social_TellFriendsOnline();
            snprintf(msg, 256, "Now UnInvisible", msg);
        } else {    
            snprintf(msg, 256, "That player is not GM Invisible.", msg);
        }
    
        snprintf(msg, 256, "UnInvisible Command was a success!", msg);
    
        GreenSystemMessage(m_session, (const char*)msg);
        return true;
    }
    Last edited by Clain; 01-01-2009 at 07:30 PM.

  6. #6
    insignia96's Avatar Banned
    Reputation
    33
    Join Date
    Oct 2008
    Posts
    304
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It compiled but it does not do exactly what i want. It uninvisibles the target sucessfully but not like .uninvisible SOMEPLAYER because you cannot target someone who is invisible.

  7. #7
    insignia96's Avatar Banned
    Reputation
    33
    Join Date
    Oct 2008
    Posts
    304
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    +rep for effort though

  8. #8
    Clain's Avatar Banned
    Reputation
    179
    Join Date
    Jan 2008
    Posts
    1,396
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Took another look at it... try my post above(updated)

  9. #9
    insignia96's Avatar Banned
    Reputation
    33
    Join Date
    Oct 2008
    Posts
    304
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Clain, will try tomorrow. Have to head 2 bed atm

  10. #10
    insignia96's Avatar Banned
    Reputation
    33
    Join Date
    Oct 2008
    Posts
    304
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Works perfectly Clain Thanks a bunch!

  11. #11
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    4 reputation points go to Clain for helping this guy

  12. #12
    insignia96's Avatar Banned
    Reputation
    33
    Join Date
    Oct 2008
    Posts
    304
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for giving all the rep he should get (i wished i couldve given more)

Similar Threads

  1. [Trinity] Trinity error, how can I fix this?
    By Turtleking in forum WoW EMU Questions & Requests
    Replies: 0
    Last Post: 12-21-2013, 11:55 PM
  2. (How do i fix this error)? HELP!?!
    By Darksid in forum WoW EMU Questions & Requests
    Replies: 6
    Last Post: 01-02-2009, 05:45 PM
  3. [Help] How do I fix this error in logon?
    By MisterEMU in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 05-09-2008, 09:38 PM
  4. how i gonna fix this?
    By lau281 in forum World of Warcraft General
    Replies: 2
    Last Post: 11-30-2007, 03:25 PM
  5. How would I fix this?
    By Tageran in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 09-20-2007, 03:45 PM
All times are GMT -5. The time now is 12:57 PM. 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