msg for kick
#1

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.
Reply
#2

Use the kick(playerid) function inside a public and trigger that with a settimerex
Reply
#3

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.
Reply
#4

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.
Reply
#5

Thanks all. Much appreciated.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)