09.04.2013, 04:27
Quote:
This is exactly what am saying Falcon. I mean see your switch statement. I need to add a case statement to check for each minute every time. Cant that happen automatically? Or shall we divide it by 60? Like this:
If CurrentSecs%60 == 0 Then it should increment the fare? Is the logic right now? Also your way is right and correct. I will set it to 0 always and start again. Thanks a lot Falcon. I'm glad i found you on ********. Rep+4 |
pawn Код:
public YourTimer( playerid )
{
pSeconds[ playerid ]++;
switch( pSeconds[ playerid ] )
{
case 60: // 1 minute
{
pSeconds[ playerid ] = 0;
pMinutes[ playerid ]++;
// here every minute is get called which means 60 seconds are completed here. So there is no need to
// check if one minute has been completed, now here you can add the REST of the code and test it, it'll work every minute ;-)
// just incase you want to choose 5 minutes, you may do the switch function or if clause itself
// if( pMinutes[ playerid ] == 5 ){}// 5 minutes or
// if( pMinutes[ playerid ] == 2 ){}// 2 minutes and etc
}
}
}
