SA-MP Forums Archive
Fix Kick before messages - 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: Fix Kick before messages (/showthread.php?tid=425470)



Fix Kick before messages - Mrich - 25.03.2013

I don't know if you have same problem but when I have Message+kick the player is kicked before getting the message, how to fix it?


Re: Fix Kick before messages - dusk - 25.03.2013

Set a few second timer and kick only then.


Re: Fix Kick before messages - Don_Cage - 25.03.2013

You put the kick before or after the message?


Re: Fix Kick before messages - Mrich - 25.03.2013

after the message.


Re: Fix Kick before messages - Scenario - 25.03.2013

I hooked Kick and it seems to work for me...

pawn Код:
stock realKick(playerid)
{
    defer serverKickDelay(playerid);
    return playerid;
}

#if defined _ALS_Kick
    #undef Kick
#else
    #define _ALS_Kick
#endif
#define Kick realKick

timer serverKickDelay[500](playerid) Kick(playerid);



Re: Fix Kick before messages - Mrich - 25.03.2013

Quote:
Originally Posted by Don_Cage
Посмотреть сообщение
You put the kick before or after the message?
Quote:
Originally Posted by RealCop228
Посмотреть сообщение
I hooked Kick and it seems to work for me...

pawn Код:
stock realKick(playerid)
{
    defer serverKickDelay(playerid);
    return playerid;
}

#if defined _ALS_Kick
    #undef Kick
#else
    #define _ALS_Kick
#endif
#define Kick realKick

timer serverKickDelay[500](playerid) Kick(playerid);
thank you all
How exactly ? I tried but didn't find the best way , & about your code I get Errors


Re: Fix Kick before messages - Scenario - 25.03.2013

You get errors because you simply copied and pasted.

You need y_timers for that code to work. You can get it from the YSI library, and you can include it by adding #include <YSI\y_timers> where you include the rest of your stuff.


Re: Fix Kick before messages - Mrich - 25.03.2013

no problem now gonna test


Re: Fix Kick before messages - Mrich - 26.03.2013

Tested , not fixed yet , now the player receives messages without being kicked...


Re: Fix Kick before messages - doreto - 26.03.2013

at top
pawn Код:
#define     KickEx(%0)                      SetTimerEx("Kick_Player", 300, 0, "d", %0) // 300 is time in miliseconds you can change it if you wont , but i find that is more proper time
and samewere in your script
pawn Код:
forward Kick_Player(playerid);
public Kick_Player(playerid)
{
    Kick(playerid);
}
and if you wont to kick someone you use
pawn Код:
KickEx(playerid);