Can i do this? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Can i do this? (
/showthread.php?tid=477373)
Can i do this? -
Wizza - 23.11.2013
How can i relog a player using a command ingame?
Re: Can i do this? -
doreto - 23.11.2013
No
pe
Re: Can i do this? - Patrick - 23.11.2013
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;
}
Re: Can i do this? - Emmet_ - 23.11.2013
@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.
Re: Can i do this? -
Wizza - 23.11.2013
I made a relogging command myself without banning or fading the screen to black n stuff, but thanks for helping.