Few questions
#3

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.

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;
}
Reply


Messages In This Thread
Few questions - by JaKe Elite - 27.12.2012, 07:36
Re: Few questions - by iggy1 - 27.12.2012, 08:34
Re: Few questions - by JaKe Elite - 27.12.2012, 09:07
Re: Few questions - by JaKe Elite - 28.12.2012, 09:45
Re: Few questions - by Threshold - 28.12.2012, 10:01

Forum Jump:


Users browsing this thread: 1 Guest(s)