setting a timer
#1

Hey ,

i tried many times to set a timer before any ban / kick , so eventually players can see why they have been banned / kicked . Can anyone show me a good script for that?
Reply
#2

pawn Код:
// Send the message or dialog about the ban details
SetTimerEx( "KickPlayer", 500, false, "i", playerid );

// Somewhere else, outside of any callback.
forward KickPlayer( playerid );
public KickPlayer( playerid )
{
    Kick( playerid );
}
Or if it's client message, you can use:
pawn Код:
stock SendKickMessage( playerid, color, const message[ ] )
{
    SendClientMessage( playerid, color, message );
    SetTimerEx( "KickPlayer", 500, false, "i", playerid );
}

forward KickPlayer( playerid );
public KickPlayer( playerid )
{
    Kick( playerid );
}
pawn Код:
// Usage:
SendKickMessage( playerid, -1, "You are banned for health hacks" );
Reply
#3

pawn Код:
// Usage:
SendKickMessage( playerid, -1, "You are banned for health hacks" );
[/QUOTE]


Excuse me , but where to add this part in the script.
Reply
#4

That you add in example your /ban or /kick cmd
Reply
#5

Quote:
Originally Posted by Thundey
Посмотреть сообщение
Excuse me , but where to add this part in the script.
That was just an example of how it should be used.

Let's say, you want to format a message with the reason someone is banned for. You format it and then you send, just like SendClientMessage, but use the function above instead. It will send the message and then it will set the timer to kick the player.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)