Taxi Fare Meter
#4

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
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
You don't really need to check for each minute in this case because

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
        }
    }
   
}
Thanks mate, glad that I tried to help you
Reply


Messages In This Thread
Taxi Fare Meter - by Ballu Miaa - 09.04.2013, 02:53
Re: Taxi Fare Meter - by FalconX - 09.04.2013, 03:43
Re: Taxi Fare Meter - by Ballu Miaa - 09.04.2013, 04:15
Re: Taxi Fare Meter - by FalconX - 09.04.2013, 04:27
Re: Taxi Fare Meter - by Ballu Miaa - 09.04.2013, 04:33
Re: Taxi Fare Meter - by FalconX - 10.04.2013, 19:58

Forum Jump:


Users browsing this thread: 2 Guest(s)