Reconnect cmd???
#1

Hello, i would ask how to make an reconnect cmd? I have not any idea for it.
Reply
#2

It's not possible in SA-MP, there are mods for it, however.
You can pair SAMP-Funcs and the Reconnect+ plugin for SAMP-Funcs.

EDIT: Doing a bit a research, I must bite my tongue. You can actually ban the player and instantly unban him then reload the ban list. This apparently will make a "reconnect" command. I could be wrong, though.
Reply
#3

thx, think that if you can in your way, but i dont know.
Reply
#4

Quote:
Originally Posted by bookknp
Посмотреть сообщение
thx, think that if you can in your way, but i dont know.
What command processor are you using for your script currently?
Reply
#5

Im starting gamemode, but i want information if is it possible. If possible, I look for the code (Pawn)
Reply
#6

Код:
new bool: isRelogging[MAX_PLAYERS], relogPlayerIP[MAX_PLAYERS][17];

public OnPlayerDisconnect(playerid, reason)
{
    if(isRelogging[playerid])
    {
        isRelogging[playerid] = false;
        format(str, sizeof(str), "unbanip %s", relogPlayerIP[playerid]);
        SendRconCommand(str);
    }
    return 1;
}


CMD:relog(playerid, params[])
{
   
    isRelogging[playerid] = true;
    GetPlayerIp(playerid, relogPlayerIP[playerid], 17);
    format(str, sizeof(str), "banip %s", relogPlayerIP[playerid]);
    SendRconCommand(str);
    GameTextForPlayer(playerid, "~b~~h~Reconnecting~w~!", 4000, 3);
    SendClientMessage(playerid, -1, "Please re-join the server if you get a ban message upon reconnection!");
    return true;
}
Hope this will work!
Reply
#7

Quote:
Originally Posted by UFF
Посмотреть сообщение
Код:
new bool: isRelogging[MAX_PLAYERS], relogPlayerIP[MAX_PLAYERS][17];

public OnPlayerDisconnect(playerid, reason)
{
    if(isRelogging[playerid])
    {
        isRelogging[playerid] = false;
        format(str, sizeof(str), "unbanip %s", relogPlayerIP[playerid]);
        SendRconCommand(str);
    }
    return 1;
}


CMD:relog(playerid, params[])
{
   
    isRelogging[playerid] = true;
    GetPlayerIp(playerid, relogPlayerIP[playerid], 17);
    format(str, sizeof(str), "banip %s", relogPlayerIP[playerid]);
    SendRconCommand(str);
    GameTextForPlayer(playerid, "~b~~h~Reconnecting~w~!", 4000, 3);
    SendClientMessage(playerid, -1, "Please re-join the server if you get a ban message upon reconnection!");
    return true;
}
Hope this will work!
Thx, but i have one problem "str" is not defined.

Код:
C:\Users\1320703\Desktop\GTA3\server2\gamemodes\SanFierroTDM2.pwn(15094) : error 017: undefined symbol "str"
C:\Users\1320703\Desktop\GTA3\server2\gamemodes\SanFierroTDM2.pwn(15094) : error 017: undefined symbol "str"
C:\Users\1320703\Desktop\GTA3\server2\gamemodes\SanFierroTDM2.pwn(15094) : error 029: invalid expression, assumed zero
C:\Users\1320703\Desktop\GTA3\server2\gamemodes\SanFierroTDM2.pwn(15094) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#8

Quote:
Originally Posted by bookknp
Посмотреть сообщение
Thx, but i have one problem "str" is not defined.

Код:
C:\Users\1320703\Desktop\GTA3\server2\gamemodes\SanFierroTDM2.pwn(15094) : error 017: undefined symbol "str"
C:\Users\1320703\Desktop\GTA3\server2\gamemodes\SanFierroTDM2.pwn(15094) : error 017: undefined symbol "str"
C:\Users\1320703\Desktop\GTA3\server2\gamemodes\SanFierroTDM2.pwn(15094) : error 029: invalid expression, assumed zero
C:\Users\1320703\Desktop\GTA3\server2\gamemodes\SanFierroTDM2.pwn(15094) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
new str[200]; put this in the relog command.
Reply
#9

I got banned, Is there any way that you are not banned ??
Reply
#10

Quote:
Originally Posted by bookknp
Посмотреть сообщение
Hello, i would ask how to make an reconnect cmd? I have not any idea for it.
Код:
new GetPlayerIP[MAX_PLAYERS][16],bool:paX[MAX_PLAYERS];

CMD:reconnect(playerid, params[]) 
{
    paX[playerid] = true;
    GetPlayerIp(playerid, GetPlayerIP[playerid], 16);
    return BlockIpAddress(GetPlayerIP[playerid],1000*6000);
}

public OnPlayerDisconnect(playerid, reason)
 {
   if(paX[playerid] == true) UnBlockIpAddress(GetPlayerIP[playerid]);
   paX[playerid] = false;
   GetPlayerIP[playerid][0] = EOS;
   return true;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)