#if !defined _samp_included
        #error Please include 'a_samp.inc'
#endif
#if !defined KICKFIX_INC
        #define  KICKFIX_INC
 
        static
                bool:kickedPlayer[MAX_PLAYERS char]={false, ...},
                bool:bannedPlayer[MAX_PLAYERS char]={false, ...}
        ;
       
       
        forward onKicked(playerid);
        forward onBanned(playerid,reason[]);
       
       
        stock fix_Kick(playerid, delay=100) {
                if(playerid >= 0 && playerid < MAX_PLAYERS) {
                        if(!kickedPlayer{playerid} && !bannedPlayer{playerid}) {
                                kickedPlayer{playerid}=true;
                                SetTimerEx("onKicked", delay, false, "i", playerid);
                        }
                        return 1;
                }
                return 0;
        }
       
        stock fix_Ban(playerid, reason[]="", delay=100) {
                if(playerid >= 0 && playerid < MAX_PLAYERS) {
                        if(!kickedPlayer{playerid} && !bannedPlayer{playerid}) {
                                bannedPlayer{playerid}=true;
                                SetTimerEx("onBanned", delay, false, "is", playerid, reason);
                        }
                        return 1;
                }
                return 0;
        }
       
       
        public onKicked(playerid) {
                kickedPlayer{playerid}=false;
                if(IsPlayerConnected(playerid)) {
                        Kick(playerid);
                }
        }
       
        public onBanned(playerid, reason[]) {
                bannedPlayer{playerid}=false;
                if(IsPlayerConnected(playerid)) {
                        if(reason[0] != '\0') {
                                BanEx(playerid, reason);
                        } else {
                                Ban(playerid);
                        }
                }
        }
       
        #define Ban             fix_Ban
        #define Kick    fix_Kick
        #define BanEx   fix_Ban
#endif