ParsingCommand( string.LockBuffer(), what is this parameter );
is it player id or what cause i try player id but it not work.
is it player id or what cause i try player id but it not work.
int ParsingCommand( LPCTSTR lpszString, CMover* pMover, BOOL bItem )
I don't see a reason why one wanted to do this, but here you go.Quote:
in Ondie() function i want a player auto command when monster die.
:handsdown::handsdown:
in Dpsrv.cpp it no problem to use ParsingCommand.
if(m_pAttacker->IsPlayer() && !m_pDefender->IsPlayer())
{
ParsingCommand("/yourRandomCommand", m_pAttacker);
}
Thank you. you know how all party member use command ?Quote:
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); }
CParty* pParty = g_PartyMng.GetParty( m_pAttacker->GetPartyId() );
if( pParty )
{
for( int i = 1; i < pParty->GetSizeofMember(); i++)
{
if( m_pDefender->GetProp()->dwID == monsterid )
{
CUser* pMember = g_UserMng.GetUserByPlayerID( pParty->m_aMember[i].m_uPlayerId );
//CUser* pParty r = g_UserMng.GetUserByPlayerID( pParty->m_aMember[i].m_uPlayerId );
ParsingCommand( "/ci 21", (CMover*)pMember );
return;
}
}
}
1. Sanitize what you get from GetUserByPlayerIDQuote:
Thank you. you know how all party member use command ?
here is my code
but the command is not run. or if i take out return. server will crash.PHP Code:CParty* pParty = g_PartyMng.GetParty( m_pAttacker->GetPartyId() );
if( pParty )
{
for( int i = 1; i < pParty->GetSizeofMember(); i++)
{
if( m_pDefender->GetProp()->dwID == monsterid )
{
CUser* pMember = g_UserMng.GetUserByPlayerID( pParty->m_aMember[i].m_uPlayerId );
//CUser* pParty r = g_UserMng.GetUserByPlayerID( pParty->m_aMember[i].m_uPlayerId );
ParsingCommand( "/ci 21", (CMover*)pMember );
return;
}
}
}