jlalt

aaaa

Jul 14th, 2016
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.21 KB | None | 0 0
  1. #include a_samp
  2. #include file
  3. new File:RFile[2];
  4. public OnFilterScriptInit() {
  5.        RFile[0] = fopen("rcons.txt", io_readwrite);
  6.        RFile[1] = fopen("frcons.txt", io_readwrite);
  7.        return 1;
  8. }
  9. public OnRconLoginAttempt(ip[], password[], success)
  10. {
  11.     new playerip[15 + 1];
  12.     for(new playerid = 0, highestPlayerid = GetPlayerPoolSize(); playerid <= highestPlayerid; playerid++) {
  13.         if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid)) {
  14.             GetPlayerIp(playerid, playerip, sizeof(playerip));
  15.             if(!strcmp(ip, playerip, true)) {
  16.                 if(success) {
  17.                 new pName[32], string[128];
  18.                 GetPlayerName(playerid,pName,sizeof pName);
  19.                 format( string, sizeof(string), "Successful login Player %s | Player IP %s | Password used %s |", pName, ip, password);
  20.                 fwrite(RFile[0], string);
  21.                 return 1;
  22.                 } else {
  23.                 new pName[32], string[128];
  24.                 GetPlayerName(playerid,pName,sizeof pName);
  25.                 format(string, sizeof string, "Fail Rcon Login by Player  %s | Player IP %s | Password Used %s", pName, ip, password);
  26.                 fwrite(RFile[1], string);
  27.                 }
  28.                 break;
  29.             }
  30.         }
  31.     }
  32.     return 1;
  33. }
  34. public OnFilterScriptExit() {
  35.         fclose(RFile[0]);
  36.         fclose(RFile[1]);
  37.         return 1;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment