redefine kick function?
#1

I want to make a 1 second delay when player get's kicked, but i don't won't to find all Kick functions and change them to something else. Is there any way to redefine already defined kick function?
Reply
#2

pawn Код:
//this inside your /kick comamnd.
SetTimerEx("kick",1000,false,"i",targetid); //i use that because i dont know what you define the target as

//remove the Kick(targetid); from the function all together

forward kick(targetid);
public kick(targetid)
{
    Kick(targetid);
    return 1;
}
Try that? 1000 is 1 second in MS. Just replace targetid with whatever you use to define the target to kick.
Reply
#3

Or just hook Kick() with ALS...

pawn Код:
timer KickPlayerDelay[150](playerid)
{
    Kick(playerid);
}

stock rKick(playerid)
{
    defer KickPlayerDelay(playerid);
    return playerid;
}

#if defined _ALS_Kick
    #undef Kick
#else
    #define _ALS_Kick
#endif
#define Kick rKick
Reply
#4

Ever heard of Search and Replace? I guess not. :/
Reply
#5

Bad guess, i have some own ban functions where delay can't be used :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)