Race system
#1

I want to switch somethings from rRace to Yagu's race

PHP код:
function LoadRace(playeridrName[])
{
    new
        
rFile[256],
        
string[256]
    ;
    
format(rFilesizeof(rFile), "/rRaceSystem/%s.RRACE"rName);
    if(!
dini_Exists(rFile)) return SendClientMessage(playeridRED"<!> Race doesn't exist!"), 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;
    
Joined[playerid] = true;
    
CountAmount COUNT_DOWN_TILL_RACE_START;
    
RaceTime MAX_RACE_TIME;
    
RaceBusy 0x01;
    
TimeProgress 0;
    
SetupRaceForPlayer(playerid);
    
CountTimer SetTimer("CountTillRace"9991);
    return 
1;

PHP код:
CMD:loadrace(playeridparams[])
{
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playeridredcolor"<!> You are not an administrator!");
    if(
AutomaticRace == true) return SendClientMessage(playeridredcolor"<!> Not possible. Automatic race is enabled!");
    if(
BuildRace != 0) return SendClientMessage(playeridredcolor"<!> There's someone building a race!");
    if(
RaceBusy == 0x01 || RaceStarted == 1) return SendClientMessage(playeridredcolor"<!> There's a race currently. Wait first till race ends!");
    if(
isnull(params)) return SendClientMessage(playeridredcolor"<!> /loadrace [racename]");
    
LoadRace(playeridparams);
    new 
IRC[100+1000];
    
format(IRCsizeof(IRC), "0,13* Admin %s (ID: %d) has loaded the race %s.",GetName(playerid),playeridparams);
    
IRC_GroupSay(groupIDIRC_CHANNELIRC);
    return 
1;

I want to make that in to parts when an admin load an race he use load to load it and /startrace to start it before the the countdown finish to start the race normaly
Reply
#2

Any help?
Reply
#3

If you can't do that yourself, I don't know how you're scripting...
Reply
#4

Quote:
Originally Posted by Logic_
Посмотреть сообщение
If you can't do that yourself, I don't know how you're scripting...
I can script but i have some problems in that part i tried but have problems
Reply
#5

Then show it to us.
Reply
#6

Quote:
Originally Posted by Logic_
Посмотреть сообщение
Then show it to us.
Show what?
Reply
#7

Quote:
Originally Posted by Logic_
Посмотреть сообщение
Then show it to us.
IF you mean the codes i removed because it damaged all the race system cause of that am here
Reply
#8

The countdown

PHP код:
https://pastebin.com/SaW5Epm8 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)