SA-MP Forums Archive
Client Message? - 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: Client Message? (/showthread.php?tid=516896)



Client Message? - Laure - 02.06.2014

It should say return the client message before kicking but all it directly kicks without returning any message. It was working fine before and is happening with all such codes.
pawn Код:
if(CheckBan(string) == 1 && !dini_Int(file, "Whitelisted"))
    {
        SetPlayerName(playerid, "BannedPlayer");
        SendClientMessage(playerid, COLOR_LIGHTRED, "EG:RP: {FFFFFF}Your range is banned from this server.");
        Kick(playerid);
        return 1;
    }



Re: Client Message? - iZN - 02.06.2014

https://sampwiki.blast.hk/wiki/Kick

"As of SA-MP 0.3x, any action taken directly before Kick() (such as sending a message with SendClientMessage) will not reach the player. A timer must be used to delay the kick."


Re: Client Message? - Copfan5 - 02.06.2014

In an older version of SA-MP they made it this way. The best way aroun it is to make a public and set a time to that public.


Re: Client Message? - Rittik - 02.06.2014

Use timer.


Re: Client Message? - Lynn - 02.06.2014

pawn Код:
forward KickTime(playerid);
public KickTime(playerid) {
    Kick(playerid);
    return 1;
}
if(CheckBan(string) == 1 && !dini_Int(file, "Whitelisted"))
{
    SetPlayerName(playerid, "BannedPlayer");
    SendClientMessage(playerid, COLOR_LIGHTRED, "EG:RP: {FFFFFF}Your range is banned from this server.");
    SetTimerEx("KickTime", 500, false, "i", playerid);
    return 1;
}



Re: Client Message? - Laure - 02.06.2014

So shall i use this in every code having the problem? Alright thanks repped all.


Re: Client Message? - Lynn - 02.06.2014

Quote:
Originally Posted by Imperor
Посмотреть сообщение
So shall i use this in every code having the problem? Alright thanks repped all.
Yes, anytime you need to kick someone, simply Set them a timer linked to the Public function you just created.
As seen in my previous example.