27.12.2012, 09:07
Actually the loadrace i gave you is just a stock function.
Here is the real loadrace which has doesn't exist race message.
Anyways, The first problem has been fixed.
But the race problem is still not fixed.
Here is the real loadrace which has doesn't exist race message.
Anyways, The first problem has been fixed.
But the race problem is still not fixed.
pawn Код:
dcmd_loadrace(playerid, params[])
{
if(RaceAdmin == 1 && IsNotAdmin(playerid)) return 1;
Racemode = 0; Racelaps = 1;
new tmp[128], idx, fback;
tmp = strtok(params, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /loadrace [name]");
return 1;
}
if(RaceActive == 1)
{
SendClientMessage(playerid, COLOR_RED, "A race is already active!");
return 1;
}
fback=LoadRace(tmp);
if(Exist == -1) format(ystring,sizeof(ystring),"Race \'%s\' doesn't exist!",tmp);
else if (fback == -2) format(ystring,sizeof(ystring),"Race \'%s\' is created with a newer version of YRACE, cannot load.",tmp);
if(fback < 0)
{
SendClientMessage(playerid,COLOR_RED,ystring);
return 1;
}
format(ystring,sizeof(ystring),"Race \'%s\' loaded, /startrace to start it. You can change laps and mode before that.",CRaceName);
SendClientMessage(playerid,COLOR_GREEN,ystring);
if(LCurrentCheckpoint<2 && Racemode == 2)
{
Racemode = 1; // Racemode 2 doesn't work well with only 2CPs, and mode 1 is just the same when playing with 2 CPs.
} // Setting racemode 2 is prevented from racebuilder so this shouldn't happen anyways.
#if defined MENUSYSTEM
if(!IsValidMenu(MRace)) CreateRaceMenus();
if(Airrace == 0) SetMenuColumnHeader(MRace,0,"Air race: off");
else SetMenuColumnHeader(MRace,0,"Air race: ON");
TogglePlayerControllable(playerid,0);
ShowMenuForPlayer(MRace,playerid);
#endif
return 1;
}