redefine kick function? - 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: redefine kick function? (
/showthread.php?tid=447379)
redefine kick function? -
ajwar - 29.06.2013
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?
Re: redefine kick function? -
DobbysGamertag - 29.06.2013
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.
Re: redefine kick function? -
Scenario - 29.06.2013
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
Re: redefine kick function? -
Vince - 29.06.2013
Ever heard of Search and Replace? I guess not. :/
Re: redefine kick function? -
ajwar - 29.06.2013
Bad guess, i have some own ban functions where delay can't be used :P