Code:
namespace lordevent
{
int CreateRequirements( CUser* pUser, int iEEvent, int iIEvent )
{
ILordEvent* pEvent = CSLord::Instance()->GetEvent();
if(!pUser->IsAuthHigher(AUTH_GAMEMASTER))
{
if( !CSLord::Instance()->IsLord( pUser->m_idPlayer ) )
{
return TID_GAME_L_EVENT_CREATE_E001;
}
}
if( pEvent->GetComponent( pUser->m_idPlayer ) ) // is there no event?
return TID_GAME_L_EVENT_CREATE_E002;
if( pUser->IsQuerying() )
return TID_GAME_LORD_IS_QUERYING;
__int64 iCost = pEvent->GetCost( iEEvent, iIEvent );
if( iCost == 0 )
return TID_GAME_L_EVENT_CREATE_E004;
if( iCost > pUser->GetTotalGold() )
return TID_GAME_L_EVENT_CREATE_E003;
pUser->SetQuerying( TRUE );
return 0;
}
};
i don't know how to do that =(
Code:
if( pEvent->GetComponent( pUser->m_idPlayer ) ) // is there no event?
return TID_GAME_L_EVENT_CREATE_E002;
this check the id of the player who used the event but i know how to put the check for the lord event not the player who host it but when the event is active