SHARE
TWEET

Untitled

a guest Jan 23rd, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CMD:prodajvozilo(playerid,params[])
  2. {
  3.     //
  4.     //
  5.     //
  6.     //
  7.     new string[512];
  8.     new ownvehkey;
  9.     if(UlogovanIgrac[playerid] == 0) return Error(playerid, "Nisi ulogovan/a!");
  10.     if(PI[playerid][pVozilo1] == 9999 && PI[playerid][pVozilo2] == 9999 && PI[playerid][pVozilo3] == 9999 && PI[playerid][pVozilo4] == 9999) return Error(playerid, "Nemate vozilo!");
  11.     if(GetPlayerVehicleID(playerid) == PI[playerid][pVozilo1] || GetPlayerVehicleID(playerid) == PI[playerid][pVozilo2] || GetPlayerVehicleID(playerid) == PI[playerid][pVozilo3] || GetPlayerVehicleID(playerid) == PI[playerid][pVozilo4])
  12.     {
  13.         for(new c = 0; c < MAX_VEHICLES; c++)
  14.         {
  15.             if(GetPlayerVehicleID(playerid) == PI[playerid][pVozilo1])
  16.             {
  17.                 ownvehkey = PI[playerid][pVozilo1];
  18.             }
  19.             else if(GetPlayerVehicleID(playerid) == PI[playerid][pVozilo2])
  20.             {
  21.                 ownvehkey = PI[playerid][pVozilo2];
  22.             }
  23.             else if(GetPlayerVehicleID(playerid) == PI[playerid][pVozilo3])
  24.             {
  25.                 ownvehkey = PI[playerid][pVozilo3];
  26.             }
  27.             else if(GetPlayerVehicleID(playerid) == PI[playerid][pVozilo4])
  28.             {
  29.                 ownvehkey = PI[playerid][pVozilo4];
  30.             }
  31.             else { return true; }
  32.         }
  33.         new giveplayerid, cena;
  34.         if(sscanf(params, "ui", giveplayerid, cena)) return Cmd(playerid, "/prodajvozilo (playerid) (cena)");
  35.         if(PI[giveplayerid][pLevel] < 3) return Error(playerid, "Taj igrac nema dovoljan level!");
  36.         if(PI[giveplayerid][pABS] > 0 && PI[giveplayerid][pABS] < 5) return Error(playerid, "ABSovi ne mogu da kupuju vozila!");
  37.         if(IsPlayerConnected(giveplayerid))
  38.         {
  39.             if(giveplayerid != IPI)
  40.             {
  41.                 if(playerid == giveplayerid) return Error(playerid, "Ne mozes sam sebi!");
  42.                 if(!ProxDetectorS(8.0, playerid, giveplayerid)) return Error(playerid, "Niste blizu igraca!");
  43.                 if((PI[giveplayerid][pVozilo1] != 9999 && PI[giveplayerid][pVozilo2] != 9999 && PI[giveplayerid][pVozilo3] != 9999) && PI[giveplayerid][pSlot4] == 0) return Error(playerid, "Igracu su popunjeni slotovi!");
  44.                 if((PI[giveplayerid][pVozilo1] != 9999 && PI[giveplayerid][pVozilo2] != 9999 && PI[giveplayerid][pVozilo3] != 9999 && PI[giveplayerid][pVozilo4] != 9999) && PI[giveplayerid][pSlot4] == 1) return Error(playerid, "Igracu su popunjeni slotovi!");
  45.                 if(OwnableCarOffer[giveplayerid] != 9999) return Error(playerid, "Tom gradjaninu je vec neko ponudio!");
  46.                 if(cena < CI[ownvehkey][cCena]/2) return Error(playerid, "Ne mozete ponuditi nize od polovine cene vozila!");
  47.                 if(GetPlayerState(playerid) != PL_ST_DRIVER) return Error(playerid, "Nisi vozac.");
  48.                 new model5[24];
  49.                 GetVehicleName(ownvehkey,model5,sizeof(model5));
  50.                 format(string, sizeof(string), ""COL_BE"[BE] {FFFFFF}Ponudio si %s da kupi tvoje vozilo za $%d.", GetName(giveplayerid), cena);
  51.                 SendClientMessage(playerid, -1, string);
  52.                 format(string, sizeof(string), ""COL_BE"[BE] {FFFFFF}Vlasnik vozila %s ti nudi da kupis njegovo vozilo marke '%s' za $%d! (/prihvati vozilo)", GetName(playerid), model5, cena);
  53.                 SendClientMessage(giveplayerid, -1, string);
  54.                 OwnableCarOffer[giveplayerid] = playerid;
  55.                 OwnableCarID[giveplayerid] = ownvehkey;
  56.                 OwnableCarPrice[giveplayerid] = cena;
  57.             }
  58.         }
  59.     }
  60.     return true;
  61. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top