Advertisement
EnzoMetlc

[Include] OnPlayerRconLogin.

Jan 23rd, 2014
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. #include <a_samp>
  2. #include <YSI\y_iterate>
  3.  
  4. static PlayerIP[MAX_PLAYERS];
  5.  
  6. public OnPlayerConnect(playerid)
  7. {
  8. new IP[32];
  9. GetPlayerIp(playerid, IP, sizeof(IP));
  10.  
  11. PlayerIP[playerid] = '\0';
  12. strins(PlayerIP, IP, 0);
  13. return 1;
  14. }
  15.  
  16. public OnRconLoginAttempt(ip[], password[], success)
  17. {
  18. foreach(new i: Player)
  19. {
  20. new IP[32];
  21. GetPlayerIp(i, IP, sizeof(IP));
  22. if(!strcmp(IP, ip))
  23. {
  24. CallLocalFunction("OnPlayerRconLogin", "dsi", i, password, success);
  25. }
  26. }
  27. return 1;
  28. }
  29.  
  30.  
  31. #if defined _ALS_OnPlayerConnect
  32. #undef OnPlayerConnect
  33. #else
  34. #define _ALS_OnPlayerConnect
  35. #endif
  36. #define OnPlayerConnect RCON_OnPlayerConnect
  37.  
  38. #if defined _ALS_OnRconLoginAttempt
  39. #undef OnRconLoginAttempt
  40. #else
  41. #define _ALS_OnRconLoginAttempt
  42. #endif
  43. #define OnRconLoginAttempt RCON_OnRconLoginAttempt
  44.  
  45.  
  46. forward OnPlayerRconLogin(playerid, password[], success);
  47.  
  48.  
  49. /* Example/Ejemplo:
  50.  
  51. public OnPlayerRconLogin(playerid, password[], success)
  52. {
  53. new string[144];
  54. new Nick[MAX_PLAYER_NAME];
  55. GetPlayerName(playerid, Nick, sizeof(Nick));
  56. format(string, sizeof(string), "* %s[%d] %s he identified as administrator. [Pass: %s].", Nick, playerid, success ? ("yes") : ("not"), password);
  57. SendClientMessageToAll(-1, string);
  58. return 1;
  59. }
  60. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement