[Help] /Hide Command - For Coders/Developers only

Results 1 to 17 of 17
  1. #1
    Valued Member barak1991 is offline
    MemberRank
    Jun 2013 Join Date
    146Posts

    [Help] /Hide Command - For Coders/Developers only

    Hi

    so i create /hide command it work and GM become invisible, but when player make switch it can see the GM and it not invisible anymore.

    here is the code from CharProtocol.cpp:

    Code:
    void CCommandSystem::IsHide(LPOBJ lpObj, PMSG_CHATDATA *lpChat)    { 
    
           #ifdef GM_SYSTEM
             if(!g_GMConfig.CheckIsGM(lpObj->Name,2)) {
                GCServerMsgStringSend("Command only For GameMasters", lpObj->m_Index, 1);
            return;
            }
         #endif
                
            if(lpObj->Authority == 2) {
                MsgOutput(lpObj->m_Index,"[View] You'r in invisible MODE");
            } else {
                lpObj->Authority = 2;
                gObjViewportListProtocolDestroy(lpObj); 
                GCServerMsgStringSend("[View] You'r Invisible",lpObj->m_Index,1);
            }
        }



    what is wrong with code? or need to add something?
    Last edited by barak1991; 24-03-20 at 10:30 PM.


  2. #2
    Valued Member barak1991 is offline
    MemberRank
    Jun 2013 Join Date
    146Posts

    re: [Help] /Hide Command - For Coders/Developers only

    Bump.

  3. #3
    Valued Member barak1991 is offline
    MemberRank
    Jun 2013 Join Date
    146Posts

    re: [Help] /Hide Command - For Coders/Developers only

    Bump....

  4. #4
    Developer nevS is offline
    MemberRank
    Aug 2005 Join Date
    GermanyLocation
    534Posts

    re: [Help] /Hide Command - For Coders/Developers only

    I don’t have the source right now, but I think what gObjViewportListProtocolDestroy does: It sends a message to all surrounding players to remove it. New players coming into the range or entering the game will see this ‚hidden’ player again. You need to find a way to prevent sending it in the first place.

  5. #5
    Valued Member barak1991 is offline
    MemberRank
    Jun 2013 Join Date
    146Posts

    re: [Help] /Hide Command - For Coders/Developers only

    Quote Originally Posted by nevS View Post
    I don’t have the source right now, but I think what gObjViewportListProtocolDestroy does: It sends a message to all surrounding players to remove it. New players coming into the range or entering the game will see this ‚hidden’ player again. You need to find a way to prevent sending it in the first place.
    Ok then what should I do? Can u rewrite the code I attached? Or I can send u the src code
    Last edited by barak1991; 27-03-20 at 07:12 PM.

  6. #6
    0x4D696E68 myheart is offline
    MemberRank
    Jun 2017 Join Date
    356Posts

    re: [Help] /Hide Command - For Coders/Developers only

    Quote Originally Posted by barak1991 View Post
    Code:
            if(lpObj->Authority == 2) {
    
            } else {
                lpObj->Authority = 2;
            }
        }
    you must be check/add/del for effect 18 not Authority code

  7. #7
    Valued Member barak1991 is offline
    MemberRank
    Jun 2013 Join Date
    146Posts

    re: [Help] /Hide Command - For Coders/Developers only

    Quote Originally Posted by myheart View Post
    you must be check/add/del for effect 18 not Authority code
    As I said it works, but when player switch character and login he can see GM.
    What need to add to code?

    - - - Updated - - -
    @nevS?

  8. #8
    Valued Member barak1991 is offline
    MemberRank
    Jun 2013 Join Date
    146Posts

    Re: [Help] /Hide Command - For Coders/Developers only

    Bumpppp

  9. #9
    Valued Member barak1991 is offline
    MemberRank
    Jun 2013 Join Date
    146Posts

    Re: [Help] /Hide Command - For Coders/Developers only

    Bumppp

  10. #10
    Valued Member barak1991 is offline
    MemberRank
    Jun 2013 Join Date
    146Posts

    Re: [Help] /Hide Command - For Coders/Developers only

    Bump
    ....

  11. #11
    Valued Member barak1991 is offline
    MemberRank
    Jun 2013 Join Date
    146Posts

    Re: [Help] /Hide Command - For Coders/Developers only

    Bbumppp

    Help @Kiosani @nevS @myheart @Natzugen

  12. #12
    0x4D696E68 myheart is offline
    MemberRank
    Jun 2017 Join Date
    356Posts

    Re: [Help] /Hide Command - For Coders/Developers only

    Quote Originally Posted by barak1991 View Post
    Bbumppp

    Help @Kiosani @nevS @myheart @Natzugen
    i think have 2 ways to do that.
    but you did not even try my suggest at #6?

  13. #13
    Valued Member barak1991 is offline
    MemberRank
    Jun 2013 Join Date
    146Posts

    Re: [Help] /Hide Command - For Coders/Developers only

    Quote Originally Posted by myheart View Post
    i think have 2 ways to do that.
    but you did not even try my suggest at #6?
    How to add the effect? Can send code?

  14. #14
    0x4D696E68 myheart is offline
    MemberRank
    Jun 2017 Join Date
    356Posts

    Re: [Help] /Hide Command - For Coders/Developers only

    buff effect 18

  15. #15
    Valued Member barak1991 is offline
    MemberRank
    Jun 2013 Join Date
    146Posts

    Re: [Help] /Hide Command - For Coders/Developers only

    Quote Originally Posted by myheart View Post
    buff effect 18
    Can post code

    Edit:

    trying to set gObjApplyBuffEffectDuration function..




    Code:
        #ifdef GM_SYSTEM
             if(!g_GMConfig.CheckIsGM(lpObj->Name,2)) {
                GCServerMsgStringSend("Command only For GameMasters", lpObj->m_Index, 1);
            return;
            }
         #endif
            if(lpObj->Authority == 2) {
                MsgOutput(lpObj->m_Index,"[View] You're in Invisible MODE");
            } else {
                lpObj->Authority = 2;
                gObjViewportListProtocolDestroy(lpObj);
                gObjApplyBuffEffectDuration(lpObj, AT_INVISIBILITY, 0, 0, 0, 0, -10);
                GCServerMsgStringSend("[View] You're Invisible Now!",lpObj->m_Index,1);
            }
        }

    it ain't really work, any other suggestions?
    @nevS @myheart
    Last edited by barak1991; 03-04-20 at 10:55 PM.

  16. #16
    Valued Member barak1991 is offline
    MemberRank
    Jun 2013 Join Date
    146Posts

    Re: [Help] /Hide Command - For Coders/Developers only

    BUMPPP...
    Still need help with this

  17. #17
    Apprentice MrPsychoGod is offline
    MemberRank
    Jun 2019 Join Date
    7Posts

    Re: [Help] /Hide Command - For Coders/Developers only

    the best way would be to exclude GM from viewport



Advertisement