new IsFlooding[MAX_PLAYERS]; new Flooder[MAX_PLAYERS];
public OnPlayerText(playerid, text[]) { if(Flooder[playerid] == 1) { SendClientMessage(playerid, -1, "{FF0000}[ERRO]{FFFFFF} Vocк estб calado e nгo pode usar o chat !"); return 0; } IsFlooding[playerid]++; if(IsFlooding[playerid] >= 3) { IsFlooding[playerid] = 0; Flooder[playerid] = 1; SendClientMessage(playerid, -1, "{FF0000}[INFO]{FFFFFF} Vocк foi calado por 1 minuto. Motivo: Flood !"); SetTimerEx("LiberaraChat", 60000, false, "i", playerid); return 0; } else { SetTimerEx("SemFlood", 2000, false, "i", playerid); } return 1; } forward SemFlood(playerid); public SemFlood(playerid) { IsFlooding[playerid] = 0; return 1; } forward LiberarChat(playerid); public LiberarChat(playerid) { Flooder[playerid] = 0; SendClientMessage(playerid, -1, "Vocк foi descalado, nгo faзa mais flood !"); return 1; }
stock IsPlayerFlooding(p, time){
static
getMessageTime [ MAX_PLAYERS char ]
;
if ( getMessageTime { p } != 0 ) {
if ( ( gettime() - getMessageTime { p } ) < time ){
getMessageTime { p } = gettime ( ) ;
return !false ;
}
}
getMessageTime { p } = gettime ( ) ;
return !true ;
}
if(IsPlayerFlooding(playerid, 3)){ // 3 segundos
return SendClientMessage(playerid, -1,"Vocк estб frodano(3s)"),0;
}
Tenta essa FS aqui : http://pastebin.com/53DgMk74 , caso vocК consiga , й sу incluir no seu gm !
|
Originally Posted by [Full
Garfield[XDB][;2188167]stock IsPlayerFlooding(p, time){
static getMessageTime [ MAX_PLAYERS char ] ; if ( getMessageTime { p } != 0 ) { if ( ( gettime() - getMessageTime { p } ) < time ){ getMessageTime { p } = gettime ( ) ; return !false ; } } getMessageTime { p } = gettime ( ) ; return !true ; } |