Client Message?
#1

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;
    }
Reply
#2

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."
Reply
#3

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

Use timer.
Reply
#5

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)