Jump to content
  • 0

Problema Examen Auto


Blue

Question

Problema intalnita (descriere): Salut. Am o problema cu permisul auto. Cand tastez comanda /exam as dorii ca sa imi urce automat jucatorul in vehicul. Acest lucru este functional, doar la 2 din vehicule. (Am 4 vehicule pentru examen). Deci functioneaza doar la primele 2 vehicule, la celelalte 2 nu. 
Ero(area / rile) / warning-(ul / urile): - 
Liniile de cod / sursa / script-ul(obligatoriu): 

  

Spoiler

     new bool:unwanted[CAR_AMOUNT];
        foreach (new player : Player)
         {
            if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)] = true; }
         }
         for(new car = DMVCar[1]; car <= DMVCar[4]; car++)
           {
            if(!unwanted[car]) PutPlayerInVehicle(playerid, car, 0);
        }

 

 


Imagini / Video (optional): - 
Ati incercat sa rezolvati singur?: Da. Am facut un printf, si am vazut ca imi citeste toate cele 4 vehicule, dar de ce nu imi urca aleatoriu in una din cele 4? imi urca doar in una din cele 2.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
    new bool:unwanted[CAR_AMOUNT];
        foreach (Player, i)
         {
            if(IsPlayerInAnyVehicle(i)) { unwanted[GetPlayerVehicleID(i)] = true; }
         }
         for(new car = 0; car <= sizeof(DMVCar); car++)
           {
            if(!unwanted[car]) PutPlayerInVehicle(i, car, 0);
        } 

 

Edited by [PAWN]Stark.7
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.