[Help]ParsingCommand

09/27/2016 17:55 banktakung#1
ParsingCommand( string.LockBuffer(), what is this parameter );


is it player id or what cause i try player id but it not work.
09/27/2016 18:26 Avalion#2
Code:
int ParsingCommand( LPCTSTR lpszString, CMover* pMover, BOOL bItem )
it is CMover*
09/28/2016 01:25 banktakung#3
Quote:
Originally Posted by Avalion View Post
Code:
int ParsingCommand( LPCTSTR lpszString, CMover* pMover, BOOL bItem )
it is CMover*
is it just empty class or what ?
09/28/2016 09:56 ディオニュソス#4
No, it's an actual pointer to an instance of the CMover class.
09/28/2016 15:12 banktakung#5
Need help about CMover sir. i don't know what should i do with this CMover.
09/28/2016 16:15 Nortix#6
What do you want to do in first place?
09/29/2016 16:13 banktakung#7
Quote:
Originally Posted by Nortix View Post
What do you want to do in first place?

in Ondie() function i want a player auto command when monster die.

:handsdown::handsdown:


in Dpsrv.cpp it no problem to use ParsingCommand.
09/29/2016 16:38 ディオニュソス#8
Quote:
Originally Posted by banktakung View Post
in Ondie() function i want a player auto command when monster die.

:handsdown::handsdown:


in Dpsrv.cpp it no problem to use ParsingCommand.
I don't see a reason why one wanted to do this, but here you go.

In CAttackArbiter::OnDied(), add
Code:
if(m_pAttacker->IsPlayer() && !m_pDefender->IsPlayer())
{
    ParsingCommand("/yourRandomCommand", m_pAttacker);
}
09/29/2016 17:11 banktakung#9
Quote:
Originally Posted by ディオニュソス View Post
I don't see a reason why one wanted to do this, but here you go.

In CAttackArbiter::OnDied(), add
Code:
if(m_pAttacker->IsPlayer() && !m_pDefender->IsPlayer())
{
    ParsingCommand("/yourRandomCommand", m_pAttacker);
}
Thank you. you know how all party member use command ?

here is my code
PHP Code:
    CPartypParty g_PartyMng.GetPartym_pAttacker->GetPartyId() );
    if( 
pParty )
    {
        for( 
int i 1pParty->GetSizeofMember(); i++)
        {
            if( 
m_pDefender->GetProp()->dwID == monsterid )
            {
                
CUserpMember    g_UserMng.GetUserByPlayerIDpParty->m_aMember[i].m_uPlayerId );
                
//CUser* pParty r = g_UserMng.GetUserByPlayerID( pParty->m_aMember[i].m_uPlayerId );
                
                
ParsingCommand"/ci 21", (CMover*)pMember );
                return;
            }
        }
    } 
but the command is not run. or if i take out return. server will crash.
09/29/2016 17:21 ディオニュソス#10
Quote:
Originally Posted by banktakung View Post
Thank you. you know how all party member use command ?

here is my code
PHP Code:
    CPartypParty g_PartyMng.GetPartym_pAttacker->GetPartyId() );
    if( 
pParty )
    {
        for( 
int i 1pParty->GetSizeofMember(); i++)
        {
            if( 
m_pDefender->GetProp()->dwID == monsterid )
            {
                
CUserpMember    g_UserMng.GetUserByPlayerIDpParty->m_aMember[i].m_uPlayerId );
                
//CUser* pParty r = g_UserMng.GetUserByPlayerID( pParty->m_aMember[i].m_uPlayerId );
                
                
ParsingCommand"/ci 21", (CMover*)pMember );
                return;
            }
        }
    } 
but the command is not run. or if i take out return. server will crash.
1. Sanitize what you get from GetUserByPlayerID
2. Pass TRUE as the third argument if you want to skip the authorization in ParsingCommand
09/29/2016 17:40 banktakung#11
Quote:
Originally Posted by ディオニュソス View Post
1. Sanitize what you get from GetUserByPlayerID
2. Pass TRUE as the third argument if you want to skip the authorization in ParsingCommand

do you have example for Sanitize for GetUserByPlayerID sir ??
09/29/2016 17:46 ディオニュソス#12
Quote:
Originally Posted by banktakung View Post
do you have example for Sanitize for GetUserByPlayerID sir ??
if(IsValidObj(pMember))

You REALLY should learn basic programming before working with any source code
09/29/2016 18:37 banktakung#13
Quote:
Originally Posted by ディオニュソス View Post
if(IsValidObj(pMember))

You REALLY should learn basic programming before working with any source code
sorry i fixed. may be command that call app_ is not work.