msg for kick - 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: msg for kick (
/showthread.php?tid=438736)
msg for kick -
ConnorP - 21.05.2013
ok, so I've got a very, very simple /kick command for testing purposes, it works fine, it closes the connection when the cmd is executed, but I never get a message.
}
if (strcmp("/k", cmdtext, true, 2) == 0)
{
SendClientMessage(playerid, COLOR_RED, "kicked");
Kick(playerid);
return 1;
}
I never get the 'kicked' message, it merely closes the connection with no message, and I'm slightly baffled to as to why this is.
I'm probably making a simple error but any help is appreciated.
AW: msg for kick -
HurtLocker - 21.05.2013
Use the kick(playerid) function inside a public and trigger that with a settimerex
Re: msg for kick -
edzis84 - 21.05.2013
Try this.
Код:
if (strcmp("/k", cmdtext, true, 2) == 0)
{
SendClientMessage(playerid, COLOR_RED, "kicked");
SetTimer("kicktimer", 1000, false); // Set a timer of 1000 miliseconds (1 second)
return 1;
}
forward kicktimer();
public kicktimer()
{
Kick(playerid);
}
P.S Not tested and you can change that timer time to like 2 seconds if this isn't working.
Re: msg for kick -
FiniteSurvival - 21.05.2013
http://pastebin.com/9NYCgKW9
Here you go; in the new 0.3x update, if a message is sent directly before the kick statement, the message isn't shown on the player's screen.
Re: msg for kick -
ConnorP - 22.05.2013
Thanks all. Much appreciated.