I never tested this but it should work in theory
"/ban username"
NOTE: I MADE THIS FOR LTD SOURCE aka DITS rev 4 and up
NOTE 2: to add this to an other source you must add DSystemLog which is easy if you have read through multiple sources
EDIT: I will improve code within the next day or so
let me know how it works
"/ban username"
Code:
BOOL TextCmd_BANNISH( CScanner & scanner )
{
#ifdef __WORLDSERVER
CUser* pUser = (CUser*)scanner.dwValue;
if( !IsValidObj( pUser ) )
{
pUser->AddText( "Invalid user." );
return TRUE;
}
scanner.GetToken();
u_long idTarget = CPlayerDataCenter::GetInstance()->GetPlayerId( scanner.token );
if( idTarget == 0 )
idTarget = pUser->m_idPlayer;
CUser* pTarget = g_UserMng.GetUserByPlayerID( idTarget );
if( !IsValidObj( pTarget ) )
{
pUser->AddText( "Invalid target name." );
return TRUE;
}
CString TNickName;
CString UNickName;
char szBannish[MAX_PATH];
CString strTargetIp;
CString strPath;
TNickName = pTarget->GetName();
UNickName = pUser->GetName();
CString strIp = pTarget->m_playAccount.lpAddr;
CString strAccnt = pTarget->m_playAccount.lpszAccount;
if( pUser->IsAuthHigher( AUTH_GAMEMASTER ) )
{
sprintf( szBannish, "%s , you have been Banned by [Staff member]--> %s", TNickName, UNickName );
pTarget->AddText( szBannish );
strTargetIp.Format( "%s - %s // Accnt %s UserNname %s was banned by Staff member %s ", strIp, strIp, strAccnt, TNickName, UNickName );
strPath.Format( "..\\Program\\IPCut.ini" );
DSystemLog( strTargetIp, strPath, 0 );
pUser->AddText("User has been Banned");
}
#endif // __WORLDSERVER
return TRUE;
}
Code:
ON_TEXTCMDFUNC( TextCmd_BANNISH, "ban", "BU", "BAN", "BU", TCM_SERVER, AUTH_GAMEMASTER2 , "·¹º§ ¼³Á¤ Çϱâ" )
NOTE 2: to add this to an other source you must add DSystemLog which is easy if you have read through multiple sources
EDIT: I will improve code within the next day or so
let me know how it works