Jump to content
  • 0

Problema DMV


420

Question

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

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.