Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- public OnFilterScriptInit()
- {
- print("\n---------------------------------------------------------------------------");
- print(" Reconnect System by Alpay Lewis (http://forum.sa-mp.com/member.php?u=245253)");
- print("---------------------------------------------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new IP[20];
- GetPlayerIp(playerid,IP,sizeof(IP));
- SetPVarString(playerid,"ip",IP);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(GetPVarInt(playerid,"reconnecting") == 1)
- {
- new string[24];
- GetPVarString(playerid,"ip",string,sizeof(string));
- format(string,sizeof(string),"unbanip %s",string);
- SendRconCommand(string);
- SendRconCommand("reloadbans");
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/recon", cmdtext, true, 10) == 0 || strcmp("/reconnect", cmdtext, true, 10) == 0)
- {
- SetPVarInt(playerid,"reconnecting",1);
- new IP[24];
- GetPlayerIp(playerid,IP,sizeof(IP));
- format(IP,sizeof(IP),"banip %s",IP);
- SendRconCommand(IP);
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment