Fix Kick before messages
#1

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

Set a few second timer and kick only then.
Reply
#3

You put the kick before or after the message?
Reply
#4

after the message.
Reply
#5

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);
Reply
#6

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

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

no problem now gonna test
Reply
#9

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)