Kick() and send message problem.
#1

Hello again.

I know that I must delay kick() in order to see message in client and I did it:

Код:
stock KickD(playerid, kicker[], text[])
{
	new str[500], na[MAX_PLAYER_NAME];
	GetPlayerName(playerid, na, MAX_PLAYER_NAME);

	format(str, sizeof(str), "[{007FFF}%s{FFFFFF}]{8DEEEE} iљmetė {FFFFFF}[{007FFF}%s{FFFFFF}] {8DEEEE}iљ serverio. Prieћastis: {FFFFFF}[{007FFF}%s{FFFFFF}]", kicker, na, text);
	SendClientMessageToAll(-1, str);

	TogglePlayerControllable(playerid, 0);
    SetTimerEx("KickT", 2000, 0, "d", playerid);
    return 1;
}
But I don't see any messages at all.

Maybe I should decrease str length? :S
Reply
#2

public function. It does "Kick(playerid)".

Kicking is working, I just don't see messages.

Код:
forward KickT(playerid);
public KickT(playerid)
{
	Kick(playerid);
}
P.S. nor I, nor other my box accounts see SendClientMessageToAll message.
Reply
#3

:O that's the problem!

Thanks
Reply
#4

No, that is not prob. I have same problem, it worked just fine and suddenly *puf* it stopped working, I fixed that by calling custom Kick function send message then set timer for 2 sec to kick player.

This is how it looks now

pawn Код:
stock KickEx(playerid, reason[], increase = 0){
    if(increase) PlayerInfos[playerid][pKicks]++;
    SendClientMessage(playerid, COLOR_RED, reason);
    SetTimerEx("PlayerKick", 2000, false, "d", playerid);
    return 1;
}

function:PlayerKick(playerid){
    Kick(playerid);
    return true;
}
and this is how it looked before

pawn Код:
stock KickEx(playerid, reason[], increase = 0){
    if(increase) PlayerInfos[playerid][pKicks]++;
    SendClientMessage(playerid, COLOR_RED, reason);
    Kick(playerid);
    return 1;
}
Reply
#5

send a single ClinetMessage then in a loop!
So when the loop finished you dont need a timer you can just kick them straight after the loop as you then know for sure that they received it!
Reply
#6

send a single ClinetMessage then in a loop!
So when the loop finished you dont need a timer you can just kick them straight after the loop as you then know for sure that they received it!
Reply
#7

ok, that is not problem, it works fine this way too, but what did Kalcor changed on SAMP and we are not able to SendClientMessage and then Kick player.
Reply
#8

I use similar to this and it works fine!
pawn Код:
// Random Callback
SendClientMessageToAll(-1, "Something");
SetTimerEx("KickT", 200, 0, "d", playerid);

forward KickT(playerid);
public KickT(playerid)
{
    return Kick(playerid);
}
Reply
#9

same problem here
i've reported this bug at the 'bugs' section and should be solved soon as possible
Reply
#10

Ability to take a look into the wiki and reading what it says sometimes helps wonders:
https://sampwiki.blast.hk/wiki/Kick

Quote:
Important Note: As of SA-MP 0.3x, any message sent to the player with SendClientMessage before Kick() will not be displayed for them.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)