Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Retorna um valor de tempo dependendo do parĂ¢metro assinalado pelo programador 'segundos', 'minutos', 'horas'
- stock timeExe(stringExe[])
- {
- new string_recortada[ 0x14 ] , string_tratada = 0 ;
- strmid ( string_recortada , stringExe , 0 , ( strfind ( stringExe , " " ) ) ) ;
- string_tratada = strval ( string_recortada ) ;
- if ( string_tratada != '\0' )
- {
- strmid ( string_recortada , stringExe , ( ( strfind ( stringExe , " " ) ) + 1 ) , strlen ( stringExe ) ) ;
- }
- if ( !strcmp ( string_recortada , "segundos" ) )
- {
- if ( ( string_tratada *= 1000 ) )
- return string_tratada ;
- }
- else if ( !strcmp ( string_recortada , "minutos" ) )
- {
- if ( ( string_tratada *= 60 * 1000 ) )
- return string_tratada ;
- }
- else if ( !strcmp ( string_recortada , "horas" ) )
- {
- if ( ( string_tratada *= 60 * 60 * 1000 ) )
- return string_tratada ;
- }
- return 0 ;
- }
- exemplo de uso, para os que usam timer ou etc...
- public OnGameModeInit()
- {
- SetTimer("x", timeExe("3 segundos"), false);
- return 0;
- }
- forward x();
- public x()
- {
- printf("x");
- }
Advertisement
Add Comment
Please, Sign In to add comment