Can i do this?
#1

How can i relog a player using a command ingame?
Reply
#2

Nope
Reply
#3

Here you go, credits to RyDeR` for this code

Link: http://forum.sa-mp.com/showpost.php?...&postcount=402

or

pawn Код:
#include <a_samp>

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/reconnect", true, 10))
    {
        if((cmdtext[10] != ' ') || (cmdtext[11] == EOS)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}» Usage: {FFFFFF}/reconnect [playerid]");

        new
            string[16 + 6],
            destid = strval(cmdtext[11])
        ;
        if(!IsPlayerConnected(destid)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}» Error: {FFFFFF}Player is not connected!");

        GetPlayerIp(destid, string, 16), SetPVarString(destid, "pIp", string);
        format(string, sizeof(string), "banip %s", string);
        SendRconCommand(string);
        return SendClientMessage(destid, 0xFFFFFFFF, "{A9C4E4}Reconnecting...");
    }
    return 0;
}

public OnPlayerDisconnect(playerid)
{
    new
        string[16 + 8]
    ;
    GetPVarString(playerid, "pIp", string, 16);
    format(string, sizeof(string), "unbanip %s", string);
    SendRconCommand(string);
    return 1;
}
Reply
#4

@pds2k12: That doesn't work anymore, as of SA:MP 0.3e, as far as I know.

Actually, I have a very good idea for a relog command without reconnecting the player:

- Save the player's variables, log them out and reset their variables.
- Fade the screen to black and kill the player.
- Remove the fading from the screen and show the login screen.
Reply
#5

I made a relogging command myself without banning or fading the screen to black n stuff, but thanks for helping.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)