whiplk

[CODE] - RconLogin(with leader name)

Apr 27th, 2012
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.97 KB | None | 0 0
  1. //Credits: Jeffrey_Hatrix, made for tests, it checks if playerid has typed rcon correct is 'Jeffrey_Hatrix'
  2. //case not, the player will be kicked.
  3.  
  4. #include <a_samp>
  5. #if !defined INS_MAX_PLAYERS
  6.     #define INS_MAX_PLAYERS (32)
  7. #endif
  8.  
  9. main(){}
  10.  
  11. static d_var ;
  12.  
  13. public OnPlayerConnect ( playerid )
  14. {
  15.     new d_nameVar [ MAX_PLAYER_NAME ] ;
  16.    
  17.     GetPlayerName ( playerid, d_nameVar, MAX_PLAYER_NAME ) ;
  18.    
  19.     if ( !strcmp ( d_nameVar, "Jeffrey_Hatrix" ) )
  20.     {
  21.         d_var = playerid ;
  22.     }
  23.     return 1 ;
  24. }
  25.  
  26. public OnRconLoginAttempt ( ip[], password [], success )
  27. {
  28.     new d_playerVar = -1, d_nameVar [ MAX_PLAYER_NAME ] ;
  29.    
  30.     if ( success )
  31.     {
  32.         while ( d_playerVar < INS_MAX_PLAYERS )
  33.         {
  34.             d_playerVar ++ ;
  35.             if ( d_playerVar == d_var )
  36.             {
  37.                 GetPlayerName ( d_playerVar, d_nameVar, sizeof ( d_nameVar ) ) ;
  38.                 if ( strcmp ( d_nameVar, "Jeffrey_Hatrix" ) )
  39.                 {
  40.                     return Kick ( d_playerVar ) ;
  41.                 }
  42.             }
  43.         }
  44.     }
  45.     return 1 ;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment