AlpayLewis

Reconnect System by Alpay Lewis

Jun 19th, 2015
527
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.16 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. public OnFilterScriptInit()
  4. {
  5.     print("\n---------------------------------------------------------------------------");
  6.     print(" Reconnect System by Alpay Lewis (http://forum.sa-mp.com/member.php?u=245253)");
  7.     print("---------------------------------------------------------------------------\n");
  8.     return 1;
  9. }
  10.  
  11. public OnFilterScriptExit()
  12. {
  13.     return 1;
  14. }
  15.  
  16. public OnPlayerConnect(playerid)
  17. {
  18.     new IP[20];
  19.     GetPlayerIp(playerid,IP,sizeof(IP));
  20.     SetPVarString(playerid,"ip",IP);
  21.     return 1;
  22. }
  23.  
  24. public OnPlayerDisconnect(playerid, reason)
  25. {
  26.     if(GetPVarInt(playerid,"reconnecting") == 1)
  27.     {
  28.         new string[24];
  29.         GetPVarString(playerid,"ip",string,sizeof(string));
  30.         format(string,sizeof(string),"unbanip %s",string);
  31.         SendRconCommand(string);
  32.         SendRconCommand("reloadbans");
  33.     }
  34.     return 1;
  35. }
  36.  
  37. public OnPlayerCommandText(playerid, cmdtext[])
  38. {
  39.     if (strcmp("/recon", cmdtext, true, 10) == 0 || strcmp("/reconnect", cmdtext, true, 10) == 0)
  40.     {
  41.         SetPVarInt(playerid,"reconnecting",1);
  42.         new IP[24];
  43.         GetPlayerIp(playerid,IP,sizeof(IP));
  44.         format(IP,sizeof(IP),"banip %s",IP);
  45.         SendRconCommand(IP);
  46.         return 1;
  47.     }
  48.     return 0;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment