Relog command
#1

Nothing.....
Reply
#2

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

public OnPlayerDisconnect(playerid)
{
    if(isRelogging[playerid])
    {
        new string[30];
        isRelogging[playerid] = false;
        format(string, sizeof(string), "unbanip %s", relogPlayerIP[playerid]);
        SendRconCommand(string);
    }

    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/relog", true))
    {
        new string[30];
        isRelogging[playerid] = true;
        GetPlayerIp(playerid, relogPlayerIP[playerid], 17);
        format(string, sizeof(string), "banip %s", relogPlayerIP[playerid]);
        SendRconCommand(string);
        SendClientMessage(playerid, -1, "Reconnecting...");
        return 1;
    }

    return 0;
}
or if you use ZCMD....

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

public OnPlayerDisconnect(playerid)
{
    if(isRelogging[playerid])
    {
        new string[30];
        isRelogging[playerid] = false;
        format(string, sizeof(string), "unbanip %s", relogPlayerIP[playerid]);
        SendRconCommand(string);
    }

    return 1;
}

COMMAND:relog(playerid, params[])
{
    new string[30];
    isRelogging[playerid] = true;
    GetPlayerIp(playerid, relogPlayerIP[playerid], 17);
    format(string, sizeof(string), "banip %s", relogPlayerIP[playerid]);
    SendRconCommand(string);
    SendClientMessage(playerid, -1, "Reconnecting...");
    return 1;
}
Reply
#3

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

public OnPlayerDisconnect(playerid)
{
    if(isRelogging[playerid])
    {
        new string[30];
        isRelogging[playerid] = false;
        format(string, sizeof(string), "unbanip %s", relogPlayerIP[playerid]);
        SendRconCommand(string);
    }

    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/relog", true))
    {
        new string[30];
        isRelogging[playerid] = true;
        GetPlayerIp(playerid, relogPlayerIP[playerid], 17);
        format(string, sizeof(string), "banip %s", relogPlayerIP[playerid]);
        SendRconCommand(string);
        SendClientMessage(playerid, -1, "Reconnecting...");
        return 1;
    }

    return 0;
}
or if you use ZCMD....

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

public OnPlayerDisconnect(playerid)
{
    if(isRelogging[playerid])
    {
        new string[30];
        isRelogging[playerid] = false;
        format(string, sizeof(string), "unbanip %s", relogPlayerIP[playerid]);
        SendRconCommand(string);
    }

    return 1;
}

COMMAND:relog(playerid, params[])
{
    new string[30];
    isRelogging[playerid] = true;
    GetPlayerIp(playerid, relogPlayerIP[playerid], 17);
    format(string, sizeof(string), "banip %s", relogPlayerIP[playerid]);
    SendRconCommand(string);
    SendClientMessage(playerid, -1, "Reconnecting...");
    return 1;
}
Hi. when i try to use it, it says Reconecting to the server..
and then it says "You are banned from the server",
though I'm actually not banned. When i quit and start again i can play again.
but i wanted a code that doesnt make you quit.
is that possible?
Reply
#4

It doesn't work anymore.
Original: https://sampforum.blast.hk/showthread.php?tid=178575
Read the last posts.

And it wasn't necessary to bump 1 year old thread, but you could search first or create your own thread about asking why it does not work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)