Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Rrace

$
0
0
Hello iam using rRace system

If the autorace is enabled when a race finish it start a new one

i need to make it wait like 1 minute and start a new race automatic

PHP Code:

function LoadAutoRace(rName[])
{
    new
        
rFile[256],
        
string[256]
    ;
    
format(rFilesizeof(rFile), "/rRaceSystem/%s.RRACE"rName);
    if(!
dini_Exists(rFile)) return printf("Race \"%s\" doesn't exist!"rName);
    
strmid(RaceNamerName0strlen(rName), sizeof(RaceName));
    
RaceVehicle dini_Int(rFile"vModel");
    
RaceType dini_Int(rFile"rType");
    
TotalCP dini_Int(rFile"TotalCP");

    
#if DEBUG_RACE == 1
    
printf("VehicleModel: %d"RaceVehicle);
    
printf("RaceType: %d"RaceType);
    
printf("TotalCheckpoints: %d"TotalCP);
    
#endif

    
Loop(x2)
    {
        
format(stringsizeof(string), "vPosX_%d"x), RaceVehCoords[x][0] = dini_Float(rFilestring);
        
format(stringsizeof(string), "vPosY_%d"x), RaceVehCoords[x][1] = dini_Float(rFilestring);
        
format(stringsizeof(string), "vPosZ_%d"x), RaceVehCoords[x][2] = dini_Float(rFilestring);
        
format(stringsizeof(string), "vAngle_%d"x), RaceVehCoords[x][3] = dini_Float(rFilestring);
        
#if DEBUG_RACE == 1
        
printf("VehiclePos %d: %f, %f, %f, %f"xRaceVehCoords[x][0], RaceVehCoords[x][1], RaceVehCoords[x][2], RaceVehCoords[x][3]);
        
#endif
    
}
    
Loop(xTotalCP)
    {
         
format(stringsizeof(string), "CP_%d_PosX"x), CPCoords[x][0] = dini_Float(rFilestring);
         
format(stringsizeof(string), "CP_%d_PosY"x), CPCoords[x][1] = dini_Float(rFilestring);
         
format(stringsizeof(string), "CP_%d_PosZ"x), CPCoords[x][2] = dini_Float(rFilestring);
         
#if DEBUG_RACE == 1
         
printf("RaceCheckPoint %d: %f, %f, %f"xCPCoords[x][0], CPCoords[x][1], CPCoords[x][2]);
         
#endif
    
}
    
Position 0;
    
FinishCount 0;
    
JoinCount 0;
    
Loop(x2PlayersCount[x] = 0;
    
CountAmount COUNT_DOWN_TILL_RACE_START;
    
RaceTime MAX_RACE_TIME;
    
RaceBusy 0x01;
    
CountTimer SetTimer("CountTillRace"9991);
    
TimeProgress 0;
    return 
1;



Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>