[Pomoc] Oko posla Vozac Goriva i pumpe

Započeo Markoni990
3. Sep. 2014. Zaključano
478
pregleda
8
postova
Markoni990
4
Shot Caller
3. Sep. 2014.
Skripta koju koristim: GTA RP
Detaljan opis problema: Pozz, ako neko moze da mi pomogne da napravim za posao vozac goriva da ide naprimer u las venturas da natoci gorivo ali da natoci naprimer 1000 l, ali da postoji neki rezervar na pumpi da prikazuje 10000l ima goriva i kad to nestane da nmg da toce gorivo, sve dok vozac goriva ne napuni taj rezervar pumpe. E sad ja znam da se zapocinje if(BizzInfo[ID firme] >= LitaraKupujesKodFill) ali neznam kako dalje.Hvala Unapred
Dio skripte:
//////////////////////////////////////////////VOZAC GORIVA////////////////////////////////////////////////
  if(CP ==1600 && IsAGorivo(carid)&& IsTrailerAttachedToVehicle(carid)) { CP = 1601; TogglePlayerControllable(playerid, 0); Gorivo12 = 1; GameTextForPlayer(playerid, "~b~Sacekaj da se gorivo~n~~g~istoci", 3000, 4);TogglePlayerControllable(playerid, 0); SetTimerEx("Gorivo2",13000, false, "i", playerid); DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 1937.2955,-1776.0560,13.3828,10.0); }
    else if(CP == 1601 && IsAGorivo(carid)&& IsTrailerAttachedToVehicle(carid)) { CP = 1602; TogglePlayerControllable(playerid, 0); Gorivo12 = 1; GameTextForPlayer(playerid, "~b~Sacekaj da se gorivo~n~~g~istoci", 3000, 4);TogglePlayerControllable(playerid, 0); SetTimerEx("Gorivo2",13000, false, "i", playerid); DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 1004.9973,-940.4534,42.1797,10.0); }
    else if(CP == 1602 && IsAGorivo(carid)&& IsTrailerAttachedToVehicle(carid)) { CP = 1603; TogglePlayerControllable(playerid, 0); Gorivo12 = 1; GameTextForPlayer(playerid, "~b~Sacekaj da se gorivo~n~~g~istoci", 3000, 4);TogglePlayerControllable(playerid, 0); SetTimerEx("Gorivo2",13000, false, "i", playerid); DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 651.6285,-564.7838,16.3301,10.0); }
else if(CP == 1603 && IsAGorivo(carid)&& IsTrailerAttachedToVehicle(carid)) { CP = 1604; TogglePlayerControllable(playerid, 0); Gorivo12 = 1; GameTextForPlayer(playerid, "~b~Sacekaj da se gorivo~n~~g~istoci", 3000, 4);TogglePlayerControllable(playerid, 0); SetTimerEx("Gorivo2",13000, false, "i", playerid); DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 1380.9648,456.1190,19.8869,10.0); }
else if(CP == 1604 && IsAGorivo(carid)&& IsTrailerAttachedToVehicle(carid)) { CP = 1605; TogglePlayerControllable(playerid, 0); Gorivo12 = 1; GameTextForPlayer(playerid, "~b~Sacekaj da se gorivo~n~~g~istoci", 3000, 4);TogglePlayerControllable(playerid, 0); SetTimerEx("Gorivo2",13000, false, "i", playerid); DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -98.0867,-1167.2094,2.5977,10.0); }
    else if(CP == 1605 && IsAGorivo(carid)&& IsTrailerAttachedToVehicle(carid)) { CP = 1606; TogglePlayerControllable(playerid, 0); Gorivo12 = 1; GameTextForPlayer(playerid, "~b~Sacekaj da se gorivo~n~~g~istoci", 3000, 4);TogglePlayerControllable(playerid, 0); SetTimerEx("Gorivo2",13000, false, "i", playerid); DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 2430.8547,-2113.4102,13.5469,10.0); }
else if(CP == 1606 && IsAGorivo(carid)&& IsTrailerAttachedToVehicle(carid)) { CP = 1607; TogglePlayerControllable(playerid, 0); Gorivo12 = 1; GameTextForPlayer(playerid, "~r~Zavrsili ste ~n~~g~posao", 3000, 4);TogglePlayerControllable(playerid, 0); SetTimerEx("Gorivo2",13000, false, "i", playerid); DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 2509,-2089,13.54,10.0); }
  if(CP == 1607 && IsAGorivo(carid)&& IsTrailerAttachedToVehicle(carid))
  {
        new randpay = 1750 + random(165);
PlayerInfo += randpay;
TogglePlayerControllable(playerid, 1);
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, 0x8D531AFF, "-----------");
format(string, sizeof(string), "Zarada: %d$.", randpay);
SendClientMessage(playerid, 0x9A6735FF, string);
SendClientMessage(playerid, 0xB89571FF, "-----------");
    SBizzInfo += 500;
    ExtortionSBiz(3, 500);
    SBizzInfo--;
Gorivo12 = 1;
PlayerInfo = 0;
new taj = GetVehicleTrailer(carid);
SetVehicleToRespawn(taj);
    }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
if(strcmp(cmd, "/gorivo", true) == 0)
{
new veh = GetPlayerVehicleID(playerid);
if(PlayerInfo == 4)
      {
if(IsAGorivo(veh))
{
if(PlayerInfo == 0)
{
CP = 1600;
SendClientMessage(playerid, COLOR_WHITE, "{995031}Zakaci prikolicu i idi do {F81414}crvenog markera!");
SendClientMessage(playerid, COLOR_WHITE, "{995031}Kad pokupite crveni marker pratite {F81414}crvene markere!");
PlayerInfo = 1;
SetPlayerCheckpoint(playerid, 2858,-2002,10.9, 8.0);

}
else return SendClientMessage(playerid, COLOR_WHITE, "{995031}Vec prevozis gorivo!");
}
else return SendClientMessage(playerid, COLOR_WHITE, "{995031}Niste u kamionu za prevozenje goriva!");
}
else return SendClientMessage(playerid, COLOR_WHITE, "{995031}Niste vozac goriva!");
return 1;
}
if(strcmp(cmd, "/zavrsigorivo", true) == 0)
{
if(PlayerInfo == 4)
{
if(PlayerInfo == 1)
{
CP = 0;
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, 0xADADADFF, "{995031} Prekinuli ste dostavu goriva!");
PlayerInfo = 0;
}
else return SendClientMessage(playerid, COLOR_WHITE, "{995031}Ne prevozis gorivo!");
}
else return SendClientMessage(playerid, COLOR_WHITE, "{995031}Nisi vozac goriva!");
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno): //
Amar Tinjak
4
Enforcer
3. Sep. 2014.
posto nisam upoznat sa enum i variablama , ovako uradi . znaci nakon sto ode tamo da mu da i oduzme od tog kanistera sa pumpe .
Markoni990
4
Shot Caller
3. Sep. 2014.
Cek nisam te razumeo bas najbolje, objasni malo ili daj neki kod. 🙂
Markoni990
4
Shot Caller
4. Sep. 2014.
JEL ZNA NEKO? 🙂
Acke
4
Enforcer
4. Sep. 2014.
moras prvo napraviti variablu za kolicinu goriva na pumpama,npr:
Da bi napravio da prikazuje koliko ima goriva da radis preko 3DTextLabel funkcije:
new gorivonapumpi = 10000;
new gorviostrin;
format(gorivostring,256,"{00CCFF}Benzinska pumpa rezervoar:\n{FFFFFF}%d Litara",gorivonapumpi);
GorvioPumpaLabel = Create3DTextLabel(avlstring,0x00C3FFFF,211.0494,1874.8359,-25.0267,80.0,0);// Promenis kordinate sa tvojima

Sada nadji komandu u modu ili gde ti deo gde igrac sipa gorivo, pa u toj komandi dodaj sledece:
new rand = 10 + (0); // Ovo stoji ako gledamo da igrac uvek sipa 10l goriva to prilagodi sebi kako hoces
gorivonapumpi -= rand;
KolicinaGorivaPumpa();
Delete3DTextLabel(GorivoPumpaLabel);
new gorivostring;
format(gorivostring,256,"{00CCFF}Benzinska pumpa rezervoar:\n{FFFFFF}%d Litara",gorivonapumpi);
GorivoPumpaLabel = Create3DTextLabel(avlstring,0x00C3FFFF,211.0494,1874.8359,-25.0267,80.0,0);// Ovde stavis tvoje kordinate


I da bi ti se sve to sacuva posle restarta servera dodas negde na pocetku skripte:
forward GorivonaPumpi();
public GorivoNaPumpi()
{
new strFromFile, arrCoords, File: file = fopen("Podesavanje/Gorivonapumpi/Gorivonapumpi.txt", io_read);
if (file)
{
    fread(file, strFromFile);
    razdvoji(strFromFile, arrCoords, ',');
gorivonapumpi = strval (arrCoords);
fclose(file);
}
return 1;
}

forward KolicinaGorivaPumpa();
public KolicinaGorivaPumpa()
{
new coordstring;
format(coordstring, sizeof(coordstring), "%d", gorivonapumpi);
new File: file = fopen("Podesavanje/Gorivonapumpi/Gorivonapumpi.txt", io_write);
fwrite(file, coordstring);
fclose(file);
new stringa;
Delete3DTextLabel(GorivoPumpaLabel);
format( stringa,sizeof(stringa),"{00CCFF}Benzisnka pumpa rezervoar:\n{FFFFFF}%d Litara ",gorivonapumpi);
(GorivoPumpaLabel) = Create3DTextLabel(stringa,0x00C3FFFF,211.0494,1874.8359,-25.0267,80.0,0);// Kolicina goriva na pumpi ovde promenis kordinate
return 1;
}

// I pod OnGameModeInit dodas:

KolicinaGorivaPumpa();


To je za rezervoar na pumpi, sada za rezervoar kada ide po gorivo:
/////////////////////////////////////////////VOZAC GORIVA////////////////////////////////////////////////
  if(CP ==1600 && IsAGorivo(carid)&& IsTrailerAttachedToVehicle(carid)) { CP = 1601; TogglePlayerControllable(playerid, 0); Gorivo12 = 1; GameTextForPlayer(playerid, "~b~Sacekaj da se gorivo~n~~g~istoci", 3000, 4);TogglePlayerControllable(playerid, 0); SetTimerEx("Gorivo2",13000, false, "i", playerid); DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 1937.2955,-1776.0560,13.3828,10.0); }
    else if(CP == 1601 && IsAGorivo(carid)&& IsTrailerAttachedToVehicle(carid)) { CP = 1602; TogglePlayerControllable(playerid, 0); Gorivo12 = 1; GameTextForPlayer(playerid, "~b~Sacekaj da se gorivo~n~~g~istoci", 3000, 4);TogglePlayerControllable(playerid, 0); SetTimerEx("Gorivo2",13000, false, "i", playerid); DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 1004.9973,-940.4534,42.1797,10.0); }
    else if(CP == 1602 && IsAGorivo(carid)&& IsTrailerAttachedToVehicle(carid)) { CP = 1603; TogglePlayerControllable(playerid, 0); Gorivo12 = 1; GameTextForPlayer(playerid, "~b~Sacekaj da se gorivo~n~~g~istoci", 3000, 4);TogglePlayerControllable(playerid, 0); SetTimerEx("Gorivo2",13000, false, "i", playerid); DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 651.6285,-564.7838,16.3301,10.0); }
else if(CP == 1603 && IsAGorivo(carid)&& IsTrailerAttachedToVehicle(carid)) { CP = 1604; TogglePlayerControllable(playerid, 0); Gorivo12 = 1; GameTextForPlayer(playerid, "~b~Sacekaj da se gorivo~n~~g~istoci", 3000, 4);TogglePlayerControllable(playerid, 0); SetTimerEx("Gorivo2",13000, false, "i", playerid); DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 1380.9648,456.1190,19.8869,10.0); }
else if(CP == 1604 && IsAGorivo(carid)&& IsTrailerAttachedToVehicle(carid)) { CP = 1605; TogglePlayerControllable(playerid, 0); Gorivo12 = 1; GameTextForPlayer(playerid, "~b~Sacekaj da se gorivo~n~~g~istoci", 3000, 4);TogglePlayerControllable(playerid, 0); SetTimerEx("Gorivo2",13000, false, "i", playerid); DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -98.0867,-1167.2094,2.5977,10.0); }
    else if(CP == 1605 && IsAGorivo(carid)&& IsTrailerAttachedToVehicle(carid)) { CP = 1606; TogglePlayerControllable(playerid, 0); Gorivo12 = 1; GameTextForPlayer(playerid, "~b~Sacekaj da se gorivo~n~~g~istoci", 3000, 4);TogglePlayerControllable(playerid, 0); SetTimerEx("Gorivo2",13000, false, "i", playerid); DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 2430.8547,-2113.4102,13.5469,10.0); }
else if(CP == 1606 && IsAGorivo(carid)&& IsTrailerAttachedToVehicle(carid)) { CP = 1607; TogglePlayerControllable(playerid, 0); Gorivo12 = 1; GameTextForPlayer(playerid, "~r~Zavrsili ste ~n~~g~posao", 3000, 4);TogglePlayerControllable(playerid, 0); SetTimerEx("Gorivo2",13000, false, "i", playerid); DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 2509,-2089,13.54,10.0); }
  if(CP == 1607 && IsAGorivo(carid)&& IsTrailerAttachedToVehicle(carid))
  {
        new randpay = 1750 + random(165);
PlayerInfo += randpay;
TogglePlayerControllable(playerid, 1);
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, 0x8D531AFF, "-----------");
format(string, sizeof(string), "Zarada: %d$.", randpay);
SendClientMessage(playerid, 0x9A6735FF, string);
SendClientMessage(playerid, 0xB89571FF, "-----------");
    new random;
    random = 10 + (0);
    gorivonapumpi += random; // Evo napravio sam da do kada zavrsi to da se gorivo na pumpama poveca za 10..
    GorivoNaPumpi();
SBizzInfo += 500;
    ExtortionSBiz(3, 500);
    SBizzInfo--;
Gorivo12 = 1;
PlayerInfo = 0;
new taj = GetVehicleTrailer(carid);
SetVehicleToRespawn(taj);
    }


Nadam se da sam ti pomogao 😄
Markoni990
4
Shot Caller
5. Sep. 2014.
Hvala brt jel ovo samo za jednu pumpu ili za sve 4 - 5 pumpe sto se nalaze u lv,posto ja hocu da stavim na sve 5 pumpe da pise svaki rezervar posebno i onda da kad isprazne tu rezervu da nmg da toce vise?
Imam jedan warning
(91628) : warning 235: public function lacks forward declaration (symbol "GorivoNaPumpi")
forward GorivonaPumpi();
public GorivoNaPumpi() // Na ovoj liniji warning
{
new strFromFile, arrCoords, File: file = fopen("Podesavanje/Gorivonapumpi/Gorivonapumpi.txt", io_read);
if (file)
{
    fread(file, strFromFile);
    razdvoji(strFromFile, arrCoords, ',');
gorivonapumpi = strval (arrCoords);
fclose(file);
}
return 1;
}
Markoni990
4
Shot Caller
5. Sep. 2014.
I pokazuje mi da mi kanister pun, i nmg da sipam gorivo, valjda treba kad sipam gorivo da ide u - a ne da ga dopunjava.🙂
aleluja
5
Godfather
5. Sep. 2014.


Molimo te da procitas pravila foruma te da onda otvoris temu po pravilima.

Razlog zakljucavanja:

dp/bump možeš raditi svako 24h

Pravila:

Glavna pravila Balkan SA:MP foruma .
Razgovor u vezi PAWN-Skriptanja .

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha