Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //-------------------------
- stock allocatePlayerVehicle(const playerid, const slot, const vehicleid) {
- switch (slot) {
- case 1: {
- PlayerInfo[playerid][vehicleKeyOne] = vehicleid;
- PodesiVozilo(playerid, vehicleid);
- printf("* TEST >> Kupuva vozilo vo salon: %d | %s", vehicleid, GetName(playerid));
- }
- case 2: {
- PlayerInfo[playerid][vehicleKeyTwo] = vehicleid;
- PodesiVozilo(playerid, vehicleid);
- printf("* TEST >> Kupuva vozilo vo salon: %d | %s", vehicleid, GetName(playerid));
- }
- case 3: {
- PlayerInfo[playerid][vehicleKeyThree] = vehicleid;
- PodesiVozilo(playerid, vehicleid);
- printf("* TEST >> Kupuva vozilo vo salon: %d | %s", vehicleid, GetName(playerid));
- }
- case 4: {
- PlayerInfo[playerid][vehicleKeyFour] = vehicleid;
- PodesiVozilo(playerid, vehicleid);
- printf("* TEST >> Kupuva vozilo vo salon: %d | %s", vehicleid, GetName(playerid));
- }
- case 5: {
- PlayerInfo[playerid][vehicleKeyFive] = vehicleid;
- PodesiVozilo(playerid, vehicleid);
- printf("* TEST >> Kupuva vozilo vo salon: %d | %s", vehicleid, GetName(playerid));
- }
- case 6: {
- PlayerInfo[playerid][vehicleKeySix] = vehicleid;
- PodesiVozilo(playerid, vehicleid);
- printf("* TEST >> Kupuva vozilo vo salon: %d | %s", vehicleid, GetName(playerid));
- }
- case 7: {
- PlayerInfo[playerid][vehicleKeySeven] = vehicleid;
- PodesiVozilo(playerid, vehicleid);
- printf("* TEST >> Kupuva vozilo vo salon: %d | %s", vehicleid, GetName(playerid));
- }
- case 8: {
- PlayerInfo[playerid][vehicleKeyEight] = vehicleid;
- PodesiVozilo(playerid, vehicleid);
- printf("* TEST >> Kupuva vozilo vo salon: %d | %s", vehicleid, GetName(playerid));
- }
- }
- SalonKupuje[SalonID[playerid]] = -1;
- SalonID[playerid] = -1;
- UnistiAuta(playerid);
- vTypedTimes[playerid] = false;
- new vehCheck[69];
- mysql_format(SQL, vehCheck, sizeof vehCheck, "SELECT `ID` FROM `auta` WHERE `Vlasnik` = '%e'", GetName(playerid));
- mysql_tquery(SQL, vehCheck, "ChampinProvjeriVoz", "ii", playerid, 0);
- INFO(playerid, "Vasite vozila se unisteni, da gi vratite /v");
- return 1;
- }
- //--------------------------------
- if(dialogid == D_KUPOVINAVOZILA)
- {
- if(!response) return true;
- if(response)
- {
- new idsalona = GledaKatalog[playerid];
- new voziloporedu = ListaVozila[playerid];
- new vehicleid = getFreeArrayID(keyVehicle); // Nabavi zadnji id auta iz baze (Iako nije proso sve uslove) (Isti thread ko samp)
- if(SaloniInfo[idsalona][saOGModela][voziloporedu] <= 0) return GRESKA(playerid,"Nemamo vise tih modela!");
- if(PlayerInfo[playerid][pCash] < SaloniInfo[idsalona][saCena][voziloporedu]) return GRESKA(playerid,"Nemate dovolno pari!");
- //
- if(PlayerInfo[playerid][vehicleKeyOne] == -1) return allocatePlayerVehicle(playerid, 1, vehicleid);
- if(PlayerInfo[playerid][vehicleKeyTwo] == -1) return allocatePlayerVehicle(playerid, 2, vehicleid);
- if(PlayerInfo[playerid][vehicleKeyThree] == -1) return allocatePlayerVehicle(playerid, 3, vehicleid);
- // DONATE
- // slot 4
- if(PlayerInfo[playerid][vehicleKeyFour] == -1 && PlayerInfo[playerid][donateSlot] >= 1) return allocatePlayerVehicle(playerid, 4, vehicleid);
- if(PlayerInfo[playerid][vehicleKeyFour] == -1 && PlayerInfo[playerid][pVip] >= 6) return allocatePlayerVehicle(playerid, 4, vehicleid);
- // slot 5
- if(PlayerInfo[playerid][vehicleKeyFive] == -1 && PlayerInfo[playerid][donateSlot] >= 2) return allocatePlayerVehicle(playerid, 5, vehicleid);
- if(PlayerInfo[playerid][vehicleKeyFive] == -1 && PlayerInfo[playerid][pVip] >= 6) return allocatePlayerVehicle(playerid, 5, vehicleid);
- // slot 6
- if(PlayerInfo[playerid][vehicleKeySix] == -1 && PlayerInfo[playerid][donateSlot] >= 3) return allocatePlayerVehicle(playerid, 6, vehicleid);
- if(PlayerInfo[playerid][vehicleKeySix] == -1 && PlayerInfo[playerid][pVip] >= 6) return allocatePlayerVehicle(playerid, 6, vehicleid);
- // slot 7
- if(PlayerInfo[playerid][vehicleKeySeven] == -1 && PlayerInfo[playerid][pVip] >= 6) {
- allocatePlayerVehicle(playerid, 7, vehicleid);
- return 1;
- }
- // slot 8
- if(PlayerInfo[playerid][vehicleKeyEight] == -1 && PlayerInfo[playerid][pVip] >= 7) {
- allocatePlayerVehicle(playerid, 8, vehicleid);
- return 1;
- }
- return GRESKA(playerid, "Vasi slotovi su popunjeni.");
- }
- }
- //--------------------------------------------
- if(dialogid == 2318)
- {
- if (!response) {
- if (!vTypedTimes[playerid]) {
- vTypedTimes[playerid] = false;
- }
- }
- if(response)
- {
- if (!vTypedTimes[playerid]) {
- UnistiAuta(playerid);
- if(PlayerInfo[playerid][vehicleKeyOne] == -1 && PlayerInfo[playerid][vehicleKeyTwo] == -1 && PlayerInfo[playerid][vehicleKeyThree] == -1 && PlayerInfo[playerid][vehicleKeyFour] == -1 && PlayerInfo[playerid][vehicleKeyFive] == -1 && PlayerInfo[playerid][vehicleKeySix] == -1 && PlayerInfo[playerid][vehicleKeySeven] == -1 && PlayerInfo[playerid][vehicleKeyEight] == -1)
- return GRESKA(playerid, "Nemate vozila!");
- if (RaceTemp[tempraceID] != INVALID_RACE_ID)
- return GRESKA(playerid, "Event je trenutno u toku, pocekajte malce!");
- if(PlayerInfo[playerid][vehicleKeyOne] != -1)
- createVehicleOne(playerid);
- if(PlayerInfo[playerid][vehicleKeyTwo] != -1)
- createVehicleTwo(playerid);
- if(PlayerInfo[playerid][vehicleKeyThree] != -1)
- createVehicleThree(playerid);
- if(PlayerInfo[playerid][vehicleKeyFour] != -1)
- createDonateVehicleOne(playerid);
- if(PlayerInfo[playerid][vehicleKeyFive] != -1)
- createDonateVehicleTwo(playerid);
- if(PlayerInfo[playerid][vehicleKeySix] != -1)
- createDonateVehicleThree(playerid);
- if(PlayerInfo[playerid][vehicleKeySeven] != -1)
- createVIP7Vehicle(playerid);
- if(PlayerInfo[playerid][vehicleKeyEight] != -1)
- createVIP7VehicleTwo(playerid);
- vTypedTimes[playerid] = true;
- }
- else {
- new c1 = PlayerInfo[playerid][vehicleKeyOne], c2 = PlayerInfo[playerid][vehicleKeyTwo], c3 = PlayerInfo[playerid][vehicleKeyThree], c4 = PlayerInfo[playerid][vehicleKeyFour],
- c5 = PlayerInfo[playerid][vehicleKeyFive], c6 = PlayerInfo[playerid][vehicleKeySix], c7 = PlayerInfo[playerid][vehicleKeySeven], c8 = PlayerInfo[playerid][vehicleKeyEight];
- if(listitem == 0)
- {
- if(c1 == -1 && c2 == -1 && c3 == -1 && c4 == -1 && c5 == -1 && c6 == -1 && c7 == -1 && c8 == -1)
- {
- ShowPlayerDialog(playerid, 0, DSM, ""ZELENASTAN"Info", "{FF4242}Vi nemate vozila", "Zatvori", "");
- return 1;
- }
- else
- {
- new kstring[1400], kz[4];
- if (c1 != -1)
- {
- if(CarInfo[c1][cLock] == 1) kz = "Ne";
- else kz = "Da";
- format(kstring,sizeof(kstring),
- "{FF4242}1. slot:\n"ZELENASTAN"Model: "BELASTAN"%s\n\
- "ZELENASTAN"Cijena: "BELASTAN"$%d\n"ZELENASTAN"Boja1: "BELASTAN"%d\n\
- "ZELENASTAN"Boja2: "BELASTAN"%d\n"ZELENASTAN"Otkljucan: "BELASTAN"%s\n\
- "ZELENASTAN"Gorivo: "BELASTAN"%dL\n\n",
- GetVehicleName(tmpVehicleOne[playerid]),
- CarInfo[c1][cValue],
- CarInfo[c1][cColorOne],
- CarInfo[c1][cColorTwo],
- kz,
- CarInfo[c1][cGorivo]
- );
- }
- if (c2 != -1)
- {
- if(CarInfo[c2][cLock] == 1) kz = "Ne";
- else kz = "Da";
- format(kstring,sizeof(kstring),
- "%s{FF4242}2. slot:\n"ZELENASTAN"Model: "BELASTAN"%s\n\
- "ZELENASTAN"Cijena: "BELASTAN"$%d\n"ZELENASTAN"Boja1: "BELASTAN"%d\n\
- "ZELENASTAN"Boja2: "BELASTAN"%d\n"ZELENASTAN"Otkljucan: "BELASTAN"%s\n\
- "ZELENASTAN"Gorivo: "BELASTAN"%dL\n\n",
- kstring,
- GetVehicleName(tmpVehicleTwo[playerid]),
- CarInfo[c2][cValue],
- CarInfo[c2][cColorOne],
- CarInfo[c2][cColorTwo],
- kz,
- CarInfo[c2][cGorivo]
- );
- }
- if (c3 != -1)
- {
- if(CarInfo[c3][cLock] == 1) kz = "Ne";
- else kz = "Da";
- format(kstring,sizeof(kstring),
- "%s{FF4242}3. slot:\n"ZELENASTAN"Model: "BELASTAN"%s\n\
- "ZELENASTAN"Cijena: "BELASTAN"$%d\n"ZELENASTAN"Boja1: "BELASTAN"%d\n\
- "ZELENASTAN"Boja2: "BELASTAN"%d\n"ZELENASTAN"Otkljucan: "BELASTAN"%s\n\
- "ZELENASTAN"Gorivo: "BELASTAN"%dL\n\n",
- kstring,
- GetVehicleName(tmpVehicleThree[playerid]),
- CarInfo[c3][cValue],
- CarInfo[c3][cColorOne],
- CarInfo[c3][cColorTwo],
- kz,
- CarInfo[c3][cGorivo]
- );
- }
- if (c4 != -1)
- {
- if(CarInfo[c4][cLock] == 1) kz = "Ne";
- else kz = "Da";
- format(kstring,sizeof(kstring),
- "%s{FF4242}4. slot:\n"ZELENASTAN"Model: "BELASTAN"%s\n\
- "ZELENASTAN"Cijena: "BELASTAN"$%d\n"ZELENASTAN"Boja1: "BELASTAN"%d\n\
- "ZELENASTAN"Boja2: "BELASTAN"%d\n"ZELENASTAN"Otkljucan: "BELASTAN"%s\n\
- "ZELENASTAN"Gorivo: "BELASTAN"%dL\n\n",
- kstring,
- GetVehicleName(tmpVehicleFour[playerid]),
- CarInfo[c4][cValue],
- CarInfo[c4][cColorOne],
- CarInfo[c4][cColorTwo],
- kz,
- CarInfo[c4][cGorivo]
- );
- }
- format(kstring,sizeof(kstring),""ZELENASTAN"__________________________\n\n%s"ZELENASTAN"__________________________",kstring);
- ShowPlayerDialog(playerid, 4878, DSM, ""ZELENASTAN"Info", kstring, "Ponataka", "Izlez");
- return 1;
- }
- }
- if(listitem == 1)
- {
- if (c1 == -1) return GRESKA(playerid, "Nemate vozilo na slotu 1!");
- ShowPlayerDialog(playerid, 2319, DIALOG_STYLE_LIST, "{0099CC}[TEST - TEST]","{FF4242}[V]{FFFFFF} | Prodaj\n\
- {FF4242}[V]{FFFFFF} | Parkiraj\n\
- {FF4242}[V]{FFFFFF} | Lociraj\n\
- {FF4242}[V]{FFFFFF} | Otkljucaj/Zakljucaj\n\
- {FF4242}[V]{FFFFFF} | Promjeni boju\n\
- {FF4242}[V]{FFFFFF} | Opcije vozila\n\
- {FF4242}[V]{FFFFFF} | Gepek\n\
- {FF4242}[V]{FFFFFF} | Oglas", "Vo red", "Izlez");
- }
- if(listitem == 2)
- {
- if (c2 == -1) return GRESKA(playerid, "Nemate vozilo na slotu 2!");
- ShowPlayerDialog(playerid, 2320, DIALOG_STYLE_LIST, "{0099CC}[TEST - TEST]","{FF4242}[V]{FFFFFF} | Prodaj\n\
- {FF4242}[V]{FFFFFF} | Parkiraj\n\
- {FF4242}[V]{FFFFFF} | Lociraj\n\
- {FF4242}[V]{FFFFFF} | Otkljucaj/Zakljucaj\n\
- {FF4242}[V]{FFFFFF} | Promjeni boju\n\
- {FF4242}[V]{FFFFFF} | Opcije vozila\n\
- {FF4242}[V]{FFFFFF} | Gepek\n\
- {FF4242}[V]{FFFFFF} | Oglas", "Vo red", "Izlez");
- }
- if(listitem == 3)
- {
- if (c3 == -1) return GRESKA(playerid, "Nemate vozilo na slotu 3!");
- ShowPlayerDialog(playerid, 2321, DIALOG_STYLE_LIST, "{0099CC}[TEST - TEST]","{FF4242}[V]{FFFFFF} | Prodaj\n\
- {FF4242}[V]{FFFFFF} | Parkiraj\n\
- {FF4242}[V]{FFFFFF} | Lociraj\n\
- {FF4242}[V]{FFFFFF} | Otkljucaj/Zakljucaj\n\
- {FF4242}[V]{FFFFFF} | Promjeni boju\n\
- {FF4242}[V]{FFFFFF} | Opcije vozila\n\
- {FF4242}[V]{FFFFFF} | Gepek\n\
- {FF4242}[V]{FFFFFF} | Oglas", "Vo red", "Izlez");
- }
- if(listitem == 4)
- {
- if (c4 == -1) return GRESKA(playerid, "Nemate vozilo na slotu 4!");
- ShowPlayerDialog(playerid, 2322, DIALOG_STYLE_LIST, "{0099CC}[TEST - TEST]","{FF4242}[V]{FFFFFF} | Prodaj\n\
- {FF4242}[V]{FFFFFF} | Parkiraj\n\
- {FF4242}[V]{FFFFFF} | Lociraj\n\
- {FF4242}[V]{FFFFFF} | Otkljucaj/Zakljucaj\n\
- {FF4242}[V]{FFFFFF} | Promjeni boju\n\
- {FF4242}[V]{FFFFFF} | Opcije vozila\n\
- {FF4242}[V]{FFFFFF} | Gepek\n\
- {FF4242}[V]{FFFFFF} | Oglas", "Vo red", "Izlez");
- }
- if(listitem == 5)
- {
- if (c5 == -1) return GRESKA(playerid, "Nemate vozilo na slotu 5!");
- ShowPlayerDialog(playerid, 12265, DIALOG_STYLE_LIST, "{0099CC}[TEST - TEST]","{FF4242}[V]{FFFFFF} | Prodaj\n\
- {FF4242}[V]{FFFFFF} | Parkiraj\n\
- {FF4242}[V]{FFFFFF} | Lociraj\n\
- {FF4242}[V]{FFFFFF} | Otkljucaj/Zakljucaj\n\
- {FF4242}[V]{FFFFFF} | Promjeni boju\n\
- {FF4242}[V]{FFFFFF} | Opcije vozila\n\
- {FF4242}[V]{FFFFFF} | Gepek\n\
- {FF4242}[V]{FFFFFF} | Oglas", "Vo red", "Izlez");
- }
- if(listitem == 6)
- {
- if (c1 == -1) return GRESKA(playerid, "Nemate vozilo na slotu 1!");
- ShowPlayerDialog(playerid, 25597, DIALOG_STYLE_LIST, "{0099CC}[TEST - TEST]","{FF4242}[V]{FFFFFF} | Prodaj\n\
- {FF4242}[V]{FFFFFF} | Parkiraj\n\
- {FF4242}[V]{FFFFFF} | Lociraj\n\
- {FF4242}[V]{FFFFFF} | Otkljucaj/Zakljucaj\n\
- {FF4242}[V]{FFFFFF} | Promjeni boju\n\
- {FF4242}[V]{FFFFFF} | Opcije vozila\n\
- {FF4242}[V]{FFFFFF} | Gepek\n\
- {FF4242}[V]{FFFFFF} | Oglas", "Vo red", "Izlez");
- }
- if(listitem == 7)
- {
- if (c7 == -1) return GRESKA(playerid, "Nemate vozilo na slotu 7!");
- ShowPlayerDialog(playerid, 29597, DIALOG_STYLE_LIST, "{0099CC}[TEST - TEST]","{FF4242}[V]{FFFFFF} | Prodaj\n\
- {FF4242}[V]{FFFFFF} | Parkiraj\n\
- {FF4242}[V]{FFFFFF} | Lociraj\n\
- {FF4242}[V]{FFFFFF} | Otkljucaj/Zakljucaj\n\
- {FF4242}[V]{FFFFFF} | Promjeni boju\n\
- {FF4242}[V]{FFFFFF} | Opcije vozila\n\
- {FF4242}[V]{FFFFFF} | Gepek\n\
- {FF4242}[V]{FFFFFF} | Oglas", "Vo red", "Izlez");
- }
- if(listitem == 8)
- {
- if (c8 == -1) return GRESKA(playerid, "Nemate vozilo na slotu 8!");
- ShowPlayerDialog(playerid, 29598, DIALOG_STYLE_LIST, "{0099CC}[TEST - TEST]","{FF4242}[V]{FFFFFF} | Prodaj\n\
- {FF4242}[V]{FFFFFF} | Parkiraj\n\
- {FF4242}[V]{FFFFFF} | Lociraj\n\
- {FF4242}[V]{FFFFFF} | Otkljucaj/Zakljucaj\n\
- {FF4242}[V]{FFFFFF} | Promjeni boju\n\
- {FF4242}[V]{FFFFFF} | Opcije vozila\n\
- {FF4242}[V]{FFFFFF} | Gepek\n\
- {FF4242}[V]{FFFFFF} | Oglas", "Vo red", "Izlez");
- }
- if(listitem == 9)
- {
- new newcar = GetPlayerVehicleID(playerid);
- if(tmpVehicleOne[playerid] == newcar || tmpVehicleTwo[playerid] == newcar || tmpVehicleThree[playerid] == newcar || tmpVehicleFour[playerid] == newcar || tmpVehicleFive[playerid] == newcar || tmpVehicleSix[playerid] == newcar || tmpVehicleSeven[playerid] == newcar || tmpVehicleEight[playerid] == newcar)
- {
- if (!IsPlayerInAnyVehicle(playerid)) return GRESKA(playerid,"Morate biti u vozilu da ga odtunirate.");
- new vehicleid = GetPlayerVehicleID(playerid);
- new fajlidauta;
- if(vehicleid == tmpVehicleOne[playerid])
- {
- fajlidauta = PlayerInfo[playerid][vehicleKeyOne];
- }
- else if(vehicleid == tmpVehicleTwo[playerid])
- {
- fajlidauta = PlayerInfo[playerid][vehicleKeyTwo];
- }
- else if(vehicleid == tmpVehicleThree[playerid])
- {
- fajlidauta = PlayerInfo[playerid][vehicleKeyThree];
- }
- else if(vehicleid == tmpVehicleFour[playerid])
- {
- fajlidauta = PlayerInfo[playerid][vehicleKeyFour];
- }
- else if(vehicleid == tmpVehicleFive[playerid])
- {
- fajlidauta = PlayerInfo[playerid][vehicleKeyFive];
- }
- else if(vehicleid == tmpVehicleSix[playerid])
- {
- fajlidauta = PlayerInfo[playerid][vehicleKeySix];
- }
- else if(vehicleid == tmpVehicleSeven[playerid])
- {
- fajlidauta = PlayerInfo[playerid][vehicleKeySeven];
- }
- else if(vehicleid == tmpVehicleEight[playerid])
- {
- fajlidauta = PlayerInfo[playerid][vehicleKeyEight];
- }
- VehiclesMod[fajlidauta][0] =
- VehiclesMod[fajlidauta][1] =
- VehiclesMod[fajlidauta][2] =
- VehiclesMod[fajlidauta][3] =
- VehiclesMod[fajlidauta][4] =
- VehiclesMod[fajlidauta][5] =
- VehiclesMod[fajlidauta][6] =
- VehiclesMod[fajlidauta][7] =
- VehiclesMod[fajlidauta][8] =
- VehiclesMod[fajlidauta][9] = 0;
- VehiclesMod[fajlidauta][10] = -1;
- SCM(playerid,0x0A9DC9AA,"TRPG: {FFFFFF}Vozilo odtunirano i respawnano");
- saveVehicle(fajlidauta);
- AC_SetVehicleToRespawn(vehicleid);
- return 1;
- }
- else
- {
- GRESKA(playerid,"Ovo nije vase vozilo.");
- }
- return 1;
- }
- if(listitem == 10)
- {
- new newcar = GetPlayerVehicleID(playerid);
- if(tmpVehicleOne[playerid] != newcar && tmpVehicleTwo[playerid] != newcar && tmpVehicleThree[playerid] != newcar && tmpVehicleFour[playerid] != newcar && tmpVehicleFive[playerid] != newcar && tmpVehicleSix[playerid] != newcar && tmpVehicleSeven[playerid] != newcar && tmpVehicleEight[playerid] != newcar) return GRESKA(playerid, "Morate biti u svome vozilu!");
- ShowPlayerDialog(playerid, 1285, DIALOG_STYLE_LIST,"Radio","Cool Radio\nBalkan DJ\nTDI Radio\nPlay Radio\nBig Narodna\nZaustavi radio","Odberi","Otkazi");
- }
- }
- }
- }
- //--------------------------------------------------
- CMD:v(playerid)
- {
- if(naGames[playerid] != 0) return GRESKA(playerid, "Ne mozete to na GAMES!");
- if(dueling[playerid]) return GRESKA(playerid, "U duelu ste.");
- if(IgracUWaru(playerid)) return GRESKA(playerid, "U waru ste");
- //if(PlayerCP[playerid] > 0) return GRESKA(playerid, "Ne mozes koristi ovu komandu dok si na eventu.");
- //if(EventInfo[EventTime] != 0) return GRESKA(playerid, "Trenutno je aktivan event, zbog sigurnosti sad ne mozes pristupiti ovome.");
- if(tmpVehicleOne[playerid] >= 65000 || tmpVehicleTwo[playerid] >= 65000 || tmpVehicleThree[playerid] >= 65000 || tmpVehicleFour[playerid] >= 65000 || tmpVehicleFive[playerid] >= 65000 || tmpVehicleSix[playerid] >= 65000 || tmpVehicleSeven[playerid] >= 65000 || tmpVehicleEight[playerid] >= 65000)
- {
- UnistiAuta(playerid);
- vTypedTimes[playerid] = false;
- return GRESKA(playerid, "Desila se greska prilikom citanja vozila, sva vasa vozila su unistena. Pokusajte ponovo.");
- }
- switch(vTypedTimes[playerid]) {
- case false: ShowPlayerDialog(playerid, 2318, DIALOG_STYLE_MSGBOX, "{0099CC}[TEST - TEST]", "{ffffff}Da li zelite spawnovati sva vozila?", "Da", "Ne");
- case true: {
- if(ZamjenaInfo[playerid][zAktivna]) return GRESKA(playerid, "Ne mozete koristiti ovu komandu dok imate aktivnu zamjenu!");
- new auto1 = tmpVehicleOne[playerid],
- auto2 = tmpVehicleTwo[playerid],
- auto3 = tmpVehicleThree[playerid],
- auto4 = tmpVehicleFour[playerid],
- auto5 = tmpVehicleFive[playerid],
- auto6 = tmpVehicleSix[playerid],
- auto7 = tmpVehicleSeven[playerid],
- auto8 = tmpVehicleEight[playerid];
- new model1[20], model2[20], model3[20], model4[20], model5[20], model6[20], model7[20], model8[20];
- if(auto1 == -1 || auto1 == -2) format(model1, sizeof(model1), "Prazno");
- else format(model1, sizeof(model1), "%s", GetVehicleName(auto1));
- if(auto2 == -1 || auto2 == -2) format(model2, sizeof(model2), "Prazno");
- else format(model2, sizeof(model2), "%s", GetVehicleName(auto2));
- if(auto3 == -1 || auto3 == -2) format(model3, sizeof(model3), "Prazno");
- else format(model3, sizeof(model3), "%s", GetVehicleName(auto3));
- if(auto4 == -1 || auto4 == -2) format(model4, sizeof(model4), "Prazno");
- else format(model4, sizeof(model4), "%s", GetVehicleName(auto4));
- if(auto5 == -1 || auto5 == -2) format(model5, sizeof(model5), "Prazno");
- else format(model5, sizeof(model5), "%s", GetVehicleName(auto5));
- if(auto6 == -1 || auto6 == -2) format(model6, sizeof(model6), "Prazno");
- else format(model6, sizeof(model6), "%s", GetVehicleName(auto6));
- if(auto7 == -1 || auto7 == -2) format(model7, sizeof(model7), "Prazno");
- else format(model7, sizeof(model7), "%s", GetVehicleName(auto7));
- if(auto8 == -1 || auto8 == -2) format(model8, sizeof(model8), "Prazno");
- else format(model8, sizeof(model8), "%s", GetVehicleName(auto8));
- if(PlayerInfo[playerid][vehicleKeyOne] != -1 && CarInfo[PlayerInfo[playerid][vehicleKeyOne]][cParking] == -2) format(model1, sizeof(model1), "Zaplenjen");
- else if(PlayerInfo[playerid][vehicleKeyTwo] != -1 && CarInfo[PlayerInfo[playerid][vehicleKeyTwo]][cParking] == -2) format(model2, sizeof(model2), "Zaplenjen");
- else if(PlayerInfo[playerid][vehicleKeyThree] != -1 && CarInfo[PlayerInfo[playerid][vehicleKeyThree]][cParking] == -2) format(model3, sizeof(model3), "Zaplenjen");
- else if(PlayerInfo[playerid][vehicleKeyFour] != -1 && CarInfo[PlayerInfo[playerid][vehicleKeyFour]][cParking] == -2) format(model4, sizeof(model4), "Zaplenjen");
- else if(PlayerInfo[playerid][vehicleKeyFive] != -1 && CarInfo[PlayerInfo[playerid][vehicleKeyFive]][cParking] == -2) format(model5, sizeof(model5), "Zaplenjen");
- else if(PlayerInfo[playerid][vehicleKeySix] != -1 && CarInfo[PlayerInfo[playerid][vehicleKeySix]][cParking] == -2) format(model6, sizeof(model6), "Zaplenjen");
- else if(PlayerInfo[playerid][vehicleKeySeven] != -1 && CarInfo[PlayerInfo[playerid][vehicleKeySeven]][cParking] == -2) format(model7, sizeof(model7), "Zaplenjen");
- else if(PlayerInfo[playerid][vehicleKeyEight] != -1 && CarInfo[PlayerInfo[playerid][vehicleKeyEight]][cParking] == -2) format(model8, sizeof(model8), "Zaplenjen");
- new dlg[550];
- format(dlg,sizeof(dlg), "{FF4242}[V]{FFFFFF} | Lista Vozila\n\
- {FF4242}[S-1]{FFFFFF} | %s\n\
- {FF4242}[S-2]{FFFFFF} | %s\n\
- {FF4242}[S-3]{FFFFFF} | %s\n\
- {FF4242}[DONATORSKI S-1]{FFFFFF} | %s\n\
- {FF4242}[DONATORSKI S-2]{FFFFFF} | %s\n\
- {FF4242}[DONATORSKI S-3]{FFFFFF} | %s\n\
- {FF4242}[DONATORSKI S-4]{FFFFFF} | %s\n\
- {FF4242}[DONATORSKI S-5]{FFFFFF} | %s\n\
- {FF4242}[V]{FFFFFF} | Ukloni Tuning\n\
- {FF4242}[V]{FFFFFF} | Radio", model1, model2, model3, model4, model5, model6, model7, model8);
- ShowPlayerDialog(playerid, 2318, DIALOG_STYLE_LIST, "{0099CC}[TEST - TEST]", dlg, "Odberi", "Izlez");
- }
- }
- return 1;
- }
- //--------------------------------------------------------------
- else if(playertextid == Salon[12][playerid])
- {
- if(GledaKatalog[playerid] == -1) return GRESKA(playerid,"Otidjite relog,ili prijavite gresku adminima!");
- PrikaziSalonTD(playerid, 2);
- GledaKatalog[playerid] = -1;
- ListaVozila[playerid] = -1;
- SalonKupuje[SalonID[playerid]] = -1;
- INFO(playerid,"Odustali ste od kupovine,zatvorili ste salon meni!");
- return 1;
- }
- else if(playertextid == Salon[9][playerid])
- {
- new idsalona = GledaKatalog[playerid];
- new voziloporedu = ListaVozila[playerid];
- new string[1204], vehicleid;
- if(PlayerInfo[playerid][pLevel] < 5) return GRESKA(playerid,"Morate biti level '+5' za kupovinu!");
- if(SaloniInfo[idsalona][saOGModela][voziloporedu] == 0) return GRESKA(playerid,"Tih modela vise nemam na prodaju!");
- if(PlayerInfo[playerid][pCash] < SaloniInfo[idsalona][saCena][voziloporedu]) return GRESKA(playerid,"Nemate dovolno pari!");
- format(string,sizeof(string), "{FFFFFF}- Da li zelite da kupite vozilo -> {D42038}'%s'{FFFFFF}.\n\
- {FFFFFF}- Cena vozila koje ste izabrali -> {D42038}'$%d'{FFFFFF}.\n\
- {FFFFFF}- Kliknite na 'Kupi' ako zelite da kupite vozilo.\n\
- {FFFFFF}- Kliknite na 'Odustani' ako necete da kupite vozilo.",ImenaVozila[SaloniInfo[GledaKatalog[playerid]][saModel][ListaVozila[playerid]] - 400],
- SaloniInfo[idsalona][saCena][voziloporedu]);
- PodesiVozilo(playerid, vehicleid);
- ShowPlayerDialog(playerid, D_KUPOVINAVOZILA, DIALOG_STYLE_MSGBOX, "{0099CC}[TEST - TEST]", string, "Kupi", "Otkazi");
- return 1;
- }
- else if(playertextid == Salon[10][playerid])
- {
- if(GledaKatalog[playerid] != -1)
- {
- if(ListaVozila[playerid] - 1 < 0) return GRESKA(playerid,"Ne mozete vise nazad!");
- if(SaloniInfo[GledaKatalog[playerid]][saModel][ListaVozila[playerid]-1] == 0) return GRESKA(playerid,"Nemamo vise vozila!");
- ListaVozila[playerid] --;
- if(ListaVozila[playerid] < 0)
- {
- ListaVozila[playerid] = 0;
- }
- PodesiSalonTD(playerid);
- return 1;
- }
- }
- else if(playertextid == Salon[11][playerid])
- {
- if(GledaKatalog[playerid] != -1)
- {
- if(ListaVozila[playerid] + 1 > 40) return GRESKA(playerid,"Ne mozete vise napred!");
- if(SaloniInfo[GledaKatalog[playerid]][saModel][ListaVozila[playerid]+1] == 0) return GRESKA(playerid,"Nemamo vise vozila!");
- ListaVozila[playerid] ++;
- if(ListaVozila[playerid] > 40)
- {
- ListaVozila[playerid] = 40;
- }
- PodesiSalonTD(playerid);
- return 1;
- }
- }
- //========================================================
- CMD:kreirajsalon(playerid, params[])
- {
- if(!isPlayerLogged[playerid]) return GRESKA(playerid, "Morate biti ulogovani da bi koristili komande!");
- if(PlayerInfo[playerid][pZGAnovi] != 10) return GRESKA(playerid, NEMA_OVLASTENJE_TEXT);
- new idsalona = Iter_Free(i_Saloni);
- if (idsalona < 0)
- return GRESKA(playerid, "Nije moguce kreirati salon.");
- new Float:Poz[3];
- new salonime[25];
- if(sscanf(params, "s[25]",salonime)) return USAGE(playerid,"/kreirajsalon [Ime Salona]");
- if(GetPlayerInterior(playerid) != 0) return GRESKA(playerid,"Ne mozete u intu!");
- if(GetPlayerVirtualWorld(playerid) != 0) return GRESKA(playerid,"Mora vam VW biti 0!");
- Iter_Add(i_Saloni, idsalona);
- GetPlayerPos(playerid, Poz[0], Poz[1], Poz[2]);
- SaloniInfo[idsalona][saPostavljen] =
- SaloniInfo[idsalona][saKupovina] = 0;
- SaloniInfo[idsalona][saSpawn][0] = Poz[0];
- SaloniInfo[idsalona][saSpawn][1] = Poz[1];
- SaloniInfo[idsalona][saSpawn][2] = Poz[2];
- SaloniInfo[idsalona][saVehicle][0] =
- SaloniInfo[idsalona][saVehicle][1] =
- SaloniInfo[idsalona][saVehicle][2] =
- SaloniInfo[idsalona][saVehicle][3] = 0.0;
- format(SaloniInfo[idsalona][saIme],25,salonime);
- for(new da = 0; da < 40; da++)
- {
- SaloniInfo[idsalona][saModel][da] =
- SaloniInfo[idsalona][saCena][da] =
- SaloniInfo[idsalona][saOGModela][da] = 0;
- }
- static query[80];
- mysql_format(SQL, query, sizeof query, "INSERT INTO `saloni` (`ID`,`Salon_Postavljen`) VALUES (%d,0)", idsalona);
- mysql_pquery(SQL, query, "SQL_Thread", "dd", createdSaloon, idsalona);
- INFO(playerid,"Salon uspesno kreiran sada koristite - '/spawnvozila'.");
- return true;
- }
- CMD:imesalona(playerid, params[])
- {
- if(!isPlayerLogged[playerid]) return GRESKA(playerid, "Morate biti ulogovani da bi koristili komande!");
- if(PlayerInfo[playerid][pZGAnovi] != 10) return GRESKA(playerid, NEMA_OVLASTENJE_TEXT);
- new idsalona;
- new salonime[25];
- if(sscanf(params, "is[25]", idsalona,salonime)) return USAGE(playerid,"/imesalona [ID SALONA] [Ime Salona]");
- if(idsalona < 1 || idsalona >= MAX_SALONA) return GRESKA(playerid,"Ne moze ispod 1 niti vise od MAX_SALONA!");
- if(GetPlayerInterior(playerid) != 0) return GRESKA(playerid,"Ne mozete u intu!");
- if(GetPlayerVirtualWorld(playerid) != 0) return GRESKA(playerid,"Mora vam VW biti 0!");
- if(!SaloniInfo[idsalona][saExist]) return GRESKA(playerid,"Salon sa tim ID-om ne postoji!");
- format(SaloniInfo[idsalona][saIme],25,salonime);
- UpdateSalonTD(idsalona);
- saveSaloon(idsalona);
- return true;
- }
- CMD:obrisisalon(playerid, params[])
- {
- if(!isPlayerLogged[playerid]) return GRESKA(playerid, "Morate biti ulogovani da bi koristili komande!");
- if(PlayerInfo[playerid][pZGAnovi] != 10) return GRESKA(playerid, NEMA_OVLASTENJE_TEXT);
- new idsalona;
- if(sscanf(params, "i", idsalona)) return USAGE(playerid,"/obrisisalon [ID SALONA]");
- if(idsalona < 1 || idsalona >= MAX_SALONA) return GRESKA(playerid,"Ne moze ispod 1 niti vise od MAX_SALONA!");
- if(GetPlayerInterior(playerid) != 0) return GRESKA(playerid,"Ne mozete u intu!");
- if(GetPlayerVirtualWorld(playerid) != 0) return GRESKA(playerid,"Mora vam VW biti 0!");
- if(!SaloniInfo[idsalona][saExist]) return GRESKA(playerid,"Salon sa tim ID-om ne postoji!");
- SaloniInfo[idsalona][saPostavljen] = SaloniInfo[idsalona][saKupovina] = 0;
- SaloniInfo[idsalona][saSpawn][0] = 0.0;
- SaloniInfo[idsalona][saSpawn][1] = 0.0;
- SaloniInfo[idsalona][saSpawn][2] = 1000.0;
- SaloniInfo[idsalona][saVehicle][0] = 0.0;
- SaloniInfo[idsalona][saVehicle][1] = 0.0;
- SaloniInfo[idsalona][saVehicle][2] = 0.0;
- SaloniInfo[idsalona][saVehicle][3] = 0.0;
- for(new da = 0; da < 40; da++)
- {
- SaloniInfo[idsalona][saModel][da] = 0;
- SaloniInfo[idsalona][saCena][da] = 0;
- SaloniInfo[idsalona][saOGModela][da] = 0;
- }
- if (IsValidDynamic3DTextLabel(Saloni_3D[idsalona])) {
- DestroyDynamic3DTextLabel(Saloni_3D[idsalona]);
- Saloni_3D[idsalona] = Text3D:INVALID_3DTEXT_ID;
- }
- if(IsValidDynamicPickup(Saloni_Pickup[idsalona])) { DestroyDynamicPickup(Saloni_Pickup[idsalona]); Saloni_Pickup[idsalona] = INVALID_PICKUP_ID; }
- if(IsValidDynamicMapIcon(SaloniInfo[idsalona][saMapIcon])) {
- DestroyDynamicMapIcon(SaloniInfo[idsalona][saMapIcon]);
- SaloniInfo[idsalona][saMapIcon] = -1;
- }
- new query[60];
- mysql_format(SQL, query, sizeof query, "DELETE FROM `saloni` WHERE ID=%d LIMIT 1", idsalona);
- mysql_tquery(SQL, query);
- SaloniInfo[idsalona][saExist] = false;
- Iter_Remove(i_Saloni, idsalona);
- return true;
- }
- CMD:spawnvozila(playerid, params[])
- {
- if(!isPlayerLogged[playerid]) return GRESKA(playerid, "Morate biti ulogovani da bi koristili komande!");
- if(PlayerInfo[playerid][pZGAnovi] != 10) return GRESKA(playerid, NEMA_OVLASTENJE_TEXT);
- new idsalona;
- new Float:Poz[4];
- if(sscanf(params, "i", idsalona)) return USAGE(playerid,"/spawnvozila [ID]");
- if(!SaloniInfo[idsalona][saExist]) return GRESKA(playerid,"Salon sa tim ID-om ne postoji!");
- if(!IsPlayerInAnyVehicle(playerid)) return GRESKA(playerid,"Da bi ste odredili spawn vozila morate koristiti bilo koje vozilo!");
- GetVehiclePos(GetPlayerVehicleID(playerid), Poz[0], Poz[1], Poz[2]);
- GetVehicleZAngle(GetPlayerVehicleID(playerid), Poz[3]);
- SaloniInfo[idsalona][saVehicle][0] = Poz[0];
- SaloniInfo[idsalona][saVehicle][1] = Poz[1];
- SaloniInfo[idsalona][saVehicle][2] = Poz[2];
- SaloniInfo[idsalona][saVehicle][3] = Poz[3];
- saveSaloon(idsalona);
- INFO(playerid,"Uspesno ste odredili spawn vozila za kupovinu sada koristite - '/dodajvozila'.");
- return true;
- }
- CMD:dodajvozila(playerid, params[])
- {
- if(!IsSpecialUser(playerid)) return GRESKA(playerid, NEMA_OVLASTENJE_TEXT);
- if(!isPlayerLogged[playerid]) return GRESKA(playerid, "Morate biti ulogovani da bi koristili komande!");
- new idsalona;
- new modelid;
- new cijena;
- new maxmodela;
- if(sscanf(params, "iiii", idsalona, modelid, cijena, maxmodela)) return USAGE(playerid,"/dodajvozila [ID SALONA] [MODEL ID] [CENA] [MAX KUPLJENIH]");
- if(modelid < 400 || modelid > 611) return GRESKA(playerid,"Model nije validan!");
- if(cijena < 10000 || cijena > 1000000000) return GRESKA(playerid,"Cena ne moze biti manja od 10000 niti veca od 1000000000!");
- if(!SaloniInfo[idsalona][saExist]) return GRESKA(playerid,"Salon sa tim ID-om ne postoji!");
- if(SaloniInfo[idsalona][saVehicle][0] == 0.0) return GRESKA(playerid,"Nije spawn postavljen - '/spawnvozila'.");
- if(SaloniInfo[idsalona][saModel][39] != 0) return GRESKA(playerid,"Svi slotovi u salonu su popunjeni!");
- for(new da = 0; da < 40; da++)
- {
- if(SaloniInfo[idsalona][saModel][da] == 0)
- {
- SaloniInfo[idsalona][saModel][da] = modelid;
- SaloniInfo[idsalona][saCena][da] = cijena;
- SaloniInfo[idsalona][saOGModela][da] = maxmodela;
- break;
- }
- }
- SaloniInfo[idsalona][saPostavljen] = 1;
- UpdateSalonTD(idsalona);
- saveSaloon(idsalona);
- INFO(playerid,"Uspesno ste dodali vozilo u salon!");
- INFO(playerid,"Da izmenite stanje vozila u salonima koristite - '/promenisalon'.");
- return true;
- }
- CMD:salonkupovina(playerid, params[])
- {
- if(!isPlayerLogged[playerid]) return GRESKA(playerid, "Morate biti ulogovani da bi koristili komande!");
- if(PlayerInfo[playerid][pZGAnovi] != 10 && PlayerInfo[playerid][pZGAnovi] != 9) return GRESKA(playerid, NEMA_OVLASTENJE_TEXT);
- new idsalona;
- new kupovina;
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pName);
- if(sscanf(params, "ii", idsalona, kupovina)) return USAGE(playerid,"/salonkupovina [ID SALONA] [DA/NE]");
- if(idsalona >= 9 && !IsSpecialUser(playerid)) return GRESKA(playerid, NEMA_OVLASTENJE_TEXT);
- if(!SaloniInfo[idsalona][saExist]) return GRESKA(playerid,"Salon sa tim ID-om ne postoji!");
- SaloniInfo[idsalona][saKupovina] = kupovina;
- saveSaloon(idsalona);
- UpdateSalonTD(idsalona);
- INFO(playerid,"Uspesno izmenjena salon kupovina!");
- return true;
- }
- CMD:promenisalon(playerid, params[])
- {
- if(!IsSpecialUser(playerid)) return GRESKA(playerid, NEMA_OVLASTENJE_TEXT);
- if(!isPlayerLogged[playerid]) return GRESKA(playerid, "Morate biti ulogovani da bi koristili komande!");
- new idsalona;
- new kolicina;
- new vozilopr;
- if(sscanf(params, "iii", idsalona, kolicina, vozilopr)) return USAGE(playerid,"/promenisalon [ID SALONA] [MAX_KUPLJENIH] [VOZILO PO REDU(1-40)]");
- if(kolicina < 0 || kolicina > 40) return GRESKA(playerid,"Kolicina ne moze biti manja od 0 niti veca od 40!");
- if(vozilopr < 0 || vozilopr > 40) return GRESKA(playerid,"Ne mozete ispod 0 niti vise od 40!");
- if(!SaloniInfo[idsalona][saExist]) return GRESKA(playerid,"Salon sa tim ID-om ne postoji!");
- if(SaloniInfo[idsalona][saModel][vozilopr] == 0) return GRESKA(playerid,"Taj slot je prazana!");
- SaloniInfo[idsalona][saOGModela][vozilopr] = kolicina;
- saveSaloon(idsalona);
- INFO(playerid,"Uspesno dodato/oduzeto vozilo u salonu!");
- return true;
- }
- CMD:premestisalon(playerid, params[])
- {
- if(!isPlayerLogged[playerid]) return GRESKA(playerid, "Morate biti ulogovani da bi koristili komande!");
- if(PlayerInfo[playerid][pZGAnovi] != 10) return GRESKA(playerid, NEMA_OVLASTENJE_TEXT);
- new idsalona;
- new Float:Poz[3];
- if(sscanf(params, "i", idsalona)) return USAGE(playerid,"/premestisalon [ID SALONA]");
- if(!SaloniInfo[idsalona][saExist]) return GRESKA(playerid,"Salon sa tim ID-om ne postoji!");
- if(GetPlayerInterior(playerid) != 0) return GRESKA(playerid,"Ne mozete dok ste u interijeru!");
- if(GetPlayerVirtualWorld(playerid) != 0) return GRESKA(playerid,"Dok vw ne bude 0 nema nista od premestanja!");
- GetPlayerPos(playerid, Poz[0], Poz[1], Poz[2]);
- SaloniInfo[idsalona][saSpawn][0] = Poz[0];
- SaloniInfo[idsalona][saSpawn][1] = Poz[1];
- SaloniInfo[idsalona][saSpawn][2] = Poz[2];
- if (IsValidDynamic3DTextLabel(Saloni_3D[idsalona])) {
- DestroyDynamic3DTextLabel(Saloni_3D[idsalona]);
- Saloni_3D[idsalona] = Text3D:INVALID_3DTEXT_ID;
- }
- if(IsValidDynamicPickup(Saloni_Pickup[idsalona])) { DestroyDynamicPickup(Saloni_Pickup[idsalona]); Saloni_Pickup[idsalona] = INVALID_PICKUP_ID; }
- if(IsValidDynamicMapIcon(SaloniInfo[idsalona][saMapIcon])) {
- DestroyDynamicMapIcon(SaloniInfo[idsalona][saMapIcon]);
- SaloniInfo[idsalona][saMapIcon] = -1;
- }
- KreirajSalon(idsalona);
- saveSaloon(idsalona);
- INFO(playerid,"Salon premestan,premestite i katalog i ostale delove!");
- return true;
- }
- CMD:gotosalon(playerid, params[])
- {
- if(!isPlayerLogged[playerid]) return GRESKA(playerid, "Morate biti ulogovani da bi koristili komande!");
- if(PlayerInfo[playerid][pZGAnovi] != 10) return GRESKA(playerid, NEMA_OVLASTENJE_TEXT);
- new idsalona;
- if(sscanf(params, "i", idsalona)) return USAGE(playerid,"/gotosalon [ID SALONA]");
- if(!SaloniInfo[idsalona][saExist]) return GRESKA(playerid,"Salon sa tim ID-om ne postoji!");
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, SaloniInfo[idsalona][saSpawn][0], SaloniInfo[idsalona][saSpawn][1], SaloniInfo[idsalona][saSpawn][2]);
- INFO(playerid,"Portali ste se do auto salona!");
- return true;
- }
- KreirajSalon(id)
- {
- new string[250];
- new salonstatus[20];
- if(SaloniInfo[id][saKupovina] == 1) salonstatus = "{80FF00}Otvoren";
- else salonstatus = "{FF0000}Zatvoren";
- format(string, sizeof(string), "{7FD7F5}[ Salon: {FF0000}%s(%d) {7FD7F5}]\n\
- {7FD7F5}[ Salon je: %s {7FD7F5}]\n\
- {7FD7F5}Za kupovinu pritisnite {FF0000}'SPACE'", SaloniInfo[id][saIme], id,salonstatus);
- Saloni_3D[id] = CreateDynamic3DTextLabel(string, -1, SaloniInfo[id][saSpawn][0], SaloniInfo[id][saSpawn][1], SaloniInfo[id][saSpawn][2]+0.3, 15,_,_,_, 0, 0,_,_);
- Saloni_Pickup[id] = CreateDynamicPickup(1559, 1, SaloniInfo[id][saSpawn][0], SaloniInfo[id][saSpawn][1], SaloniInfo[id][saSpawn][2]);
- SaloniInfo[id][saMapIcon] = CreateDynamicMapIcon(SaloniInfo[id][saSpawn][0], SaloniInfo[id][saSpawn][1], SaloniInfo[id][saSpawn][2], 55, -1, 0, 0, -1, 400.0);
- return true;
- }
- UpdateSalonTD(id)
- {
- new string[200];
- new salonstatus[20];
- if(SaloniInfo[id][saKupovina] == 1) salonstatus = "{80FF00}Otvoren";
- else salonstatus = "{FF0000}Zatvoren";
- format(string, sizeof(string), "{7FD7F5}[ Salon: {FF0000}%s(%d) {7FD7F5}]\n\
- {7FD7F5}[ Salon je: %s {7FD7F5}]\n\
- {7FD7F5}Za kupovinu pritisnite {FF0000}'SPACE'", SaloniInfo[id][saIme], id,salonstatus);
- UpdateDynamic3DTextLabelText(Saloni_3D[id], -1, string);
- return true;
- }
- PrikaziSalonTD(playerid, tip)
- {
- if(tip == 1)
- {
- PlayerTextDrawShow(playerid, zaraSalon[0][playerid]);
- PlayerTextDrawShow(playerid, zaraSalon[1][playerid]);
- PlayerTextDrawShow(playerid, zaraSalon[2][playerid]);
- PlayerTextDrawShow(playerid, zaraSalon[3][playerid]);
- PlayerTextDrawShow(playerid, zaraSalon[4][playerid]);
- PlayerTextDrawShow(playerid, zaraSalon[5][playerid]);
- PlayerTextDrawShow(playerid, zaraSalon[6][playerid]);
- PlayerTextDrawShow(playerid, zaraSalon[7][playerid]);
- PlayerTextDrawShow(playerid, zaraSalon[8][playerid]);
- PlayerTextDrawShow(playerid, zaraSalon[9][playerid]);
- PlayerTextDrawShow(playerid, zaraSalon[10][playerid]);
- PlayerTextDrawShow(playerid, zaraSalon[11][playerid]);
- PlayerTextDrawShow(playerid, zaraSalon[12][playerid]);
- SelectTextDraw(playerid,0x33CCFFAA);
- SalonTD_Kreiran[playerid] = 1;
- }
- else if(tip == 2)
- {
- PlayerTextDrawHide(playerid, zaraSalon[0][playerid]);
- PlayerTextDrawHide(playerid, zaraSalon[1][playerid]);
- PlayerTextDrawHide(playerid, zaraSalon[2][playerid]);
- PlayerTextDrawHide(playerid, zaraSalon[3][playerid]);
- PlayerTextDrawHide(playerid, zaraSalon[4][playerid]);
- PlayerTextDrawHide(playerid, zaraSalon[5][playerid]);
- PlayerTextDrawHide(playerid, zaraSalon[6][playerid]);
- PlayerTextDrawHide(playerid, zaraSalon[7][playerid]);
- PlayerTextDrawHide(playerid, zaraSalon[8][playerid]);
- PlayerTextDrawHide(playerid, zaraSalon[9][playerid]);
- PlayerTextDrawHide(playerid, zaraSalon[10][playerid]);
- PlayerTextDrawHide(playerid, zaraSalon[11][playerid]);
- PlayerTextDrawHide(playerid, zaraSalon[12][playerid]);
- GledaKatalog[playerid] = -1;
- ListaVozila[playerid] = -1;
- SalonTD_Kreiran[playerid] = 0;
- CancelSelectTextDraw(playerid);
- }
- return true;
- }
- PodesiSalonTD(playerid)
- {
- new string[30], vehicleid;
- PlayerTextDrawHide(playerid, zaraSalon[2][playerid]);
- PlayerTextDrawHide(playerid, zaraSalon[3][playerid]);
- PlayerTextDrawHide(playerid, zaraSalon[7][playerid]);
- PlayerTextDrawHide(playerid, zaraSalon[8][playerid]);
- PlayerTextDrawSetPreviewModel(playerid, zaraSalon[2][playerid], SaloniInfo[GledaKatalog[playerid]][saModel][ListaVozila[playerid]]);
- PlayerTextDrawShow(playerid, zaraSalon[2][playerid]);
- PlayerTextDrawShow(playerid, zaraSalon[3][playerid]);
- PlayerTextDrawShow(playerid, zaraSalon[7][playerid]);
- PlayerTextDrawShow(playerid, zaraSalon[8][playerid]);
- format(string,sizeof(string), "%s", ImenaVozila[SaloniInfo[GledaKatalog[playerid]][saModel][ListaVozila[playerid]] - 400]);
- PlayerTextDrawSetString(playerid, zaraSalon[3][playerid], string);
- format(string,sizeof(string), "CENA: ~b~$%d",SaloniInfo[GledaKatalog[playerid]][saCena][ListaVozila[playerid]]);
- PlayerTextDrawSetString(playerid, zaraSalon[8][playerid], string);
- format(string,sizeof(string), "DOSTUPNO: ~b~%d",SaloniInfo[GledaKatalog[playerid]][saOGModela][ListaVozila[playerid]]);
- PlayerTextDrawSetString(playerid, zaraSalon[7][playerid], string);
- SelectTextDraw(playerid,0x33CCFFAA);
- return true;
- }
- PodesiVozilo(playerid, vehicleid)
- {
- new idsalona = GledaKatalog[playerid];
- new voziloporedu = ListaVozila[playerid];
- CarInfo[vehicleid][cVehID] = vehicleid;
- CarInfo[vehicleid][cVeh_OwnerID] = PlayerInfo[playerid][pID];
- CarInfo[vehicleid][cOwned] = 1;
- strmid(CarInfo[vehicleid][cOwner], GetName(playerid), 0, strlen(GetName(playerid)), 25);
- format(CarInfo[vehicleid][cTablice], 15, "Nema");
- CarInfo[vehicleid][cLocationx] = SaloniInfo[idsalona][saVehicle][0];
- CarInfo[vehicleid][cLocationy] = SaloniInfo[idsalona][saVehicle][1];
- CarInfo[vehicleid][cLocationz] = SaloniInfo[idsalona][saVehicle][2];
- CarInfo[vehicleid][cAngle] = SaloniInfo[idsalona][saVehicle][3];
- CarInfo[vehicleid][cColorOne] = 1;
- CarInfo[vehicleid][cColorTwo] = 1;
- CarInfo[vehicleid][cModel] = SaloniInfo[idsalona][saModel][voziloporedu];
- CarInfo[vehicleid][cValue] = SaloniInfo[idsalona][saCena][voziloporedu];
- CarInfo[vehicleid][cLock] = 0;
- CarInfo[vehicleid][cOriginLocationx] = SaloniInfo[idsalona][saVehicle][0];
- CarInfo[vehicleid][cOriginLocationy] = SaloniInfo[idsalona][saVehicle][1];
- CarInfo[vehicleid][cOriginLocationz] = SaloniInfo[idsalona][saVehicle][2];
- CarInfo[vehicleid][cOriginAngle] = SaloniInfo[idsalona][saVehicle][3];
- CarInfo[vehicleid][cVW] = 0;
- CarInfo[vehicleid][cInt] = 0;
- CarInfo[vehicleid][cReg] = 0;
- CarInfo[vehicleid][cGorivo] = 60;
- CarInfo[vehicleid][cNeon] =
- CarInfo[vehicleid][cSvetla] =
- CarInfo[vehicleid][cParking] =
- CarInfo[vehicleid][cTempomat] =
- CarInfo[vehicleid][cRezervoar] =
- CarInfo[vehicleid][cAttachPrednji] =
- CarInfo[vehicleid][cSpojler] =
- CarInfo[vehicleid][cBlindiran] =
- CarInfo[vehicleid][cBlindiran1] =
- CarInfo[vehicleid][cBlindiran2] =
- CarInfo[vehicleid][cUnisten] =
- CarInfo[vehicleid][cRadar] =
- CarInfo[vehicleid][cVIP] =
- CarInfo[vehicleid][cAttachZadnji] = 0;
- CarInfo[vehicleid][cHealth] = 0.0;
- static query[750];
- mysql_format(SQL, query, sizeof query, "INSERT INTO `auta` (`ID`,`VVlasnik`,`ImaVlasnika`,`Vlasnik`,`LokacijaX`,`LokacijaY`,`LokacijaZ`,`Kut`,`Boja1`,`Boja2`,`Vehid`,`Cena`,`IzvornalokacijaX`,`IzvornalokacijaY`,`IzvornalokacijaZ`,`Izvornikut`,`VW`,`Int`,`AttachPrednji`,`AttachZadnji`,`Spojler`,`Blindiran`,`Blindiran1`,`Blindiran2`,`Unisten`,`Radar`,`VIP`) \
- VALUES (%d, %d, %d, '%e', %f, %f, %f, %f, %d, %d, %d, %d, %f, %f, %f, %f, %d, %d, '%d','%d','%d','%d','%d','%d', '%d', '%d', '%d')",
- vehicleid, CarInfo[vehicleid][cVeh_OwnerID], CarInfo[vehicleid][cOwned], CarInfo[vehicleid][cOwner], CarInfo[vehicleid][cLocationx], CarInfo[vehicleid][cLocationy], CarInfo[vehicleid][cLocationz], CarInfo[vehicleid][cAngle],
- CarInfo[vehicleid][cColorOne], CarInfo[vehicleid][cColorTwo], CarInfo[vehicleid][cModel], CarInfo[vehicleid][cValue], CarInfo[vehicleid][cOriginLocationx], CarInfo[vehicleid][cOriginLocationy], CarInfo[vehicleid][cOriginLocationz], CarInfo[vehicleid][cOriginAngle],
- CarInfo[vehicleid][cVW], CarInfo[vehicleid][cInt], CarInfo[vehicleid][cAttachPrednji], CarInfo[vehicleid][cAttachZadnji],CarInfo[vehicleid][cSpojler],CarInfo[vehicleid][cBlindiran],CarInfo[vehicleid][cBlindiran1],CarInfo[vehicleid][cBlindiran2],CarInfo[vehicleid][cUnisten],CarInfo[vehicleid][cRadar],CarInfo[vehicleid][cVIP]);
- mysql_tquery(SQL, query);
- CarInfo[vehicleid][cExist] = true;
- saveVehicle(vehicleid);
- PodesiVozilo(playerid, vehicleid);
- if(CarInfo[vehicleid][cModel] < 400 || CarInfo[vehicleid][cModel] > 611)
- {
- PrikaziSalonTD(playerid, 2);
- if(PlayerInfo[playerid][vehicleKeyOne] == vehicleid) PlayerInfo[playerid][vehicleKeyOne] = -1;
- if(PlayerInfo[playerid][vehicleKeyTwo] == vehicleid) PlayerInfo[playerid][vehicleKeyTwo] = -1;
- if(PlayerInfo[playerid][vehicleKeyThree] == vehicleid) PlayerInfo[playerid][vehicleKeyThree] = -1;
- if(PlayerInfo[playerid][vehicleKeyFour] == vehicleid) PlayerInfo[playerid][vehicleKeyFour] = -1;
- if(PlayerInfo[playerid][vehicleKeyFive] == vehicleid) PlayerInfo[playerid][vehicleKeyFive] = -1;
- if(PlayerInfo[playerid][vehicleKeySix] == vehicleid) PlayerInfo[playerid][vehicleKeySix] = -1;
- if(PlayerInfo[playerid][vehicleKeySeven] == vehicleid) PlayerInfo[playerid][vehicleKeySeven] = -1;
- if(PlayerInfo[playerid][vehicleKeyEight] == vehicleid) PlayerInfo[playerid][vehicleKeyEight] = -1;
- GRESKA(playerid, "Doslo je do greske pri kupovini vozila!");
- savePlayer(playerid);
- deleteVehicle(vehicleid);
- }
- else
- {
- AC_GivePlayerMoneyMinus(playerid, SaloniInfo[idsalona][saCena][voziloporedu]);
- SaloniInfo[idsalona][saOGModela][voziloporedu] --;
- PrikaziSalonTD(playerid, 2);
- saveSaloon(idsalona);
- savePlayer(playerid);
- INFO(playerid,"Uspesno ste kupili vozilo!");
- INFO(playerid,"Cestitamo na kupovini - dodjite nam opet!");
- INFO(playerid,"Ukucajte /v da stvorite vase kupljeno vozilo!");
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement