Don't like ads? PRO users don't see any ads ;-)

[CODE] - RconLogin(v1)

By: whiplk on Apr 30th, 2012  |  syntax: PAWN  |  size: 0.63 KB  |  hits: 34  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. //RCON login, credits: Willian_Luigi (me)
  2.  
  3. public OnRconLoginAttempt ( ip [], password [], success )
  4. {
  5.     #if !defined INS_MAX_PLAYERS
  6.         #define INS_MAX_PLAYERS (20) //slots
  7.     #endif
  8.     new d_playerVar = -1 , d_playerName [ MAX_PLAYER_NAME ] ;
  9.    
  10.     while ( d_playerVar < INS_MAX_PLAYERS )
  11.     {
  12.         d_playerVar ++ ;
  13.         GetPlayerName ( d_playerVar, d_playerName , sizeof ( d_playerName ) ) ;
  14.         if ( strcmp ( d_playerName , "Willian_Luigi" ) == 1 ) // "Willian_Luigi" = seule personne qui peut accéder à RCON.
  15.         {
  16.             return Kick ( d_playerVar ) ;
  17.         }
  18.     }
  19.     return 1 ;
  20. }