05.11.2011, 20:35
Will this my be a long shot but does anyone know how i could record the fastest time that someone does a race at as i dont have a clue at all.
Many Thanks
Many Thanks
if(listitem == 4)
{
if(!IsPlayerInAnyVehicle(playerid)) return GameTextForPlayer(playerid, "You have to be in a vehicle!", 4000, 6 );
SetPlayerRaceCheckpoint(playerid, 0, -1763.769287,123.470710,3.672383, -1763.483764,-33.125278,10.852465, 10);
Westrace[playerid] = 1; // This will change the variable, so we can use it later on with OnPlayerEnterCheckpoint
SetVehiclePos( GetPlayerVehicleID( playerid ), -1765.4993,174.8689,6.7540);
currentveh = GetPlayerVehicleID(playerid);
SetVehicleZAngle(currentveh, 182.1981);
SetCameraBehindPlayer( playerid );
SendClientMessage(playerid, 0xFFFFFFFF, "You Start The West Coast Street Race. Please follow the checkpoints");
SendClientMessage(playerid, 0xFF0000FF, "Boost has been deactivated!");
SendClientMessage(playerid, 0xFF0000FF, "VUP has been deactivated!");
Westracetimer = SetTimer("Westraceclock", 1000, true);
P_DATA[ playerid ][ P_OnStyle ] = true;
P_DATA[ playerid ][ P_CarGod ] = 1;
P_DATA[ playerid ][ P_Vup ] = 0;
P_DATA[ playerid ][ P_Boost ] = 0;
return 1;
forward Westraceclock(playerid); // Also make a new SetTimerEx function in which you just add the number 1 in the funciton name.
public Westraceclock(playerid) {
if(iWestraceclock == -1) {
iWestraceclock = 61;
}
new
szMessage[10];
iWestraceclock--; // v down there, I have put ~n~ because that makes a new row, you don't want the timers to be in the same row and get one over an other.
format(szMessage, sizeof(szMessage), "~r~%d",iWestraceclock); // Add more in if you wish.
GameTextForPlayer(playerid, szMessage, 950, 6);
if(iWestraceclock == 0) {
KillTimer(Westracetimer);
DisablePlayerRaceCheckpoint(playerid);
P_DATA[ playerid ][ P_OnStyle ] = false;
}
return 1;
}