[Include] OnFloodDetected
#18

Include updated with several new types, please read the first post for more info. Thanks to Biesmen for the suggestions!

Quote:
Originally Posted by pds2k12
Посмотреть сообщение
Or you could simply use switch statement, I believe it's faster than if( ... )

pawn Код:
public OnFloodDetected(playerid, ip[], type)   
{    
    switch( type )
    {
        case FLOOD_TYPE_CONNECT:           
        {        
            ...    
        }
        case FLOOD_TYPE_CHAT:
        {      
            ...    
        }    
        case FLOOD_TYPE_BLABLA:
        {
            ...
        }
    }
    return true;
}
With if and switch, speed isn't really an issue, it's all about good structuring and organization.
Reply


Messages In This Thread
OnFloodDetected - by Emmet_ - 18.11.2013, 23:41
Respuesta: OnFloodDetected - by Swedky - 19.11.2013, 00:14
Re: Respuesta: OnFloodDetected - by Emmet_ - 19.11.2013, 00:21
Re: OnFloodDetected - by EvanA - 19.11.2013, 00:24
Re: OnFloodDetected - by Sublime - 19.11.2013, 00:30
Re: OnFloodDetected - by Jardell - 19.11.2013, 00:33
Re: OnFloodDetected - by Pottus - 19.11.2013, 00:42
Re: OnFloodDetected - by 420Scripter - 19.11.2013, 00:47
Re: OnFloodDetected - by KingServerIRAN - 19.11.2013, 07:59
Re: OnFloodDetected - by Emmet_ - 19.11.2013, 10:57
Re: OnFloodDetected - by Emmet_ - 19.11.2013, 19:33
Re: OnFloodDetected - by smeti - 19.11.2013, 19:52
Re: OnFloodDetected - by Emmet_ - 19.11.2013, 20:54
Re: OnFloodDetected - by Biesmen - 20.11.2013, 08:35
Re: OnFloodDetected - by Emmet_ - 20.11.2013, 12:41
Re: OnFloodDetected - by Biesmen - 20.11.2013, 13:31
Re: OnFloodDetected - by Patrick - 20.11.2013, 14:11
Re: OnFloodDetected - by Emmet_ - 20.11.2013, 14:29
Re: OnFloodDetected - by CriticalRP - 20.11.2013, 19:22
Re: OnFloodDetected - by Emmet_ - 20.11.2013, 19:24
Re: OnFloodDetected - by PT - 21.11.2013, 18:23
Re: OnFloodDetected - by Emmet_ - 21.11.2013, 19:32

Forum Jump:


Users browsing this thread: 1 Guest(s)