SA-MP Forums Archive
Kick() and send message problem. - 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: Kick() and send message problem. (/showthread.php?tid=425679)



Kick() and send message problem. - Darth1993 - 26.03.2013

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


Re: Kick() and send message problem. - Darth1993 - 26.03.2013

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.


Re: Kick() and send message problem. - Darth1993 - 26.03.2013

:O that's the problem!

Thanks


Re: Kick() and send message problem. - CoaPsyFactor - 26.03.2013

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;
}



Re: Kick() and send message problem. - park4bmx - 26.03.2013

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!


Re: Kick() and send message problem. - Strike97 - 26.03.2013

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!


Re: Kick() and send message problem. - CoaPsyFactor - 26.03.2013

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.


Re: Kick() and send message problem. - Konstantinos - 26.03.2013

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);
}



Re: Kick() and send message problem. - GoldZoroGrab - 26.03.2013

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


Re: Kick() and send message problem. - Drebin - 28.03.2013

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.