[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?
re: [Help] /Hide Command - For Coders/Developers only
re: [Help] /Hide Command - For Coders/Developers only
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.
re: [Help] /Hide Command - For Coders/Developers only
Quote:
Originally Posted by
nevS
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
re: [Help] /Hide Command - For Coders/Developers only
Quote:
Originally Posted by
barak1991
Code:
if(lpObj->Authority == 2) {
} else {
lpObj->Authority = 2;
}
}
you must be check/add/del for effect 18 not Authority code
re: [Help] /Hide Command - For Coders/Developers only
Quote:
Originally Posted by
myheart
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?
Re: [Help] /Hide Command - For Coders/Developers only
Re: [Help] /Hide Command - For Coders/Developers only
Re: [Help] /Hide Command - For Coders/Developers only
Re: [Help] /Hide Command - For Coders/Developers only
Re: [Help] /Hide Command - For Coders/Developers only
Quote:
Originally Posted by
barak1991
i think have 2 ways to do that.
but you did not even try my suggest at #6?
Re: [Help] /Hide Command - For Coders/Developers only
Quote:
Originally Posted by
myheart
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?
Re: [Help] /Hide Command - For Coders/Developers only
Re: [Help] /Hide Command - For Coders/Developers only
Quote:
Originally Posted by
myheart
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
Re: [Help] /Hide Command - For Coders/Developers only
BUMPPP...
Still need help with this
Re: [Help] /Hide Command - For Coders/Developers only
the best way would be to exclude GM from viewport