Problem sa proverom vozila

Započeo cofilinko, Jul 26, 2023, 23:27:22 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning): Napravio sam proveru da li je vozilo odgovarajuce za posao vozaca goriva. Problem je sada taj sto on hvata jedino ID vozila 1 kao odgovarajuce vozilo dok sva ostala vozila tog posla ne registruje.
Deo skripte: [pawn]
new VozacGorivaVeh[11];
public OnGameModeInit()
{
   //-------------------------------------------------------------------------- KAMIONI
   VozacGorivaVeh[0] = CreateVehicle(514, 2596.3926, -2212.4336, 14.0447, 180.0000, 1, 1, -1);
   VozacGorivaVeh[1] = CreateVehicle(514, 2603.4221, -2212.4763, 14.0447, 180.0000, 1, 1, -1);
   VozacGorivaVeh[2] = CreateVehicle(514, 2609.8918, -2212.5789, 14.0447, 180.0000, 1, 1, -1);
   VozacGorivaVeh[3] = CreateVehicle(514, 2617.0601, -2212.5208, 14.0447, 180.0000, 1, 1, -1);
   VozacGorivaVeh[4] = CreateVehicle(514, 2565.0078, -2258.9026, 14.0954, 0.0000, 1, 1, -1);
   VozacGorivaVeh[5] = CreateVehicle(514, 2571.3962, -2258.8706, 14.0954, 0.0000, 1, 1, -1);
   VozacGorivaVeh[6] = CreateVehicle(514, 2578.3354, -2258.7090, 14.0954, 0.0000, 1, 1, -1);
   VozacGorivaVeh[7] = CreateVehicle(514, 2585.5613, -2258.6021, 14.0954, 0.0000, 1, 1, -1);
   VozacGorivaVeh[8] = CreateVehicle(514, 2592.9666, -2258.3765, 14.0954, 0.0000, 1, 1, -1);
   VozacGorivaVeh[9] = CreateVehicle(514, 2599.8921, -2258.2622, 14.0954, 0.0000, 1, 1, -1);
   VozacGorivaVeh[10] = CreateVehicle(514, 2609.0984, -2258.3093, 14.0954, 0.0000, 1, 1, -1);
   //-------------------------------------------------------------------------- PRIKOLICE
   CreateVehicle(584, 2596.3718, -2200.1306, 14.5420, 180.0000, 1, 1, -1);
   CreateVehicle(584, 2603.4189, -2200.1882, 14.5420, 180.0000, 1, 1, -1);
   CreateVehicle(584, 2609.8296, -2200.4592, 14.5420, 180.0000, 1, 1, -1);
   CreateVehicle(584, 2617.0757, -2200.4104, 14.5420, 180.0000, 1, 1, -1);
   CreateVehicle(584, 2565.0222, -2271.1973, 14.5169, 0.0000, 1, 1, -1);
   CreateVehicle(584, 2571.3831, -2271.1501, 14.5169, 0.0000, 1, 1, -1);
   CreateVehicle(584, 2578.3076, -2271.0437, 14.5169, 0.0000, 1, 1, -1);
   CreateVehicle(584, 2585.5496, -2271.0439, 14.5169, 0.0000, 1, 1, -1);
   CreateVehicle(584, 2592.9507, -2270.7939, 14.5169, 0.0000, 1, 1, -1);
   CreateVehicle(584, 2599.8853, -2270.5708, 14.5169, 0.0000, 1, 1, -1);
   CreateVehicle(584, 2609.1365, -2270.5515, 14.5169, 0.0000, 1, 1, -1);
   //--------------------------------------------------------------------------
        return 1;
}
stock GorivoVeh(carid)
{
   for(new i = 0; i < sizeof(VozacGorivaVeh); i++)
   {
       if(carid == VozacGorivaVeh)
       return 1;
   }
   return 0;
}
CMD:prevozgoriva(playerid, params[])
{
    if(Ulogovan[playerid] != 1) return SendClientMessage(playerid, CRVENA, "GRESKA: {ffffff}Morate se prvo prijaviti.");
    if(PlayerInfo[playerid][pPosao] != 2) return SendClientMessage(playerid, CRVENA, "GRESKA: {ffffff}Niste zaposleni kao Vozac goriva.");
    if(JobDuty[playerid] != 1) return SendClientMessage(playerid, CRVENA, "GRESKA: {ffffff}Morate uzeti duznost kako bi radili posao. {e0b819}/jobduty.");
      if(VoziGorivo[playerid] != 0) return SendClientMessage(playerid, CRVENA, "GRESKA: {ffffff}Vec ste u poslu. {e0b819}/prekiniposao.");
   new vehicle;
   vehicle = GetPlayerVehicleID(playerid);
   if(!IsTrailerAttachedToVehicle(vehicle)) return SendClientMessage(playerid, CRVENA, "GRESKA: {ffffff}Nemate zakacenu prikolicu.");
   if(GetPlayerVehicleID(playerid) != GorivoVeh(vehicle)) return SendClientMessage(playerid, CRVENA, "GRESKA: {ffffff}Niste u kamionu za prevoz goriva.");
   SetPlayerCheckpoint(playerid, 2482.7244,-2218.2847,13.2739, 3);
   VoziGorivo[playerid] = 1;
   SendClientMessage(playerid, SIVA, "* Zapoceli ste razvoz goriva. Pratite markere.");
   return 1;
}
[/pawn]
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log):
Slika/video ingame problema(obavezno ako je ingame problem): https://streamable.com/gio19n
Poslednja Izmena: Jul 26, 2023, 23:31:59 POSLE PODNE od cofilinko
Aj napuni pun i vozi odavde,
na autoput u najveci krug,
da najbolje razmislim ko mi je drug.

Fixano.
[pawn]if(!GorivoVeh(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid, CRVENA, "GRESKA: {ffffff}Niste u kamionu za prevoz goriva.");[/pawn]
Aj napuni pun i vozi odavde,
na autoput u najveci krug,
da najbolje razmislim ko mi je drug.