Announce banned message [Issue]

Started by Mötley, Oct 25, 2016, 04:08 PM

Previous topic - Next topic

Mötley

I have tried recreating a ban I used in a LU server, But it seems the Announce does not call quick enough I guess


Announce("~r~Banned", plr, 6);
Any assistance is appreciated




.

#1
Probably the ban packet has a higher priority than the announce packet. I suppose a self destructing timer that is called once to kick the player would do the trick. I think there's already a topic about this here somewhere. Basically, you send the Announce() message and then create a timer that calls a kick function and you just send the player id.

First you send the announcement:
Announce(whatever);
Then you create a delayed timer to ban that player:
NewTimer("BanPlayerID", 1000, 1, player.ID);
function BanPlayerID(id)
{
    local player = FindPlayer(id);
    if (player != null)
    {
        player.Ban();
    }
}

Of course, this is just a dumb approach because if the player disconnects before the ban takes place and/or someone else connects with that ID then you essentially ban someone else or no one at all.

So you have to think ahead of time and find measures to counteract these things. It's just a suggestion and an acknowledgement that this indeed is something that is supposed to happen.
.

Mötley

Thank you!

Since this is a time issue obviously. I will create a welcome message that will change when joining the server depending on if banned or not "welcome" or "banned"

Instead of calling it before the kick. This might add enough time.