22.08.2012, 12:29
Hi guys
I creating my own race system for my server. I made a mini-system for best racer, and best race time. When a player beats the old record with 3-4 minutes faster, the message what need to be showed to all people, aren't showing.
Here is my code:
rTime[ 0 ] - Current racer minutes
rTime[ 1 ] - Current racer seconds
rTime[ 2 ] - Current racer miliseconds.
Can somebody fix these codes?
PS> Sorry for some expressions mistakes xD
I creating my own race system for my server. I made a mini-system for best racer, and best race time. When a player beats the old record with 3-4 minutes faster, the message what need to be showed to all people, aren't showing.
Here is my code:
pawn Код:
if ( p_Position[ r_IDEx ] < 2 )
{
new
r_TotalResult[ MAX_RACES ]
;
if ( R_DATA[ r_IDEx ][ r_BestRacerTime_0 ] > rTime[ 0 ] )
{
print( "minute" );
format( gsString, sizeof gsString, "RACE: {FFFF00}%s has broken the old record '%d:%d:%d' in '%s' race with %d minute(s) faster.", PlayerName( playerid ), R_DATA[ r_IDEx ][ r_BestRacerTime_0 ], R_DATA[ r_IDEx ][ r_BestRacerTime_1 ], R_DATA[ r_IDEx ][ r_BestRacerTime_2 ], R_DATA[ r_IDEx ][ r_Name ], R_DATA[ r_IDEx ][ r_BestRacerTime_0 ] - rTime[ 0 ] );
print( "minute" );
}
else if ( R_DATA[ r_IDEx ][ r_BestRacerTime_0 ] == R_DATA[ r_IDEx ][ r_BestRacerTime_1 ] && R_DATA[ r_IDEx ][ r_BestRacerTime_1 ] > rTime[ 1 ] && R_DATA[ r_IDEx ][ r_BestRacerTime_2 ] > rTime[ 2 ] || R_DATA[ r_IDEx ][ r_BestRacerTime_2 ] < rTime[ 2 ] )
{
print( "secunde" );
format( gsString, sizeof gsString, "RACE: {FFFF00}%s has broken the old record '%d:%d:%d' in '%s' race with %d second(s) faster.", PlayerName( playerid ), R_DATA[ r_IDEx ][ r_BestRacerTime_0 ], R_DATA[ r_IDEx ][ r_BestRacerTime_1 ], R_DATA[ r_IDEx ][ r_BestRacerTime_2 ], R_DATA[ r_IDEx ][ r_Name ], R_DATA[ r_IDEx ][ r_BestRacerTime_1 ] - rTime[ 1 ] );
print( "secunde" );
}
else if ( R_DATA[ r_IDEx ][ r_BestRacerTime_0 ] == R_DATA[ r_IDEx ][ r_BestRacerTime_1 ] && R_DATA[ r_IDEx ][ r_BestRacerTime_1 ] == rTime[ 1 ] && R_DATA[ r_IDEx ][ r_BestRacerTime_2 ] > rTime[ 2 ] )
{
print( "milisecunde" );
format( gsString, sizeof gsString, "RACE: {FFFF00}%s has broken the old record '%d:%d:%d' in '%s' race with %d miliseconds faster.", PlayerName( playerid ), R_DATA[ r_IDEx ][ r_BestRacerTime_0 ], R_DATA[ r_IDEx ][ r_BestRacerTime_1 ], R_DATA[ r_IDEx ][ r_BestRacerTime_2 ], R_DATA[ r_IDEx ][ r_Name ], R_DATA[ r_IDEx ][ r_BestRacerTime_2 ] - rTime[ 2 ] );
print( "milisecunde" );
}
else print("unknown clause");
SendClientMessageToAll( COLOR_ULTRARED, gsString );
printf( "%s", gsString );
R_DATA[ r_IDEx ][ r_BestRacerTime_0 ] = rTime[ 0 ];
R_DATA[ r_IDEx ][ r_BestRacerTime_1 ] = rTime[ 1 ];
R_DATA[ r_IDEx ][ r_BestRacerTime_2 ] = rTime[ 2 ];
format( R_DATA[ r_IDEx ][ r_BestRacer ], 25, "%s", PlayerName( playerid ) );
}
rTime[ 1 ] - Current racer seconds
rTime[ 2 ] - Current racer miliseconds.
Can somebody fix these codes?
PS> Sorry for some expressions mistakes xD