PuppyB

Relog System

Dec 29th, 2014
1,774
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.86 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. new ReconnectIP[MAX_PLAYERS][32];
  4. new bool: Reconnecting[MAX_PLAYERS];
  5. #define MAX_IP_SIZE 32
  6.  
  7. CMD:reconnect(playerid, params[])
  8. {
  9.     if(IsPlayerConnected(playerid))
  10.     {
  11.         new
  12.             string[64];
  13.         new playerIP[32];
  14.         GetPlayerIp(playerid, playerIP, sizeof(playerIP));
  15.         format(ReconnectIP[playerid], MAX_IP_SIZE, "%s", playerIP);
  16.         format(string, sizeof(string), "banip %s", playerIP);
  17.         SendRconCommand(string);
  18.         SendClientMessage(playerid, -1, "Reconnecting...");
  19.         Reconnecting[playerid] = true;
  20.         return 1;
  21.     }
  22.     return 1;
  23. }
  24.  
  25. public OnPlayerDisconnect(playerid, reason)
  26. {
  27.     if(Reconnecting[playerid] == true)
  28.     {
  29.         new string[64];
  30.         format(string, sizeof(string), "unbanip %s", ReconnectIP[playerid]);
  31.         SendRconCommand(string);
  32.         Reconnecting[playerid] = false;
  33.     }
  34.     return 1;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment