Jump to content

Question

Posted

Salut, cand vreau sa dau de licenta auto si scriu /exam, ma spawneaza in masina si dupa o paraseste, iesa pur si simplu din ea

Citat

CMD:exam(playerid, params[])
{
    if( playerVariables[ playerid ][ pDriveLicense ] ) return SCM( playerid, -1, "Ai deja licenta auto!");
    if(playerVariables[playerid][pAdminLevel] == 0)
    {
        if(playerVariables[playerid][pDriveLicense] == 0)
         {
              if(PlayerToPoint(3.0,playerid,1110.7068,-1798.3063,16.5938))
              {
                  if(TakingLesson[playerid] == 0)
                  {
                    new countz;
                    for(new v = 0; v <= MAX_VEHICLES; v++)
                    {
                        if(IsADmvCar(v))
                        {
                            if(!IsVehicleOccupied(v))
                            {
                                countz++;
                                SetVehicleToRespawn(v);
                                PutPlayerInVehicle(playerid, v, 0);
                                TakingLesson[playerid] = 1;
                                CPR[playerid] = 100;
                                SetPlayerRaceCheckpoint(playerid, 0,checkexam[0][0],checkexam[0][1],checkexam[0][2],checkexam[1][0],checkexam[1][1],checkexam[1][2],5.0);
                                TextDrawSetString(DMV2[playerid], "Checkpoints: 0/11");
                                TextDrawShowForPlayer(playerid, DMV1[playerid]);
                                TextDrawShowForPlayer(playerid, DMV2[playerid]);
                                break;
                            }
                        }
                    }
                    if(countz == 0)
                    {
                        SendClientMessage(playerid, -1, "There are no available vehicles at the DMV!");
                        TakingLesson[playerid] = 0;
                    }
                    else
                    {
                        SCM(playerid, -1, "Follow these checkpoint to pass the DMV exam.");
                    }
                }
                else
                {
                    SendClientMessage(playerid, -1, "You are already taking the exam!");
                }
            }
            else return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: You are not at the DMV!");
          }
        else return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: You already have a driving license!");
    }
    else
    {
        new countz;
        TakingLesson[playerid] = 1;
        for(new v = 0; v <= MAX_VEHICLES; v++)
        {
            if(IsADmvCar(v))
            {
                if(!IsVehicleOccupied(v))
                {
                    countz++;
                    SetVehicleToRespawn(v);
                    PutPlayerInVehicle(playerid, v, 0);
                    TakingLesson[playerid] = 1;
                    CPR[playerid] = 100;
                    SetPlayerRaceCheckpoint(playerid, 0,checkexam[0][0],checkexam[0][1],checkexam[0][2],checkexam[1][0],checkexam[1][1],checkexam[1][2],5.0);
                    TextDrawSetString(DMV2[playerid], "Checkpoints: 0/15");
                    TextDrawShowForPlayer(playerid, DMV1[playerid]);
                    TextDrawShowForPlayer(playerid, DMV2[playerid]);
                    break;
                }
            }
        }
        if(countz == 0)
        {
            SendClientMessage(playerid, -1, "There are no available vehicles at the DMV!");
            TakingLesson[playerid] = 0;
        }
        else
        {
            SCM(playerid, -1, "Follow these checkpoint to pass the DMV exam.");
        }
    }
    return 1;
}

 

2 answers to this question

Recommended Posts

  • 0
Posted

Comanda e perfect normala. Probabil ceea ce iti afecteaza sistemul DMV e in callbacks sau timers. Incearca sa verifici "OnPlayerStateChange" sau "OnPlayerEnterVehicle".

  • 0
Posted
La 25.05.2016 la 21:10, Lumineux a spus:

Comanda e perfect normala. Probabil ceea ce iti afecteaza sistemul DMV e in callbacks sau timers. Incearca sa verifici "OnPlayerStateChange" sau "OnPlayerEnterVehicle".

Sau poate are ceva in gamemode, si daca nu are licenta il arunca din masina.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.