Mathematics question
#1

How would I go about doing this? (Refer mostly to the tax = ... part)

pawn Код:
forward UpdatePlayTime( );
public UpdatePlayTime ( )
{
    for( new u; u < MAX_PLAYERS; u ++ )
    {
        if( plLoggedIn [ u ] == true )
        {
            plStats [ u ] [ TimePlayedMins ] ++;
           
            if( plStats [ u ] [ TimePlayedMins ] >= 60 )
            {
                // Payday!
                new
                    wage = plStats [ u ] [ LumberjackWage ] + plStats [ u ] [ QuarryworkerWage ],
                    tax = plStats [ u ] [ LumberjackWage ] + plStats [ u ] [ QuarryworkerWage ] / 0.07,
                                    // tag mismatch ^
                    str [ 128 ];
                   
                plStats [ u ] [ Money ] += wage;
                plStats [ u ] [ LumberjackWage ] = 0, plStats [ u ] [ QuarryworkerWage ] = 0, plStats [ u ] [ TimePlayedMins ] = 0;
                plStats [ u ] [ TimePlayedHours ] ++;
               
                format( str, 128, "* You have earned $%d this paycheck. $%d in taxes were taken out.", wage, tax );
                SendClientMessage( u, Colour_LimeGreen, str );
            }
        }
    }
    return true;
}
Reply


Messages In This Thread
Mathematics question - by 2KY - 25.09.2012, 20:51
Re : Mathematics question - by Varkoll_ - 25.09.2012, 21:02
Re: Mathematics question - by 2KY - 25.09.2012, 21:05
Re: Mathematics question - by vIBIENNYx - 25.09.2012, 21:10
Re : Mathematics question - by Varkoll_ - 25.09.2012, 21:14
Re: Mathematics question - by Babul - 25.09.2012, 21:28
Re : Mathematics question - by Varkoll_ - 25.09.2012, 21:31

Forum Jump:


Users browsing this thread: 1 Guest(s)