[POMOC] auta na buy

Započeo |OY:RP| James
3. Mar. 2013. Zaključano
462
pregleda
7
postova
KIKI98
4
Enforcer
3. Mar. 2013.
Scripta:od 0
detaljni opis Problema:ovako radim neki svoj mod od 0 i sad kako da napravim auta na buy ove includove koristim
#include < a_samp >
#include < a_objects >
#include < a_npc >
#include < core >
#include < float >
#include < time >
#include < morphinc >
#include < file >
#include < foreach >
#include < streamer >
#include < YSI\y_ini >
#include < YSI\y_commands >
#include < dini >
#include < sscanf2 >
#include < paused >

i sad mi moze ok napravi auta na buy ja znam ono sve dodam i to samo nzm u modu
pawn

deo scripte:dacu sve
slike
gLava
5
Crime Lord
3. Mar. 2013.
imas tutove nadji cos sisteme
KIKI98
4
Enforcer
3. Mar. 2013.
moze link nekog cos systema traziosam na pretrazi al nema
KIKI98
4
Enforcer
3. Mar. 2013.
moze neko da link cos system
KIKI98
4
Enforcer
3. Mar. 2013.
refresh
Ismet_BN
4
Made Man
3. Mar. 2013.
Evo ti ovaj !


/*
Ismet Alic Multy Vehicle Ownership

iVersion 1.1

Copyright(c)
*/
#include
#include
#include
#include

#pragma tabsize 0

#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x9EC73DAA
#define COLOR_RED 0xAA3333AA
#define COLOR_LIGHTRED 0xFF6347AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_LIGHTGREEN 0x9ACD32AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_MEDIUMAQUA 0x83BFBFAA
#define SCM SendClientMessage
#define SaveFile "V_File.cfg"

#define MAX_MYVEHS 50
#define MAX_BUYED_VEHS 2

//============================== VEHICLES ======================================
enum einfo
{
MyVehSlot,
MyVehModel,
Float:MyVehPos,
MyVehCol,
MyVehLock,
MyVehOwner,
MyVehAlarm,
MyVehFsale,
MyVehID,
MyVehCar,
MyVehBike,
MyVehBoat,
MyVehPlane
};
new MyVehicle;

new Text:CarShopTextDraw;
new IsShoping;
new ShopVeh1;//0 ID,1 Model,2 col1,3 ol2 car
new ShopVeh2;//0 ID,1 Model,2 col1,3 ol2 bike
new VehButtonSet;
new clx = 0;
new EnCV;
new vCars =
{
    {411,650000},
{415,520000},
{424,380000},
{426,180000},
{429,400000},
{434,540000},
{437,500000},
{444,850000},
{451,750000},
{477,385000},
{480,240000},
{502,600000},
{503,600000},
{506,470000},
{541,489000},
{550,210000},
{555,241000},
{559,390000},
{558,180000},
{560,500000},
{561,150000},
{562,432156},
{565,170000},
{568,200000},
{579,190500},
{587,456456},
{589,100000},
{602,320000},
{603,270000}
};
new vBikes={
{581,21000},//BF-400
{462,1000},//Faggio
{521,16000},//FCR-900
{463,25000},//Freeway
{522,45000},//NRG-500
{461,20000},//PCJ-600
{448,1000},//Pizzaboy
{471,5000},//Quad
{468,30000},//Sanchez
{586,30000}//Wayfarer
};

new VehNames[] = {
"Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana","Infernus","Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto",
"Taxi","Washington","Bobcat","Mr Whoopee","BF Injection","Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie","Stallion",
"Rumpo","RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder","Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van",
"Skimmer","PCJ-600","Faggio","Freeway","RC Baron","RC Raider","Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR350","Walton","Regina",
"Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo","Greenwood","Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson",
"Mesa","RC Goblin","Hotring Racer","Hotring Racer","Bloodring Banger","Rancher","Super GT","Elegant","Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain","Nebula","Majestic","Buccaneer","Shamal",
"Hydra","FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona","FBI Truck","Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex",
"Vincent","Bullet","Clover","Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster","Monster","Uranus","Jester",
"Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight","Trailer","Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley",
"Stafford","BF-400","Newsvan","Tug","Trailer","Emperor","Wayfarer","Euros","Hotdog","Club","Trailer","Trailer","Andromada","Dodo","RC Cam","Launch","Police Car (LSPD)","Police Car (SFPD)","Police Car (LVPD)","Police Ranger",
"Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer","Luggage Trailer","Stair Trailer","Boxville","Farm Plow","Utility Trailer"
};
//==============================================================================

public OnFilterScriptInit()
{
return 1;
}

public OnGameModeInit()
{
ShopVeh1 = CreateVehicle(vCars[ShopVeh1], 1292.0682,-1870.6963,13.3741,358.0040, ShopVeh1, ShopVeh1, 30000);
ShopVeh2 = CreateVehicle(vBikes[ShopVeh2],1298.7928,-1870.8855,13.5469,349.0682, ShopVeh2, ShopVeh2, 30000);
CVozilaTextDraw(); // textdraw
LoadMyVehSystem(); // loadanje lvl 1
print("\n----------------------------------");
print(":::::::::Loading Ismet iCos::::::::");
print("----------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
    DVozilaTextDraw();// unistava textdraw
    for(new i; i< MAX_MYVEHS;i++)
    {
        if(MyVehicle == 1)
        {
            DestroyVehicle(MyVehicle);
        }
    }
    print("\n----------------------------------");
print("::::::::Unloading Ismet iCos:::::::");
print("----------------------------------\n");
return 1;
}

main()
{
}

public OnPlayerConnect(playerid)
{
EnCV = -1;
return 1;
}

public OnPlayerDisconnect(playerid,reason)
{
EnCV = -1;
return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new Float:PEnterPos;
new string;
GetPlayerPos(playerid,PEnterPos,PEnterPos,PEnterPos);
if(ConvertVehIDtoDYID(vehicleid) != -1)
{
    new i;
    i = ConvertVehIDtoDYID(vehicleid);
if(MyVehicle == 1 && (MyVehicle != -1 || MyVehicle != -1 || MyVehicle != -1 || MyVehicle != -1) && MyVehicle < 1)
{
      format(string, sizeof(string), "~y~~h~VLASNIK:~y~ %s",MyVehicle);
      GameTextForPlayer(playerid,string,2000,3);
            if(MyVehicle == 1 && !IsPlayerAdmin(playerid))
      {SetPlayerPos(playerid,PEnterPos,PEnterPos,PEnterPos);}
}
if(MyVehicle > 0)
{
  format(string, sizeof(string), "~y~~h~~h~%s~n~~y~~h~PRODAJE SE:~y~ %d$",VehNames[GetVehicleModel(vehicleid) - 400],MyVehicle);
      GameTextForPlayer(playerid,string,2000,3);
      EnCV = i;
    if(!IsPlayerAdmin(playerid)){SetPlayerPos(playerid,PEnterPos,PEnterPos,PEnterPos);}
      return 1;
  }
}
    if(vehicleid == ShopVeh1)
{SetPlayerPos(playerid,PEnterPos,PEnterPos,PEnterPos);
new cijena;
for(new x; x<29;x++){if(vCars == GetVehicleModel(ShopVeh1))cijena = vCars;}
format(string, sizeof(string), "~y~~h~~h~%s~n~~y~~h~PRODAJE SE:~y~ %d$",VehNames[GetVehicleModel(ShopVeh1) - 400],cijena);
GameTextForPlayer(playerid,string,2000,5);}
if(vehicleid == ShopVeh2)
{SetPlayerPos(playerid,PEnterPos,PEnterPos,PEnterPos);
new cijena;
for(new x; x<10;x++){if(vBikes == GetVehicleModel(ShopVeh2))cijena = vBikes;}
format(string, sizeof(string), "~y~~h~~h~%s~n~~y~~h~PRODAJE SE:~y~ %d$",VehNames[GetVehicleModel(ShopVeh2) - 400],cijena);
GameTextForPlayer(playerid,string,2000,5);}
return 1;
}
public OnVehicleSpawn(vehicleid)
{
if(ConvertVehIDtoDYID(vehicleid) != -1)
{
ChangeVehicleColor(vehicleid, MyVehicle[ConvertVehIDtoDYID(vehicleid)], MyVehicle[ConvertVehIDtoDYID(vehicleid)]);
SetVehiclePos(MyVehicle[ConvertVehIDtoDYID(vehicleid)], MyVehicle[ConvertVehIDtoDYID(vehicleid)],MyVehicle[ConvertVehIDtoDYID(vehicleid)],MyVehicle[ConvertVehIDtoDYID(vehicleid)]);
SetVehicleZAngle(MyVehicle[ConvertVehIDtoDYID(vehicleid)], MyVehicle[ConvertVehIDtoDYID(vehicleid)]);
}
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    if(ConvertVehIDtoDYID(vehicleid) != -1)
{
    MyVehicle[ConvertVehIDtoDYID(vehicleid)] = color1;
  MyVehicle[ConvertVehIDtoDYID(vehicleid)] = color2;
  UpdateMyVehSystem(ConvertVehIDtoDYID(vehicleid));
    }
    return 1;
}

public OnPlayerUpdate(playerid)
{
ResetVehButton(playerid);
return 1;
}

stock Ime(playerid)
{
new ime;
GetPlayerName(playerid, ime, MAX_PLAYER_NAME);
return ime;
}

//==========VOZILA := Vozila OWNERSHIP==========================================

stock CVozilaTextDraw()
{
for(new playerid = 0; playerid < MAX_PLAYERS; playerid ++)
{CarShopTextDraw = TextDrawCreate(295.500000,310.000000,"~y~Ime~n~~n~~h~~h~~b~Cijena:------~n~~n~~h~~h~~y~< ~g~dalje ~h~~h~~y~>");
    TextDrawAlignment(CarShopTextDraw,0);
    TextDrawBackgroundColor(CarShopTextDraw,0x000000ff);
    TextDrawFont(CarShopTextDraw,1);
    TextDrawLetterSize(CarShopTextDraw,0.499999,1.000000);
    TextDrawColor(CarShopTextDraw,0xF5DEB3AA);
    TextDrawSetOutline(CarShopTextDraw,1);
    TextDrawSetProportional(CarShopTextDraw,1);
    TextDrawSetShadow(CarShopTextDraw,1);}
}
stock HVozilaTextDraw(playerid)
{TextDrawHideForPlayer(playerid,CarShopTextDraw);}
stock SVozilaTextDraw(playerid)
{TextDrawShowForPlayer(playerid,CarShopTextDraw);}
stock DVozilaTextDraw()
{for(new playerid = 0; playerid < MAX_PLAYERS; playerid ++)
{TextDrawDestroy(CarShopTextDraw);}}

stock ResetVehButton(playerid)
{
if(IsShoping > 0)
{
new Keys, ud, lr;
GetPlayerKeys(playerid, Keys, ud, lr);
if(lr > 0) //desno
{VehButtonSet ++;
VehShopChanger(playerid);}
else if(lr < 0) //lijevo
{VehButtonSet ++;
VehShopChanger(playerid);}
else if(Keys & KEY_FIRE) //ctrl
{VehButtonSet++;
VehShopChanger(playerid);}
else if(Keys & KEY_SECONDARY_ATTACK) //enter
{VehButtonSet++;
VehShopChanger(playerid);}
else
{VehButtonSet = 0;
VehButtonSet = 0;
VehButtonSet = 0;
VehButtonSet = 0;
VehShopChanger(playerid);}
}
return 0;
}
stock VehShopChanger(playerid)
{
if(IsPlayerConnected(playerid))
{
if(IsShoping == 1)
{
new string,pa = 0;
new ime;
  GetPlayerName(playerid, ime, sizeof(ime));
if(VehButtonSet == 1) // desno
{ShopVeh1++;
if(ShopVeh1 > 28) {ShopVeh1 = 0;}pa = 1;}
else if(VehButtonSet == 1) //lijevo
{ShopVeh1--;
if (ShopVeh1 < 0) {ShopVeh1 = 28;}pa = 1;}
else if(VehButtonSet == 1) //enter
{
if(AllMyCars(playerid) < MAX_BUYED_VEHS)
{
if(GetPlayerMoney(playerid) >= vCars[ShopVeh1])
{

  MakeXDCarFnc(playerid,0,vCars[ShopVeh1],1314.9003,-1859.0258,13.3255,270.3405,ShopVeh1,ShopVeh1,ime);
  TogglePlayerControllable(playerid, 1);
IsShoping = 0;
HVozilaTextDraw(playerid);
SetCameraBehindPlayer(playerid);
          }else{format(string,sizeof(string),"Nemate dovoljno novca!Ovaj auto kosta %d$",vCars[ShopVeh1]);
  SCM(playerid,COLOR_LIGHTRED,string);}
    }else{SCM(playerid,COLOR_LIGHTRED,"Vec imas sve aute!");}
    }
    else if (VehButtonSet == 1)
    {TogglePlayerControllable(playerid, 1);
    SCM(playerid, COLOR_LIGHTBLUE, "Odustao si od kupnje novog auta!");
    IsShoping = 0;
    HVozilaTextDraw(playerid);
    SetCameraBehindPlayer(playerid);
}
if(pa > 0){
    DestroyVehicle(ShopVeh1);
ShopVeh1 = CreateVehicle(vCars[ShopVeh1], 1292.0682,-1870.6963,13.3741,358.0040, ShopVeh1,ShopVeh1, 30000);
format(string,sizeof(string),"~w~%s~n~~n~~h~~h~~b~Cijena: %d~n~~n~~h~~h~~y~< ~g~dalje ~h~~h~~y~>",VehNames[GetVehicleModel(ShopVeh1) - 400],vCars[ShopVeh1]);
TextDrawSetString(CarShopTextDraw,string);pa = 0;}
}
else if(IsShoping == 2)
{
new string,pa = 0;
new ime;
  GetPlayerName(playerid, ime, sizeof(ime));
if(VehButtonSet == 1) // desno
{ShopVeh2++;
if(ShopVeh2 > 9) {ShopVeh2 = 0;}pa = 1;}
else if(VehButtonSet == 1) //lijevo
{ShopVeh2--;
if (ShopVeh2 < 0) {ShopVeh2 = 28;}pa = 1;}
else if(VehButtonSet == 1) //enter
{
if(AllMyBikes(playerid) < MAX_BUYED_VEHS)
{
if(GetPlayerMoney(playerid) >= vBikes[ShopVeh2])
{

  MakeXDCarFnc(playerid,1,vBikes[ShopVeh2],1314.9003,-1859.0258,13.3255,270.3405,ShopVeh2,ShopVeh2,ime);
  TogglePlayerControllable(playerid, 1);
IsShoping = 0;
HVozilaTextDraw(playerid);
SetCameraBehindPlayer(playerid);
          }else{format(string,sizeof(string),"Nemate dovoljno novca!Ovaj motor kosta %d$",vBikes[ShopVeh1]);
  SCM(playerid,COLOR_LIGHTRED,string);}
    }else{SCM(playerid,COLOR_LIGHTRED,"Vec imas sve motore");}
    }
    else if (VehButtonSet == 1)
    {TogglePlayerControllable(playerid, 1);
    SCM(playerid, COLOR_LIGHTBLUE, "Odustao si od kupnje novog motora!");
    IsShoping = 0;
    HVozilaTextDraw(playerid);
    SetCameraBehindPlayer(playerid);
}
if(pa > 0){
    DestroyVehicle(ShopVeh2);
ShopVeh2 = CreateVehicle(vBikes[ShopVeh2], 1298.7928,-1870.8855,13.5469,349.0682, ShopVeh2,ShopVeh2, 30000);
format(string,sizeof(string),"~w~%s~n~~n~~h~~h~~b~Cijena: %d~n~~n~~h~~h~~y~< ~g~dalje ~h~~h~~y~>",VehNames[GetVehicleModel(ShopVeh2) - 400],vBikes[ShopVeh2]);
TextDrawSetString(CarShopTextDraw,string);pa = 0;}
}

/*

In here put for Boats and AirPlanes!!!!
*/

}
return 1;
}

//==========MY VEH FUNCTIONS := Vozila OWNERSHIP================================
//Player KeySet
stock ConvertVehIDtoDYID(VehID)
{
for(new dy; dy < sizeof(MyVehicle);dy++)
{
    if(MyVehicle == 1)
{
    if(VehID == MyVehicle) return dy;
}
}
return -1;
}

stock PlayerOwnedVehID(playerid,vehicleid)
{
new ime;
GetPlayerName(playerid,ime,sizeof(ime));
for(new i = 0; i < sizeof(MyVehicle); i++)
{
    if(MyVehicle == 1 && MyVehicle == vehicleid)
  {
if (strmatch(MyVehicle, ime))return i;
}
}
return -1;
}
stock AllMyBikes(playerid)//bike
{
new ime;
GetPlayerName(playerid,ime,sizeof(ime));
if(IsPlayerConnected(playerid))
{
    new i, x;
    while (i < sizeof(MyVehicle))
    {
    if(MyVehicle == 1)
  {
      if(MyVehicle != -1)
      {
if (strmatch(MyVehicle, ime)) x++;
}
}
i++;
}
return x;
}
return -1;
}

stock GetMyBikeMID(playerid,ID = 0)//bike
{
new ime;
GetPlayerName(playerid,ime,sizeof(ime));
new x = 0;
    for (new i; i < sizeof(MyVehicle);i++)
    {
    if(MyVehicle == 1)
  {
      if(MyVehicle != -1)
      {
if (strmatch(MyVehicle, ime))
{ x++;
if(x >= ID )
{return i;}
// return i;
}
}
}
}
return -1;
}

stock AllMyCars(playerid)//car
{
new ime;
GetPlayerName(playerid,ime,sizeof(ime));
if(IsPlayerConnected(playerid))
{
    new i, x;
    while (i < sizeof(MyVehicle))
    {
    if(MyVehicle == 1)
  {
      if(MyVehicle != -1)
      {
if (strmatch(MyVehicle, ime)) x++;
}
}
i++;
}
return x;
}
return -1;
}

stock GetMyCarMID(playerid,ID = 0)//car
{
new ime;
GetPlayerName(playerid,ime,sizeof(ime));
new x = 0;
    for (new i; i < sizeof(MyVehicle);i++)
    {
    if(MyVehicle == 1)
  {
      if(MyVehicle != -1)
      {
if (strmatch(MyVehicle, ime))
{ x++;
if(x >= ID )
{return i;}
// return i;
}
}
}
}
return -1;
}
stock AllMyBoats(playerid)//boat
{
new ime;
GetPlayerName(playerid,ime,sizeof(ime));
if(IsPlayerConnected(playerid))
{
    new i, x;
    while (i < sizeof(MyVehicle))
    {
    if(MyVehicle == 1)
  {
      if(MyVehicle != -1)
      {
if (strmatch(MyVehicle, ime)) x++;
}
}
i++;
}
return x;
}
return -1;
}

stock GetMyBoatMID(playerid,ID = 0)//boat
{
new ime;
GetPlayerName(playerid,ime,sizeof(ime));
new x = 0;
    for (new i; i < sizeof(MyVehicle);i++)
    {
    if(MyVehicle == 1)
  {
      if(MyVehicle != -1)
      {
if (strmatch(MyVehicle, ime))
{ x++;
if(x >= ID )
{return i;}
// return i;
}
}
}
}
return -1;
}
stock AllMyAirs(playerid)//air
{
new ime;
GetPlayerName(playerid,ime,sizeof(ime));
if(IsPlayerConnected(playerid))
{
    new i, x;
    while (i < sizeof(MyVehicle))
    {
    if(MyVehicle == 1)
  {
      if(MyVehicle != -1)
      {
if (strmatch(MyVehicle, ime)) x++;
}
}
i++;
}
return x;
}
return -1;
}

stock GetMyAirMID(playerid,ID = 0)//air
{
new ime;
GetPlayerName(playerid,ime,sizeof(ime));
new x = 0;
    for (new i; i < sizeof(MyVehicle);i++)
    {
    if(MyVehicle == 1)
  {
      if(MyVehicle != -1)
      {
if (strmatch(MyVehicle, ime))
{ x++;
if(x >= ID )
{return i;}
// return i;
}
}
}
}
return -1;
}
stock MyCarID(playerid)
{
if(IsPlayerInAnyVehicle(playerid))
    {
for(new i = 0; i < sizeof(MyVehicle); i++)
{
if(GetPlayerVehicleID(playerid) == MyVehicle)return i;
}
  }
return -1;
}
//fnc
stock strmatch(const String1[], const String2[])
{
if ((strcmp(String1, String2, true, strlen(String2)) == 0) && (strlen(String2) == strlen(String1)))
{return true;}
else
{return false;}
}
stock Float:GetDisBetweenPlayerAndCar(p1ayerid,carid)
{
    new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
    if(!IsPlayerConnected(p1ayerid))
    {
        return -1.00;
    }
    GetPlayerPos(p1ayerid,x1,y1,z1);
    GetVehiclePos(carid,x2,y2,z2);
    return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
}

stock GetClosestVehicleToPlayer(playerid)
{
    new x,Float:dis,Float:dis2,car;
    car = 0;
    dis = 99999.99;
    for ( x = 0; x < MAX_VEHICLES; x++ )
    {
        dis2 = GetDisBetweenPlayerAndCar(playerid,x);
        if(dis2 < dis && dis2 < 10.0)
        {
            dis = dis2;
            car = x;
        }
    }
    return car;
}
stock VehPriceFromModel(Model)
{
for(new i = 0; i < 29; i++)
    {
        if(vCars == Model) return i;
    }
return 0;
}
//Veh Functions
stock MakeXDCarFnc(playerid,X_THREAD,Model,Float:x,Float:y,Float:z,Float:a,col1,col2,name[])//THREAD-0=car=bike,2=boat,3=air
{
    for(new i = 0; i < sizeof(MyVehicle); i++ )
{
if(MyVehicle == 0)
{
MyVehicle = Model;
MyVehicle=  x;
MyVehicle = y;
MyVehicle = z;
MyVehicle = a;
MyVehicle = col1;
MyVehicle = col2;
MyVehicle = 0;
MyVehicle = 0;
MyVehicle = -1;
MyVehicle = -1;
MyVehicle = -1;
MyVehicle = -1;
strmid(MyVehicle, name, 0, strlen(name), 32);

MyVehicle = CreateVehicle(
MyVehicle,
MyVehicle,
MyVehicle,
MyVehicle,
MyVehicle,
MyVehicle,
MyVehicle,
30000);
switch(X_THREAD)
        {
        case 0:// osobni auto
              {
GivePlayerMoney(playerid, -vCars[ShopVeh1]);
MyVehicle = 1;
MyVehicle = 1;
SCM(playerid, COLOR_GREEN, "Kupio si auto!!");
              }
              case 1://bike
              {
                      GivePlayerMoney(playerid, -vBikes[ShopVeh2]);
                      MyVehicle = 1;
MyVehicle = 1;
SCM(playerid, COLOR_GREEN, "Kupio si motor!!");
              }
              case 2:// boat
              {
                      //take money
              MyVehicle = 1;
MyVehicle = 1;
SCM(playerid, COLOR_GREEN, "Kupio si brod!!");
      }
      case 3:// air
              {
//take money
                      MyVehicle = 1;
MyVehicle = 1;
SCM(playerid, COLOR_GREEN, "Kupio si avion!!");
      }
      }
      UpdateMyVehSystem(i);
printf("MYVC %d,THR %d",i,X_THREAD);
return i;
}
}
return 1;
}
stock ParkMyVehFnc(playerid)
{
// new str;
new vozilo = GetPlayerVehicleID(playerid);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(PlayerOwnedVehID(playerid,vozilo) != -1)
{
new Float:x,Float:y,Float:z;
new Float:a;
GetVehiclePos(vozilo, x, y, z);
GetVehicleZAngle(vozilo, a);
MyVehicle[PlayerOwnedVehID(playerid,vozilo)] = x;
MyVehicle[PlayerOwnedVehID(playerid,vozilo)] = y;
MyVehicle[PlayerOwnedVehID(playerid,vozilo)] = z;
MyVehicle[PlayerOwnedVehID(playerid,vozilo)] = a;
SetVehiclePos(vozilo, MyVehicle[PlayerOwnedVehID(playerid,vozilo)], MyVehicle[PlayerOwnedVehID(playerid,vozilo)],MyVehicle[PlayerOwnedVehID(playerid,vozilo)]);
SetVehicleZAngle(vozilo, MyVehicle[PlayerOwnedVehID(playerid,vozilo)]);
if(MyVehicle[PlayerOwnedVehID(playerid,vozilo)] != -1)SCM(playerid, COLOR_GREEN, "Parkirao si svoj auto!");
if(MyVehicle[PlayerOwnedVehID(playerid,vozilo)] != -1)SCM(playerid, COLOR_GREEN, "Parkirao si svoj motor!");
if(MyVehicle[PlayerOwnedVehID(playerid,vozilo)] != -1)SCM(playerid, COLOR_GREEN, "Parkirao si svoj brod!");
if(MyVehicle[PlayerOwnedVehID(playerid,vozilo)] != -1)SCM(playerid, COLOR_GREEN, "Parkirao si svoj avion!");
UpdateMyVehSystem(PlayerOwnedVehID(playerid,vozilo));
return 1;
}else{SCM(playerid, COLOR_LIGHTRED,"Nisi u svom vozilu!");}
}else{SCM(playerid, COLOR_LIGHTRED,"Moras biti u vozilu!");}
return 0;
}
stock SellMyVehFnc(playerid)
{
//if(IsPlayerInRangeOfPoint(playerid,15.0,1314.5691,-1859.4077,13.7969)){
    new ime, TCID;
new vozilo = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, ime, sizeof(ime));
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(PlayerOwnedVehID(playerid,vozilo) != -1)
{
TCID =PlayerOwnedVehID(playerid,vozilo);
MyVehicle = 0;
MyVehicle = -1;
MyVehicle = -1;
MyVehicle = -1;
MyVehicle = -1;
strmid(MyVehicle, "Nitko", 0, strlen("Nitko"), 128);
DestroyVehicle(vozilo);
SCM(playerid, COLOR_GREEN, "Prodao si svoje vozilo");
UpdateMyVehSystem(TCID);
return 1;
}else{SCM(playerid, COLOR_LIGHTRED,"Nisi u svom vozilu!");}
}else{SCM(playerid, COLOR_LIGHTRED,"Moras biti u vozilu!");}
// }else{SCM(playerid, COLOR_LIGHTRED, "You are not at delivery place!");}
return 1;
}

stock LocateMyVehFnc(playerid,THREAD_V)//0=my_car,1_my_bike,2_my_boat,3_my_air
{
    switch(THREAD_V)
  {
case 0:// mycar
{
new cm = AllMyCars(playerid);
if(cm > 0)
  {
  clx ++;
    if(clx > cm) {clx = 0;}
    new Float:VPos;
    GetVehiclePos(MyVehicle[GetMyCarMID(playerid,clx)], VPos,VPos,VPos);
    SetPlayerCheckpoint(playerid,VPos,VPos,VPos,8.0);
    if(clx == 0){DisablePlayerCheckpoint(playerid);}
}else{SCM(playerid, COLOR_LIGHTRED, "Nemas vozilo ove vrste!");}
}
case 1:// mybike
{
    new cm = AllMyBikes(playerid);
if(cm > 0)
  {
  clx ++;
    if(clx > cm) {clx = 0;}
    new Float:VPos;
    GetVehiclePos(MyVehicle[GetMyBikeMID(playerid,clx)], VPos,VPos,VPos);
    SetPlayerCheckpoint(playerid,VPos,VPos,VPos,8.0);
    if(clx == 0){DisablePlayerCheckpoint(playerid);}
}else{SCM(playerid, COLOR_LIGHTRED, "Nemas vozilo ove vrste!");}
}
case 2:// myboat
{
    new cm = AllMyBoats(playerid);
if(cm > 0)
  {
  clx ++;
    if(clx > cm) {clx = 0;}
    new Float:VPos;
    GetVehiclePos(MyVehicle[GetMyBoatMID(playerid,clx)], VPos,VPos,VPos);
    SetPlayerCheckpoint(playerid,VPos,VPos,VPos,8.0);
    if(clx == 0){DisablePlayerCheckpoint(playerid);}
}else{SCM(playerid, COLOR_LIGHTRED, "Nemas vozilo ove vrste!");}
}
case 3:// myair
{
    new cm = AllMyAirs(playerid);
if(cm > 0)
  {
  clx ++;
    if(clx > cm) {clx = 0;}
    new Float:VPos;
    GetVehiclePos(MyVehicle[GetMyAirMID(playerid,clx)], VPos,VPos,VPos);
    SetPlayerCheckpoint(playerid,VPos,VPos,VPos,8.0);
    if(clx == 0){DisablePlayerCheckpoint(playerid);}
}else{SCM(playerid, COLOR_LIGHTRED, "Nemas vozilo ove vrste!");}
}
}
return 0;
}

stock LockMyVehFnc(playerid)
{
new TCID,Float:CPs;
    TCID = GetClosestVehicleToPlayer(playerid);
    GetVehiclePos(TCID,CPs,CPs,CPs);
if(IsPlayerInRangeOfPoint(playerid,3.0,CPs,CPs,CPs))
{
    if(PlayerOwnedVehID(playerid,TCID) != -1)
{
    if(MyVehicle[PlayerOwnedVehID(playerid,TCID)] == 0)
    {
    MyVehicle[PlayerOwnedVehID(playerid,TCID)] = 1;
            SCM(playerid, COLOR_LIGHTRED, "Vozilo zakljucano!");
    }
    else if(MyVehicle[PlayerOwnedVehID(playerid,TCID)] == 1)
    {
        MyVehicle[PlayerOwnedVehID(playerid,TCID)] = 0;
        SCM(playerid, COLOR_LIGHTGREEN, "Vozilo otkljucano!");
    }
    UpdateMyVehSystem(PlayerOwnedVehID(playerid,TCID));
}else{SCM(playerid, COLOR_LIGHTRED, "Ovo nije tvoje vozilo!");}
}else{SCM(playerid, COLOR_LIGHTRED, "Predaleko ste!");}
return 0;
}
//Admin cmds
stock AparkMyVeh(playerid, MyCarID)
{
if(IsPlayerAdmin(playerid))
{
new vozilo = GetPlayerVehicleID(playerid);
    new Float:x,Float:y,Float:z;
new Float:a;
GetVehiclePos(vozilo, x, y, z);
GetVehicleZAngle(vozilo, a);
MyVehicle = x;
MyVehicle = y;
MyVehicle = z;
MyVehicle = a;
SetVehiclePos(vozilo, MyVehicle, MyVehicle,MyVehicle);
SetVehicleZAngle(vozilo, MyVehicle);
SCM(playerid, COLOR_GREEN, "Vozilo parkirano!");
UpdateMyVehSystem(MyCarID);
}else{SCM(playerid, COLOR_LIGHTRED, "Niste autorizirani za koristenje ove komande!");}
return 1;
}

stock AsellMyVeh(playerid, MyCarID)
{
if(IsPlayerAdmin(playerid))
{
    MyVehicle = 0;
MyVehicle = 0;
MyVehicle = -1;
MyVehicle = -1;
MyVehicle = -1;
MyVehicle = 1;
strmid(MyVehicle, "Nitko", 0, strlen("Nitko"), 64);
DestroyVehicle(MyVehicle);
SCM(playerid, COLOR_LIGHTGREEN, " Vozilo prodano!");
UpdateMyVehSystem(MyCarID);
}else{SCM(playerid, COLOR_LIGHTRED, "Niste autorizirani za koristenje ove komande!");}
return 1;
}

//Saving/loading system
stock LoadMyVehSystem()
{
new reload;
new loader;
if(!dini_Exists(SaveFile))
{
dini_Create(SaveFile);
}
for(new i = 0;i {
    format(loader,sizeof(loader),"MyCar_%d",i);
    strmid(reload,dini_Get(SaveFile,loader),0,256,256);
new data2; //STRING
sscanf(reload,
"p<,>dd\
ffff\
ddd\
s\
d\
dddd\
d",
MyVehicle,MyVehicle,
MyVehicle,MyVehicle,MyVehicle,MyVehicle,
MyVehicle,MyVehicle,MyVehicle,
data2, // string
MyVehicle,
MyVehicle,MyVehicle,MyVehicle,MyVehicle,
MyVehicle);
strmid(MyVehicle, data2, 0, strlen(data2), 64);// kraj loadanja

if(MyVehicle == 1 && (MyVehicle != -1 || MyVehicle != -1 || MyVehicle != -1 || MyVehicle != -1))
{
MyVehicle = CreateVehicle(MyVehicle,MyVehicle,MyVehicle,MyVehicle,MyVehicle,MyVehicle,MyVehicle,30000);
}
}
  return 1;
}

stock UpdateMyVehSystem(id)
{
new GSi;
new place;
if(!dini_Exists(SaveFile))
{
dini_Create(SaveFile);
}
format(GSi,sizeof(GSi),
"%d,%d,\
%f,%f,%f,%f,\
%d,%d,%d,\
%s,\
%d,\
%d,%d,%d,%d,\
%d",
MyVehicle,MyVehicle,
MyVehicle,MyVehicle,MyVehicle,MyVehicle,
MyVehicle,MyVehicle,MyVehicle,
MyVehicle, // string
MyVehicle,
MyVehicle,MyVehicle,MyVehicle,MyVehicle,
MyVehicle);
format(place,sizeof(place),"MyCar_%d",id);
    dini_Set(SaveFile,place,GSi);
    printf("ID %d SET",id);
    if(MyVehicle == 0)
        {
                format(GSi,sizeof(GSi),
"%d,%d,\
%f,%f,%f,%f,\
%d,%d,%d,\
%s,\
%d,\
%d,%d,%d,%d,\
%d",
MyVehicle,MyVehicle,
MyVehicle,MyVehicle,MyVehicle,MyVehicle,
MyVehicle,MyVehicle,MyVehicle,
MyVehicle, // string
MyVehicle,
MyVehicle,MyVehicle,MyVehicle,MyVehicle,
MyVehicle);
format(place,sizeof(place),"MyCar_%d",id);
            dini_Unset(SaveFile ,place);
            printf("ID %d UNSET",id);
        }
  return 1;
}

//======================= COMMANDS =============================================
CMD:carshop(playerid,params[])
{
if(IsShoping == 0)
{
if(GetPlayerState(playerid) != 2)
{
if(IsPlayerInRangeOfPoint(playerid,7.00,1292.0682,-1870.6963,13.3741))
{
    new string;
TogglePlayerControllable(playerid, 0);
IsShoping = 1;
  SCM(playerid, COLOR_LIGHTBLUE, " Koristi tipke lijevo i desno za listanje vozila!");
  SCM(playerid, COLOR_LIGHTBLUE, " Za kupnju pritisni enter (F)");
  SCM(playerid, COLOR_LIGHTBLUE, " Za prekid pritisni CTRL");
  SVozilaTextDraw(playerid);
  format(string,sizeof(string),"~w~%s~n~~n~~h~~h~~b~Cijena: %d~n~~n~~h~~h~~y~< ~g~dalje ~h~~h~~y~>",VehNames[vCars[ShopVeh1] -400],vCars[ShopVeh1]);
TextDrawSetString(CarShopTextDraw,string);
}else{SCM(playerid, COLOR_LIGHTRED, " Nisi u salonu!");}
}else{SCM(playerid, COLOR_LIGHTRED, " Nemozes kupovati iz vozila!");}
}else{SCM(playerid, COLOR_LIGHTRED, " Vec listas katalog!");}
return 1;
}

CMD:carshopcol(playerid,params[])
{
    if(IsPlayerInRangeOfPoint(playerid,7.00,1292.0682,-1870.6963,13.3741))
{
    new boja1,boja2;
if (sscanf(params, "dd",boja1,boja2)) SCM(playerid, COLOR_WHITE, "Koristenje: /carshopcol [boja 1] [boja2 2]");
else if(boja1 < 0 || boja1 > 126)  SCM(playerid, COLOR_WHITE, "Boja nesmije biti ispod 0 i iznad 126!!");
else if(boja2 < 0 || boja2 > 126)  SCM(playerid, COLOR_WHITE, "Boja nesmije biti ispod 0 i iznad 126!!");
else
{
    ShopVeh1 = boja1;
ShopVeh1 = boja2;
ChangeVehicleColor(ShopVeh1,boja1,boja2);
SCM(playerid, COLOR_LIGHTBLUE, "*Promjenio si boju kataloga!");
}
}else{SCM(playerid, COLOR_LIGHTRED, " Nisi u salonu!");}
return 1;
}
CMD:bikeshop(playerid,params[])
{
if(IsShoping == 0)
{
if(GetPlayerState(playerid) != 2)
{
if(IsPlayerInRangeOfPoint(playerid,7.00,1298.7928,-1870.8855,13.5469))
{
    new string;
TogglePlayerControllable(playerid, 0);
IsShoping = 2;
  SCM(playerid, COLOR_LIGHTBLUE, " Koristi tipke lijevo i desno za listanje vozila!");
  SCM(playerid, COLOR_LIGHTBLUE, " Za kupnju pritisni enter (F)");
  SCM(playerid, COLOR_LIGHTBLUE, " Za prekid pritisni CTRL");
  SVozilaTextDraw(playerid);
  format(string,sizeof(string),"~w~%s~n~~n~~h~~h~~b~Cijena: %d~n~~n~~h~~h~~y~< ~g~dalje ~h~~h~~y~>",VehNames[vBikes[ShopVeh2] -400],vBikes[ShopVeh2]);
TextDrawSetString(CarShopTextDraw,string);
}else{SCM(playerid, COLOR_LIGHTRED, " Nisi u salonu!");}
}else{SCM(playerid, COLOR_LIGHTRED, " Nemozes kupovati iz vozila!");}
}else{SCM(playerid, COLOR_LIGHTRED, " Vec listas katalog!");}
return 1;
}
CMD:bikeshopcol(playerid,params[])
{
    if(IsPlayerInRangeOfPoint(playerid,7.00,1298.7928,-1870.8855,13.5469))
{
    new boja1,boja2;
if (sscanf(params, "dd",boja1,boja2)) SCM(playerid, COLOR_WHITE, "Koristenje: /bikeshopcol [boja 1] [boja 2]");
else if(boja1 < 0 || boja1 > 126)  SCM(playerid, COLOR_WHITE, "Boja nesmije biti ispod 0 i iznad 126!!");
else if(boja2 < 0 || boja2 > 126)  SCM(playerid, COLOR_WHITE, "Boja nesmije biti ispod 0 i iznad 126!!");
else
{
    ShopVeh2 = boja1;
ShopVeh2 = boja2;
ChangeVehicleColor(ShopVeh2,boja1,boja2);
SCM(playerid, COLOR_LIGHTBLUE, "*Promjenio si boju kataloga!");
}
}else{SCM(playerid, COLOR_LIGHTRED, " Nisi u salonu!");}
return 1;
}

CMD:buyveh(playerid,params[])
{
if(EnCV != -1)
{
    if(MyVehicle[EnCV] > 0)
    {
if(MyVehicle[EnCV] <= GetPlayerMoney(playerid))
{
    new Float:CPs;
   
    GetVehiclePos(MyVehicle[EnCV],CPs,CPs,CPs);
if(IsPlayerInRangeOfPoint(playerid,4.2,CPs,CPs,CPs))
{
    if(MyVehicle[EnCV] == 1 && AllMyCars(playerid) >= MAX_BUYED_VEHS) return SCM(playerid, COLOR_LIGHTRED, "Nemozes kupiti vise vozila ove vrste!");
    if(MyVehicle[EnCV] == 1 && AllMyBikes(playerid) >= MAX_BUYED_VEHS) return SCM(playerid, COLOR_LIGHTRED, "Nemozes kupiti vise vozila ove vrste!");
    if(MyVehicle[EnCV] == 1 && AllMyBoats(playerid) >= MAX_BUYED_VEHS) return SCM(playerid, COLOR_LIGHTRED, "Nemozes kupiti vise vozila ove vrste!");
    if(MyVehicle[EnCV] == 1 && AllMyAirs(playerid) >= MAX_BUYED_VEHS) return SCM(playerid, COLOR_LIGHTRED, "Nemozes kupiti vise vozila ove vrste!");
        new ime;
        GetPlayerName(playerid,ime,sizeof(ime));
        GivePlayerMoney(playerid, -MyVehicle[EnCV]);
strmid(MyVehicle[EnCV], ime, 0, strlen(ime), 64);
MyVehicle[EnCV] = 0;
UpdateMyVehSystem(EnCV);
EnCV = -1;
SCM(playerid, COLOR_GREEN, "You bought vehicle!");
}else{SCM(playerid, COLOR_LIGHTRED, "Nisi pokraj vozila kojeg zelis kupiti!");}
}else{SCM(playerid, COLOR_LIGHTRED, "Nemas dovoljno novca!");}
        }else{SCM(playerid, COLOR_LIGHTRED, "Ovo vozilo nije na prodaju!");}
    }else{SCM(playerid, COLOR_LIGHTRED, "Nisi pogledao niti jedan auto za kupnju!");}
  return 1;
}
CMD:sellveh(playerid, params[])
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
    new vozilo = GetPlayerVehicleID(playerid);
if(PlayerOwnedVehID(playerid,vozilo) != -1)
{
new Novac;
new Float:x,Float:y,Float:z;
new Float:a;
if (sscanf(params, "d",Novac)) SCM(playerid, COLOR_WHITE, "Koristenje: /sellveh ");
else
{
    GetVehiclePos(vozilo, x, y, z);
GetVehicleZAngle(vozilo, a);
    strmid(MyVehicle[MyCarID(playerid)], "Nitko", 0, strlen("Nitko"), 24);
MyVehicle[MyCarID(playerid)] = Novac;
GivePlayerMoney(playerid, Novac);
MyVehicle[MyCarID(playerid)] = x;
MyVehicle[MyCarID(playerid)] = y;
MyVehicle[MyCarID(playerid)] = z;
MyVehicle[MyCarID(playerid)] = a;
SetVehiclePos(vozilo, MyVehicle[MyCarID(playerid)], MyVehicle[MyCarID(playerid)],MyVehicle[MyCarID(playerid)]);
SetVehicleZAngle(vozilo, MyVehicle[MyCarID(playerid)]);
RemovePlayerFromVehicle(playerid);
    UpdateMyVehSystem(MyCarID(playerid));
SCM(playerid, COLOR_GREEN, "Prodao si svoje vozilo!");
}
            }else{SCM(playerid, COLOR_LIGHTRED, "Nemas dokumente ovog vozila!");}
        }else{SCM(playerid, COLOR_LIGHTRED, "Moras biti u vozilu!");}
    return 1;
}

CMD:mycar(playerid,params[])
{
new opcija,ime;
if (sscanf(params, "s", opcija)) SCM(playerid, COLOR_WHITE, "Koristenje: /mycar "),SCM(playerid, COLOR_WHITE, "opcija: park, lock, sell, locate");
else
{
GetPlayerName(playerid, ime,sizeof(ime));
if(strmatch("park",opcija))
  {
  ParkMyVehFnc(playerid);
          return 1;
      }
      if(strmatch("lock",opcija))
  {
        LockMyVehFnc(playerid);
          return 1;
      }
      if(strmatch("sell",opcija))
  {
        SellMyVehFnc(playerid);
          return 1;
      }
      if(strmatch("locate",opcija))
  {
        LocateMyVehFnc(playerid,0);
          return 1;
      }
}
return 1;
}

CMD:mybike(playerid,params[])
{
new opcija,ime;
if (sscanf(params, "s", opcija)) SCM(playerid, COLOR_WHITE, "Koristenje: /mybike "),SCM(playerid, COLOR_WHITE, "opcija: park, lock, sell, locate");
else
{
GetPlayerName(playerid, ime,sizeof(ime));
if(strmatch("park",opcija))
  {
  ParkMyVehFnc(playerid);
          return 1;
      }
      if(strmatch("lock",opcija))
  {
        LockMyVehFnc(playerid);
          return 1;
      }
      if(strmatch("sell",opcija))
  {
        SellMyVehFnc(playerid);
          return 1;
      }
      if(strmatch("locate",opcija))
  {
        LocateMyVehFnc(playerid,1);
          return 1;
      }
}
return 1;
}
CMD:myboat(playerid,params[])
{
new opcija,ime;
if (sscanf(params, "s", opcija)) SCM(playerid, COLOR_WHITE, "Koristenje: /myboat "),SCM(playerid, COLOR_WHITE, "opcija: park, lock, sell, locate");
else
{
GetPlayerName(playerid, ime,sizeof(ime));
if(strmatch("park",opcija))
  {
  ParkMyVehFnc(playerid);
          return 1;
      }
      if(strmatch("lock",opcija))
  {
        LockMyVehFnc(playerid);
          return 1;
      }
      if(strmatch("sell",opcija))
  {
        SellMyVehFnc(playerid);
          return 1;
      }
      if(strmatch("locate",opcija))
  {
        LocateMyVehFnc(playerid,2);
          return 1;
      }
}
return 1;
}
CMD:myair(playerid,params[])
{
new opcija,ime;
if (sscanf(params, "s", opcija)) SCM(playerid, COLOR_WHITE, "Koristenje: /myair "),SCM(playerid, COLOR_WHITE, "opcija: park, lock, sell, locate");
else
{
GetPlayerName(playerid, ime,sizeof(ime));
if(strmatch("park",opcija))
  {
  ParkMyVehFnc(playerid);
          return 1;
      }
      if(strmatch("lock",opcija))
  {
        LockMyVehFnc(playerid);
          return 1;
      }
      if(strmatch("sell",opcija))
  {
        SellMyVehFnc(playerid);
          return 1;
      }
      if(strmatch("locate",opcija))
  {
        LocateMyVehFnc(playerid,3);
          return 1;
      }
}
return 1;
}

CMD:apark(playerid,params[])
{
    if(IsPlayerInAnyVehicle(playerid))
{
    AparkMyVeh(playerid, MyCarID(playerid));
}
return 1;
}
CMD:asellveh(playerid,params[])
{
    if(IsPlayerInAnyVehicle(playerid))
{
    AsellMyVeh(playerid, MyCarID(playerid));
}
return 1;
}
CMD:makesaleveh(playerid, params[])
{
new vrsta,model,boja1,boja2,cijena;
if (sscanf(params, "ddddd",vrsta,model,boja1,boja2,cijena)) SCM(playerid, COLOR_WHITE, "Koristenje: /makesaleveh ");
else if(vrsta < 0 || vrsta > 3)  SCM(playerid, COLOR_LIGHTGREEN, "Vrste: 0-Auto,1-Motor,2-Brod,3-Avion");
else if(model < 400 || model > 611)  SCM(playerid, COLOR_WHITE, "Model vozila nemoze biti ispod 400 i preko 611!");
else if(boja1 < 0 || boja1 > 126)  SCM(playerid, COLOR_WHITE, "Boja vozila nemoze biti ispod 0 i preko 126!");
else if(boja2 < 0 || boja2 > 126)  SCM(playerid, COLOR_WHITE, "Boja vozila nemoze biti ispod 0 i preko 126!");
else if(cijena < 1 || cijena > 99999999)  SCM(playerid, COLOR_WHITE, "Cijena nemoze biti ispod 0!");
else
{
    if(IsPlayerAdmin(playerid))
    {
new Float:X,Float:Y,Float:Z,Float:A, s;
GetPlayerPos(playerid, X,Y,Z);
s = MakeXDCarFnc(playerid,vrsta,model,X+1.5,Y+2.5,Z+2.0,A,boja1,boja2,"Nitko");//THREAD-0=car=bike,2=boat,3=air
MyVehicle = cijena;
SCM(playerid, COLOR_LIGHTRED, "Stvorio si vozilo za prodaju!");
printf("TYP:%d, ID:%d",vrsta,s);
UpdateMyVehSystem(s);
}else{SCM(playerid, COLOR_LIGHTRED, "Niste autorizirani za koristenje ove komande!");}
}
return 1;
}

CMD:vehhelp(playerid,params[])
{
    SCM(playerid, COLOR_LIGHTBLUE, "|_____________________Vozila pomoc____________________|");
    SCM(playerid, COLOR_LIGHTBLUE, "CMD: /carshop, /carshopcol, /bikeshop, /bikeshopcol");
    SCM(playerid, COLOR_LIGHTBLUE, "CMD: /mycar");
    SCM(playerid, COLOR_LIGHTBLUE, "CMD: /mybike");
    SCM(playerid, COLOR_LIGHTBLUE, "CMD: /myboat (Treba samo napraviti salon)");
    SCM(playerid, COLOR_LIGHTBLUE, "CMD: /myair (Treba samo napraviti salon)");
    SCM(playerid, COLOR_LIGHTBLUE, "CMD: /sellveh, /buyveh (kada pokusate uci i cijena se pokaze))");
    SCM(playerid, COLOR_LIGHTBLUE, "ADMIN: /asellveh, /apark, /makesaleveh");
    return 1;
}

Ismet_BN
4
Made Man
3. Mar. 2013.
,
MyVehCol,
MyVehLock,
MyVehOwner,
MyVehAlarm,
MyVehFsale,
MyVehID,
MyVehCar,
MyVehBike,
MyVehBoat,
MyVehPlane
};
new MyVehicle;

new Text:CarShopTextDraw;
new IsShoping;
new ShopVeh1;//0 ID,1 Model,2 col1,3 ol2 car
new ShopVeh2;//0 ID,1 Model,2 col1,3 ol2 bike
new VehButtonSet;
new clx = 0;
new EnCV;
new vCars =
{
    {411,650000},
{415,520000},
{424,380000},
{426,180000},
{429,400000},
{434,540000},
{437,500000},
{444,850000},
{451,750000},
{477,385000},
{480,240000},
{502,600000},
{503,600000},
{506,470000},
{541,489000},
{550,210000},
{555,241000},
{559,390000},
{558,180000},
{560,500000},
{561,150000},
{562,432156},
{565,170000},
{568,200000},
{579,190500},
{587,456456},
{589,100000},
{602,320000},
{603,270000}
};
new vBikes={
{581,21000},//BF-400
{462,1000},//Faggio
{521,16000},//FCR-900
{463,25000},//Freeway
{522,45000},//NRG-500
{461,20000},//PCJ-600
{448,1000},//Pizzaboy
{471,5000},//Quad
{468,30000},//Sanchez
{586,30000}//Wayfarer
};

new VehNames[] = {
"Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana","Infernus","Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto",
"Taxi","Washington","Bobcat","Mr Whoopee","BF Injection","Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","server uklonjen!ch","Cabbie","Stallion",
"Rumpo","RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder","Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van",
"Skimmer","PCJ-600","Faggio","Freeway","RC Baron","RC Raider","Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","server uklonjen!stguard","Dinghy","Hermes","Sabre","Rustler","ZR350","Walton","Regina",
"Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo","Greenwood","Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson",
"Mesa","RC Goblin","Hotring Racer","Hotring Racer","Bloodring Banger","Rancher","Super GT","Elegant","Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain","Nebula","Majestic","Buccaneer","Shamal",
"Hydra","FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona","FBI Truck","Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex",
"Vincent","Bullet","Clover","Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster","Monster","Uranus","Jester",
"Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight","Trailer","Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley",
"Stafford","BF-400","Newsvan","Tug","Trailer","Emperor","Wayfarer","Euros","Hotdog","Club","Trailer","Trailer","Andromada","Dodo","RC Cam","Launch","Police Car (LSPD)","Police Car (SFPD)","Police Car (LVPD)","Police Ranger",
"Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer","Luggage Trailer","Stair Trailer","Boxville","Farm Plow","Utility Trailer"
};
//==============================================================================

public OnFilterScriptInit()
{
return 1;
}

public OnGameModeInit()
{
ShopVeh1 = CreateVehicle(vCars[ShopVeh1], 1292.0682,-1870.6963,13.3741,358.0040, ShopVeh1, ShopVeh1, 30000);
ShopVeh2 = CreateVehicle(vBikes[ShopVeh2],1298.7928,-1870.8855,13.5469,349.0682, ShopVeh2, ShopVeh2, 30000);
CVozilaTextDraw(); // textdraw
LoadMyVehSystem(); // loadanje lvl 1
print("\n----------------------------------");
print(":::::::::Loading Ismet iCos::::::::");
print("----------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
    DVozilaTextDraw();// unistava textdraw
    for(new i; i< MAX_MYVEHS;i++)
    {
        if(MyVehicle == 1)
        {
            DestroyVehicle(MyVehicle);
        }
    }
    print("\n----------------------------------");
print("::::::::Unloading Ismet iCos:::::::");
print("----------------------------------\n");
return 1;
}

main()
{
}

public OnPlayerConnect(playerid)
{
EnCV = -1;
return 1;
}

public OnPlayerDisconnect(playerid,reason)
{
EnCV = -1;
return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    new Float😛EnterPos;
new string;
GetPlayerPos(playerid,PEnterPos,PEnterPos,PEnterPos);
if(ConvertVehIDtoDYID(vehicleid) != -1)
{
    new i;
    i = ConvertVehIDtoDYID(vehicleid);
if(MyVehicle == 1 && (MyVehicle != -1 || MyVehicle != -1 || MyVehicle != -1 || MyVehicle != -1) && MyVehicle < 1)
{
      format(string, sizeof(string), "~y~~h~VLASNIK:~y~ %s",MyVehicle);
      GameTextForPlayer(playerid,string,2000,3);
            if(MyVehicle == 1 && !IsPlayerAdmin(playerid))
      {SetPlayerPos(playerid,PEnterPos,PEnterPos,PEnterPos);}
}
if(MyVehicle > 0)
{
  format(string, sizeof(string), "~y~~h~~h~%s~n~~y~~h~PRODAJE SE:~y~ %d$",VehNames[GetVehicleModel(vehicleid) - 400],MyVehicle);
      GameTextForPlayer(playerid,string,2000,3);
      EnCV = i;
    if(!IsPlayerAdmin(playerid)){SetPlayerPos(playerid,PEnterPos,PEnterPos,PEnterPos);}
      return 1;
  }
}
    if(vehicleid == ShopVeh1)
{SetPlayerPos(playerid,PEnterPos,PEnterPos,PEnterPos);
new cijena;
for(new x; x<29;x++){if(vCars == GetVehicleModel(ShopVeh1))cijena = vCars;}
format(string, sizeof(string), "~y~~h~~h~%s~n~~y~~h~PRODAJE SE:~y~ %d$",VehNames[GetVehicleModel(ShopVeh1) - 400],cijena);
GameTextForPlayer(playerid,string,2000,5);}
if(vehicleid == ShopVeh2)
{SetPlayerPos(playerid,PEnterPos,PEnterPos,PEnterPos);
new cijena;
for(new x; x<10;x++){if(vBikes == GetVehicleModel(ShopVeh2))cijena = vBikes;}
format(string, sizeof(string), "~y~~h~~h~%s~n~~y~~h~PRODAJE SE:~y~ %d$",VehNames[GetVehicleModel(ShopVeh2) - 400],cijena);
GameTextForPlayer(playerid,string,2000,5);}
return 1;
}
public OnVehicleSpawn(vehicleid)
{
if(ConvertVehIDtoDYID(vehicleid) != -1)
{
ChangeVehicleColor(vehicleid, MyVehicle[ConvertVehIDtoDYID(vehicleid)], MyVehicle[ConvertVehIDtoDYID(vehicleid)]);
SetVehiclePos(MyVehicle[ConvertVehIDtoDYID(vehicleid)], MyVehicle[ConvertVehIDtoDYID(vehicleid)],MyVehicle[ConvertVehIDtoDYID(vehicleid)],MyVehicle[ConvertVehIDtoDYID(vehicleid)]);
SetVehicleZAngle(MyVehicle[ConvertVehIDtoDYID(vehicleid)], MyVehicle[ConvertVehIDtoDYID(vehicleid)]);
}
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    if(ConvertVehIDtoDYID(vehicleid) != -1)
{
    MyVehicle[ConvertVehIDtoDYID(vehicleid)] = color1;
  MyVehicle[ConvertVehIDtoDYID(vehicleid)] = color2;
  UpdateMyVehSystem(ConvertVehIDtoDYID(vehicleid));
    }
    return 1;
}

public OnPlayerUpdate(playerid)
{
ResetVehButton(playerid);
return 1;
}

stock Ime(playerid)
{
new ime;
GetPlayerName(playerid, ime, MAX_PLAYER_NAME);
return ime;
}

//==========VOZILA := Vozila OWNERSHIP==========================================

stock CVozilaTextDraw()
{
for(new playerid = 0; playerid < MAX_PLAYERS; playerid ++)
{CarShopTextDraw = TextDrawCreate(295.500000,310.000000,"~y~Ime~n~~n~~h~~h~~b~Cijena:------~n~~n~~h~~h~~y~< ~g~dalje ~h~~h~~y~>");
    TextDrawAlignment(CarShopTextDraw,0);
    TextDrawBackgroundColor(CarShopTextDraw,0x000000ff);
    TextDrawFont(CarShopTextDraw,1);
    TextDrawLetterSize(CarShopTextDraw,0.499999,1.000000);
    TextDrawColor(CarShopTextDraw,0xF5DEB3AA);
    TextDrawSetOutline(CarShopTextDraw,1);
    TextDrawSetProportional(CarShopTextDraw,1);
    TextDrawSetShadow(CarShopTextDraw,1);}
}
stock HVozilaTextDraw(playerid)
{TextDrawHideForPlayer(playerid,CarShopTextDraw);}
stock SVozilaTextDraw(playerid)
{TextDrawShowForPlayer(playerid,CarShopTextDraw);}
stock DVozilaTextDraw()
{for(new playerid = 0; playerid < MAX_PLAYERS; playerid ++)
{TextDrawDestroy(CarShopTextDraw);}}

stock ResetVehButton(playerid)
{
if(IsShoping > 0)
{
new Keys, ud, lr;
GetPlayerKeys(playerid, Keys, ud, lr);
if(lr > 0) //desno
{VehButtonSet ++;
VehShopChanger(playerid);}
else if(lr < 0) //lijevo
{VehButtonSet ++;
VehShopChanger(playerid);}
else if(Keys & KEY_FIRE) //ctrl
{VehButtonSet++;
VehShopChanger(playerid);}
else if(Keys & KEY_SECONDARY_ATTACK) //enter
{VehButtonSet++;
VehShopChanger(playerid);}
else
{VehButtonSet = 0;
VehButtonSet = 0;
VehButtonSet = 0;
VehButtonSet = 0;
VehShopChanger(playerid);}
}
return 0;
}
stock VehShopChanger(playerid)
{
if(IsPlayerConnected(playerid))
{
if(IsShoping == 1)
{
new string,pa = 0;
new ime;
  GetPlayerName(playerid, ime, sizeof(ime));
if(VehButtonSet == 1) // desno
{ShopVeh1++;
if(ShopVeh1 > 2😎 {ShopVeh1 = 0;}pa = 1;}
else if(VehButtonSet == 1) //lijevo
{ShopVeh1--;
if (ShopVeh1 < 0) {ShopVeh1 = 28;}pa = 1;}
else if(VehButtonSet == 1) //enter
{
if(AllMyCars(playerid) < MAX_BUYED_VEHS)
{
if(GetPlayerMoney(playerid) >= vCars[ShopVeh1])
{

  MakeXDCarFnc(playerid,0,vCars[ShopVeh1],1314.9003,-1859.0258,13.3255,270.3405,ShopVeh1,ShopVeh1,ime);
  TogglePlayerControllable(playerid, 1);
IsShoping = 0;
HVozilaTextDraw(playerid);
SetCameraBehindPlayer(playerid);
          }else{format(string,sizeof(string),"Nemate dovoljno novca!Ovaj auto kosta %d$",vCars[ShopVeh1]);
  SCM(playerid,COLOR_LIGHTRED,string);}
    }else{SCM(playerid,COLOR_LIGHTRED,"Vec imas sve aute!");}
    }
    else if (VehButtonSet == 1)
    {TogglePlayerControllable(playerid, 1);
    SCM(playerid, COLOR_LIGHTBLUE, "Odustao si od kupnje novog auta!");
    IsShoping = 0;
    HVozilaTextDraw(playerid);
    SetCameraBehindPlayer(playerid);
}
if(pa > 0){
    DestroyVehicle(ShopVeh1);
ShopVeh1 = CreateVehicle(vCars[ShopVeh1], 1292.0682,-1870.6963,13.3741,358.0040, ShopVeh1,ShopVeh1, 30000);
format(string,sizeof(string),"~w~%s~n~~n~~h~~h~~b~Cijena: %d~n~~n~~h~~h~~y~< ~g~dalje ~h~~h~~y~>",VehNames[GetVehicleModel(ShopVeh1) - 400],vCars[ShopVeh1]);
TextDrawSetString(CarShopTextDraw,string);pa = 0;}
}
else if(IsShoping == 2)
{
new string,pa = 0;
new ime;
  GetPlayerName(playerid, ime, sizeof(ime));
if(VehButtonSet == 1) // desno
{ShopVeh2++;
if(ShopVeh2 > 9) {ShopVeh2 = 0;}pa = 1;}
else if(VehButtonSet == 1) //lijevo
{ShopVeh2--;
if (ShopVeh2 < 0) {ShopVeh2 = 28;}pa = 1;}
else if(VehButtonSet == 1) //enter
{
if(AllMyBikes(playerid) < MAX_BUYED_VEHS)
{
if(GetPlayerMoney(playerid) >= vBikes[ShopVeh2])
{

  MakeXDCarFnc(playerid,1,vBikes[ShopVeh2],1314.9003,-1859.0258,13.3255,270.3405,ShopVeh2,ShopVeh2,ime);
  TogglePlayerControllable(playerid, 1);
IsShoping = 0;
HVozilaTextDraw(playerid);
SetCameraBehindPlayer(playerid);
          }else{format(string,sizeof(string),"Nemate dovoljno novca!Ovaj motor kosta %d$",vBikes[ShopVeh1]);
  SCM(playerid,COLOR_LIGHTRED,string);}
    }else{SCM(playerid,COLOR_LIGHTRED,"Vec imas sve motore");}
    }
    else if (VehButtonSet == 1)
    {TogglePlayerControllable(playerid, 1);
    SCM(playerid, COLOR_LIGHTBLUE, "Odustao si od kupnje novog motora!");
    IsShoping = 0;
    HVozilaTextDraw(playerid);
    SetCameraBehindPlayer(playerid);
}
if(pa > 0){
    DestroyVehicle(ShopVeh2);
ShopVeh2 = CreateVehicle(vBikes[ShopVeh2], 1298.7928,-1870.8855,13.5469,349.0682, ShopVeh2,ShopVeh2, 30000);
format(string,sizeof(string),"~w~%s~n~~n~~h~~h~~b~Cijena: %d~n~~n~~h~~h~~y~< ~g~dalje ~h~~h~~y~>",VehNames[GetVehicleModel(ShopVeh2) - 400],vBikes[ShopVeh2]);
TextDrawSetString(CarShopTextDraw,string);pa = 0;}
}

/*

In here put for Boats and AirPlanes!!!!
*/

}
return 1;
}

//==========MY VEH FUNCTIONS := Vozila OWNERSHIP================================
//Player KeySet
stock ConvertVehIDtoDYID(VehID)
{
for(new dy; dy < sizeof(MyVehicle);dy++)
{
    if(MyVehicle == 1)
{
    if(VehID == MyVehicle) return dy;
}
}
return -1;
}

stock PlayerOwnedVehID(playerid,vehicleid)
{
new ime;
GetPlayerName(playerid,ime,sizeof(ime));
for(new i = 0; i < sizeof(MyVehicle); i++)
{
    if(MyVehicle == 1 && MyVehicle == vehicleid)
  {
if (strmatch(MyVehicle, ime))return i;
}
}
return -1;
}
stock AllMyBikes(playerid)//bike
{
new ime;
GetPlayerName(playerid,ime,sizeof(ime));
if(IsPlayerConnected(playerid))
{
    new i, x;
    while (i < sizeof(MyVehicle))
    {
    if(MyVehicle == 1)
  {
      if(MyVehicle != -1)
      {
if (strmatch(MyVehicle, ime)) x++;
}
}
i++;
}
return x;
}
return -1;
}

stock GetMyBikeMID(playerid,ID = 0)//bike
{
new ime;
GetPlayerName(playerid,ime,sizeof(ime));
new x = 0;
    for (new i; i < sizeof(MyVehicle);i++)
    {
    if(MyVehicle == 1)
  {
      if(MyVehicle != -1)
      {
if (strmatch(MyVehicle, ime))
{ x++;
if(x >= ID )
{return i;}
// return i;
}
}
}
}
return -1;
}

stock AllMyCars(playerid)//car
{
new ime;
GetPlayerName(playerid,ime,sizeof(ime));
if(IsPlayerConnected(playerid))
{
    new i, x;
    while (i < sizeof(MyVehicle))
    {
    if(MyVehicle == 1)
  {
      if(MyVehicle != -1)
      {
if (strmatch(MyVehicle, ime)) x++;
}
}
i++;
}
return x;
}
return -1;
}

stock GetMyCarMID(playerid,ID = 0)//car
{
new ime;
GetPlayerName(playerid,ime,sizeof(ime));
new x = 0;
    for (new i; i < sizeof(MyVehicle);i++)
    {
    if(MyVehicle == 1)
  {
      if(MyVehicle != -1)
      {
if (strmatch(MyVehicle, ime))
{ x++;
if(x >= ID )
{return i;}
// return i;
}
}
}
}
return -1;
}
stock AllMyBoats(playerid)//boat
{
new ime;
GetPlayerName(playerid,ime,sizeof(ime));
if(IsPlayerConnected(playerid))
{
    new i, x;
    while (i < sizeof(MyVehicle))
    {
    if(MyVehicle == 1)
  {
      if(MyVehicle != -1)
      {
if (strmatch(MyVehicle, ime)) x++;
}
}
i++;
}
return x;
}
return -1;
}

stock GetMyBoatMID(playerid,ID = 0)//boat
{
new ime;
GetPlayerName(playerid,ime,sizeof(ime));
new x = 0;
    for (new i; i < sizeof(MyVehicle);i++)
    {
    if(MyVehicle == 1)
  {
      if(MyVehicle != -1)
      {
if (strmatch(MyVehicle, ime))
{ x++;
if(x >= ID )
{return i;}
// return i;
}
}
}
}
return -1;
}
stock AllMyAirs(playerid)//air
{
new ime;
GetPlayerName(playerid,ime,sizeof(ime));
if(IsPlayerConnected(playerid))
{
    new i, x;
    while (i < sizeof(MyVehicle))
    {
    if(MyVehicle == 1)
  {
      if(MyVehicle != -1)
      {
if (strmatch(MyVehicle, ime)) x++;
}
}
i++;
}
return x;
}
return -1;
}

stock GetMyAirMID(playerid,ID = 0)//air
{
new ime;
GetPlayerName(playerid,ime,sizeof(ime));
new x = 0;
    for (new i; i < sizeof(MyVehicle);i++)
    {
    if(MyVehicle == 1)
  {
      if(MyVehicle != -1)
      {
if (strmatch(MyVehicle, ime))
{ x++;
if(x >= ID )
{return i;}
// return i;
}
}
}
}
return -1;
}
stock MyCarID(playerid)
{
if(IsPlayerInAnyVehicle(playerid))
    {
for(new i = 0; i < sizeof(MyVehicle); i++)
{
if(GetPlayerVehicleID(playerid) == MyVehicle)return i;
}
  }
return -1;
}
//fnc
stock strmatch(const String1[], const String2[])
{
if ((strcmp(String1, String2, true, strlen(String2)) == 0) && (strlen(String2) == strlen(String1)))
{return true;}
else
{return false;}
}
stock Float:GetDisBetweenPlayerAndCar(p1ayerid,carid)
{
    new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
    if(!IsPlayerConnected(p1ayerid))
    {
        return -1.00;
    }
    GetPlayerPos(p1ayerid,x1,y1,z1);
    GetVehiclePos(carid,x2,y2,z2);
    return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
}

stock GetClosestVehicleToPlayer(playerid)
{
    new x,Float:dis,Float:dis2,car;
    car = 0;
    dis = 99999.99;
    for ( x = 0; x < MAX_VEHICLES; x++ )
    {
        dis2 = GetDisBetweenPlayerAndCar(playerid,x);
        if(dis2 < dis && dis2 < 10.0)
        {
            dis = dis2;
            car = x;
        }
    }
    return car;
}
stock VehPriceFromModel(Model)
{
for(new i = 0; i < 29; i++)
    {
        if(vCars == Model) return i;
    }
return 0;
}
//Veh Functions
stock MakeXDCarFnc(playerid,X_THREAD,Model,Float:x,Float:y,Float:z,Float:a,col1,col2,name[])//THREAD-0=car=bike,2=boat,3=air
{
    for(new i = 0; i < sizeof(MyVehicle); i++ )
{
if(MyVehicle == 0)
{
MyVehicle = Model;
MyVehicle=  x;
MyVehicle = y;
MyVehicle = z;
MyVehicle = a;
MyVehicle = col1;
MyVehicle = col2;
MyVehicle = 0;
MyVehicle = 0;
MyVehicle = -1;
MyVehicle = -1;
MyVehicle = -1;
MyVehicle = -1;
strmid(MyVehicle, name, 0, strlen(name), 32);

MyVehicle = CreateVehicle(
MyVehicle,
MyVehicle,
MyVehicle,
MyVehicle,
MyVehicle,
MyVehicle,
MyVehicle,
30000);
switch(X_THREAD)
        {
        case 0:// osobni auto
              {
GivePlayerMoney(playerid, -vCars[ShopVeh1]);
MyVehicle = 1;
MyVehicle = 1;
SCM(playerid, COLOR_GREEN, "Kupio si auto!!");
              }
              case 1://bike
              {
                      GivePlayerMoney(playerid, -vBikes[ShopVeh2]);
                      MyVehicle = 1;
MyVehicle = 1;
SCM(playerid, COLOR_GREEN, "Kupio si motor!!");
              }
              case 2:// boat
              {
                      //take money
              MyVehicle = 1;
MyVehicle = 1;
SCM(playerid, COLOR_GREEN, "Kupio si brod!!");
      }
      case 3:// air
              {
//take money
                      MyVehicle = 1;
MyVehicle = 1;
SCM(playerid, COLOR_GREEN, "Kupio si avion!!");
      }
      }
      UpdateMyVehSystem(i);
printf("MYVC %d,THR %d",i,X_THREAD);
return i;
}
}
return 1;
}
stock ParkMyVehFnc(playerid)
{
// new str;
new vozilo = GetPlayerVehicleID(playerid);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(PlayerOwnedVehID(playerid,vozilo) != -1)
{
new Float:x,Float:y,Float:z;
new Float:a;
GetVehiclePos(vozilo, x, y, z);
GetVehicleZAngle(vozilo, a);
MyVehicle[PlayerOwnedVehID(playerid,vozilo)] = x;
MyVehicle[PlayerOwnedVehID(playerid,vozilo)] = y;
MyVehicle[PlayerOwnedVehID(playerid,vozilo)] = z;
MyVehicle[PlayerOwnedVehID(playerid,vozilo)] = a;
SetVehiclePos(vozilo, MyVehicle[PlayerOwnedVehID(playerid,vozilo)], MyVehicle[PlayerOwnedVehID(playerid,vozilo)],MyVehicle[PlayerOwnedVehID(playerid,vozilo)]);
SetVehicleZAngle(vozilo, MyVehicle[PlayerOwnedVehID(playerid,vozilo)]);
if(MyVehicle[PlayerOwnedVehID(playerid,vozilo)] != -1)SCM(playerid, COLOR_GREEN, "Parkirao si svoj auto!");
if(MyVehicle[PlayerOwnedVehID(playerid,vozilo)] != -1)SCM(playerid, COLOR_GREEN, "Parkirao si svoj motor!");
if(MyVehicle[PlayerOwnedVehID(playerid,vozilo)] != -1)SCM(playerid, COLOR_GREEN, "Parkirao si svoj brod!");
if(MyVehicle[PlayerOwnedVehID(playerid,vozilo)] != -1)SCM(playerid, COLOR_GREEN, "Parkirao si svoj avion!");
UpdateMyVehSystem(PlayerOwnedVehID(playerid,vozilo));
return 1;
}else{SCM(playerid, COLOR_LIGHTRED,"Nisi u svom vozilu!");}
}else{SCM(playerid, COLOR_LIGHTRED,"Moras biti u vozilu!");}
return 0;
}
stock SellMyVehFnc(playerid)
{
//if(IsPlayerInRangeOfPoint(playerid,15.0,1314.5691,-1859.4077,13.7969)){
    new ime, TCID;
new vozilo = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, ime, sizeof(ime));
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(PlayerOwnedVehID(playerid,vozilo) != -1)
{
TCID =PlayerOwnedVehID(playerid,vozilo);
MyVehicle = 0;
MyVehicle = -1;
MyVehicle = -1;
MyVehicle = -1;
MyVehicle = -1;
strmid(MyVehicle, "Nitko", 0, strlen("Nitko"), 12😎;
DestroyVehicle(vozilo);
SCM(playerid, COLOR_GREEN, "Prodao si svoje vozilo");
UpdateMyVehSystem(TCID);
return 1;
}else{SCM(playerid, COLOR_LIGHTRED,"Nisi u svom vozilu!");}
}else{SCM(playerid, COLOR_LIGHTRED,"Moras biti u vozilu!");}
// }else{SCM(playerid, COLOR_LIGHTRED, "You are not at delivery place!");}
return 1;
}

stock LocateMyVehFnc(playerid,THREAD_V)//0=my_car,1_my_bike,2_my_boat,3_my_air
{
    switch(THREAD_V)
  {
case 0:// mycar
{
new cm = AllMyCars(playerid);
if(cm > 0)
  {
  clx ++;
    if(clx > cm) {clx = 0;}
    new Float:VPos;
    GetVehiclePos(MyVehicle[GetMyCarMID(playerid,clx)], VPos,VPos,VPos);
    SetPlayerCheckpoint(playerid,VPos,VPos,VPos,8.0);
    if(clx == 0){DisablePlayerCheckpoint(playerid);}
}else{SCM(playerid, COLOR_LIGHTRED, "Nemas vozilo ove vrste!");}
}
case 1:// mybike
{
    new cm = AllMyBikes(playerid);
if(cm > 0)
  {
  clx ++;
    if(clx > cm) {clx = 0;}
    new Float:VPos;
    GetVehiclePos(MyVehicle[GetMyBikeMID(playerid,clx)], VPos,VPos,VPos);
    SetPlayerCheckpoint(playerid,VPos,VPos,VPos,8.0);
    if(clx == 0){DisablePlayerCheckpoint(playerid);}
}else{SCM(playerid, COLOR_LIGHTRED, "Nemas vozilo ove vrste!");}
}
case 2:// myboat
{
    new cm = AllMyBoats(playerid);
if(cm > 0)
  {
  clx ++;
    if(clx > cm) {clx = 0;}
    new Float:VPos;
    GetVehiclePos(MyVehicle[GetMyBoatMID(playerid,clx)], VPos,VPos,VPos);
    SetPlayerCheckpoint(playerid,VPos,VPos,VPos,8.0);
    if(clx == 0){DisablePlayerCheckpoint(playerid);}
}else{SCM(playerid, COLOR_LIGHTRED, "Nemas vozilo ove vrste!");}
}
case 3:// myair
{
    new cm = AllMyAirs(playerid);
if(cm > 0)
  {
  clx ++;
    if(clx > cm) {clx = 0;}
    new Float:VPos;
    GetVehiclePos(MyVehicle[GetMyAirMID(playerid,clx)], VPos,VPos,VPos);
    SetPlayerCheckpoint(playerid,VPos,VPos,VPos,8.0);
    if(clx == 0){DisablePlayerCheckpoint(playerid);}
}else{SCM(playerid, COLOR_LIGHTRED, "Nemas vozilo ove vrste!");}
}
}
return 0;
}

stock LockMyVehFnc(playerid)
{
new TCID,Float:CPs;
    TCID = GetClosestVehicleToPlayer(playerid);
    GetVehiclePos(TCID,CPs,CPs,CPs);
if(IsPlayerInRangeOfPoint(playerid,3.0,CPs,CPs,CPs))
{
    if(PlayerOwnedVehID(playerid,TCID) != -1)
{
    if(MyVehicle[PlayerOwnedVehID(playerid,TCID)] == 0)
    {
    MyVehicle[PlayerOwnedVehID(playerid,TCID)] = 1;
            SCM(playerid, COLOR_LIGHTRED, "Vozilo zakljucano!");
    }
    else if(MyVehicle[PlayerOwnedVehID(playerid,TCID)] == 1)
    {
        MyVehicle[PlayerOwnedVehID(playerid,TCID)] = 0;
        SCM(playerid, COLOR_LIGHTGREEN, "Vozilo otkljucano!");
    }
    UpdateMyVehSystem(PlayerOwnedVehID(playerid,TCID));
}else{SCM(playerid, COLOR_LIGHTRED, "Ovo nije tvoje vozilo!");}
}else{SCM(playerid, COLOR_LIGHTRED, "Predaleko ste!");}
return 0;
}
//Admin cmds
stock AparkMyVeh(playerid, MyCarID)
{
if(IsPlayerAdmin(playerid))
{
new vozilo = GetPlayerVehicleID(playerid);
    new Float:x,Float:y,Float:z;
new Float:a;
GetVehiclePos(vozilo, x, y, z);
GetVehicleZAngle(vozilo, a);
MyVehicle = x;
MyVehicle = y;
MyVehicle = z;
MyVehicle = a;
SetVehiclePos(vozilo, MyVehicle, MyVehicle,MyVehicle);
SetVehicleZAngle(vozilo, MyVehicle);
SCM(playerid, COLOR_GREEN, "Vozilo parkirano!");
UpdateMyVehSystem(MyCarID);
}else{SCM(playerid, COLOR_LIGHTRED, "Niste autorizirani za koristenje ove komande!");}
return 1;
}

stock AsellMyVeh(playerid, MyCarID)
{
if(IsPlayerAdmin(playerid))
{
    MyVehicle = 0;
MyVehicle = 0;
MyVehicle = -1;
MyVehicle = -1;
MyVehicle = -1;
MyVehicle = 1;
strmid(MyVehicle, "Nitko", 0, strlen("Nitko"), 64);
DestroyVehicle(MyVehicle);
SCM(playerid, COLOR_LIGHTGREEN, " Vozilo prodano!");
UpdateMyVehSystem(MyCarID);
}else{SCM(playerid, COLOR_LIGHTRED, "Niste autorizirani za koristenje ove komande!");}
return 1;
}

//Saving/loading system
stock LoadMyVehSystem()
{
new reload;
new loader;
if(!dini_Exists(SaveFile))
{
dini_Create(SaveFile);
}
for(new i = 0;i {
    format(loader,sizeof(loader),"MyCar_%d",i);
    strmid(reload,dini_Get(SaveFile,loader),0,256,256);
new data2; //STRING
sscanf(reload,
"p<,>dd\
ffff\
ddd\
s\
d\
dddd\
d",
MyVehicle,MyVehicle,
MyVehicle,MyVehicle,MyVehicle,MyVehicle,
MyVehicle,MyVehicle,MyVehicle,
data2, // string
MyVehicle,
MyVehicle,MyVehicle,MyVehicle,MyVehicle,
MyVehicle);
strmid(MyVehicle, data2, 0, strlen(data2), 64);// kraj loadanja

if(MyVehicle == 1 && (MyVehicle != -1 || MyVehicle != -1 || MyVehicle != -1 || MyVehicle != -1))
{
MyVehicle = CreateVehicle(MyVehicle,MyVehicle,MyVehicle,MyVehicle,MyVehicle,MyVehicle,MyVehicle,30000);
}
}
  return 1;
}

stock UpdateMyVehSystem(id)
{
new GSi;
new place;
if(!dini_Exists(SaveFile))
{
dini_Create(SaveFile);
}
format(GSi,sizeof(GSi),
"%d,%d,\
%f,%f,%f,%f,\
%d,%d,%d,\
%s,\
%d,\
%d,%d,%d,%d,\
%d",
MyVehicle,MyVehicle,
MyVehicle,MyVehicle,MyVehicle,MyVehicle,
MyVehicle,MyVehicle,MyVehicle,
MyVehicle, // string
MyVehicle,
MyVehicle,MyVehicle,MyVehicle,MyVehicle,
MyVehicle);
format(place,sizeof(place),"MyCar_%d",id);
    dini_Set(SaveFile,place,GSi);
    printf("ID %d SET",id);
    if(MyVehicle == 0)
        {
                format(GSi,sizeof(GSi),
"%d,%d,\
%f,%f,%f,%f,\
%d,%d,%d,\
%s,\
%d,\
%d,%d,%d,%d,\
%d",
MyVehicle,MyVehicle,
MyVehicle,MyVehicle,MyVehicle,MyVehicle,
MyVehicle,MyVehicle,MyVehicle,
MyVehicle, // string
MyVehicle,
MyVehicle,MyVehicle,MyVehicle,MyVehicle,
MyVehicle);
format(place,sizeof(place),"MyCar_%d",id);
            dini_Unset(SaveFile ,place);
            printf("ID %d UNSET",id);
        }
  return 1;
}

//======================= COMMANDS =============================================
CMD:carshop(playerid,params[])
{
if(IsShoping == 0)
{
if(GetPlayerState(playerid) != 2)
{
if(IsPlayerInRangeOfPoint(playerid,7.00,1292.0682,-1870.6963,13.3741))
{
    new string;
TogglePlayerControllable(playerid, 0);
IsShoping = 1;
  SCM(playerid, COLOR_LIGHTBLUE, " Koristi tipke lijevo i desno za listanje vozila!");
  SCM(playerid, COLOR_LIGHTBLUE, " Za kupnju pritisni enter (F)");
  SCM(playerid, COLOR_LIGHTBLUE, " Za prekid pritisni CTRL");
  SVozilaTextDraw(playerid);
  format(string,sizeof(string),"~w~%s~n~~n~~h~~h~~b~Cijena: %d~n~~n~~h~~h~~y~< ~g~dalje ~h~~h~~y~>",VehNames[vCars[ShopVeh1] -400],vCars[ShopVeh1]);
TextDrawSetString(CarShopTextDraw,string);
}else{SCM(playerid, COLOR_LIGHTRED, " Nisi u salonu!");}
}else{SCM(playerid, COLOR_LIGHTRED, " Nemozes kupovati iz vozila!");}
}else{SCM(playerid, COLOR_LIGHTRED, " Vec listas katalog!");}
return 1;
}

CMD:carshopcol(playerid,params[])
{
    if(IsPlayerInRangeOfPoint(playerid,7.00,1292.0682,-1870.6963,13.3741))
{
    new boja1,boja2;
if (sscanf(params, "dd",boja1,boja2)) SCM(playerid, COLOR_WHITE, "Koristenje: /carshopcol [boja 1] [boja2 2]");
else if(boja1 < 0 || boja1 > 126)  SCM(playerid, COLOR_WHITE, "Boja nesmije biti ispod 0 i iznad 126!!");
else if(boja2 < 0 || boja2 > 126)  SCM(playerid, COLOR_WHITE, "Boja nesmije biti ispod 0 i iznad 126!!");
else
{
    ShopVeh1 = boja1;
ShopVeh1 = boja2;
ChangeVehicleColor(ShopVeh1,boja1,boja2);
SCM(playerid, COLOR_LIGHTBLUE, "*Promjenio si boju kataloga!");
}
}else{SCM(playerid, COLOR_LIGHTRED, " Nisi u salonu!");}
return 1;
}
CMD:bikeshop(playerid,params[])
{
if(IsShoping == 0)
{
if(GetPlayerState(playerid) != 2)
{
if(IsPlayerInRangeOfPoint(playerid,7.00,1298.7928,-1870.8855,13.5469))
{
    new string;
TogglePlayerControllable(playerid, 0);
IsShoping = 2;
  SCM(playerid, COLOR_LIGHTBLUE, " Koristi tipke lijevo i desno za listanje vozila!");
  SCM(playerid, COLOR_LIGHTBLUE, " Za kupnju pritisni enter (F)");
  SCM(playerid, COLOR_LIGHTBLUE, " Za prekid pritisni CTRL");
  SVozilaTextDraw(playerid);
  format(string,sizeof(string),"~w~%s~n~~n~~h~~h~~b~Cijena: %d~n~~n~~h~~h~~y~< ~g~dalje ~h~~h~~y~>",VehNames[vBikes[ShopVeh2] -400],vBikes[ShopVeh2]);
TextDrawSetString(CarShopTextDraw,string);
}else{SCM(playerid, COLOR_LIGHTRED, " Nisi u salonu!");}
}else{SCM(playerid, COLOR_LIGHTRED, " Nemozes kupovati iz vozila!");}
}else{SCM(playerid, COLOR_LIGHTRED, " Vec listas katalog!");}
return 1;
}
CMD:bikeshopcol(playerid,params[])
{
    if(IsPlayerInRangeOfPoint(playerid,7.00,1298.7928,-1870.8855,13.5469))
{
    new boja1,boja2;
if (sscanf(params, "dd",boja1,boja2)) SCM(playerid, COLOR_WHITE, "Koristenje: /bikeshopcol [boja 1] [boja 2]");
else if(boja1 < 0 || boja1 > 126)  SCM(playerid, COLOR_WHITE, "Boja nesmije biti ispod 0 i iznad 126!!");
else if(boja2 < 0 || boja2 > 126)  SCM(playerid, COLOR_WHITE, "Boja nesmije biti ispod 0 i iznad 126!!");
else
{
    ShopVeh2 = boja1;
ShopVeh2 = boja2;
ChangeVehicleColor(ShopVeh2,boja1,boja2);
SCM(playerid, COLOR_LIGHTBLUE, "*Promjenio si boju kataloga!");
}
}else{SCM(playerid, COLOR_LIGHTRED, " Nisi u salonu!");}
return 1;
}

CMD:buyveh(playerid,params[])
{
if(EnCV != -1)
{
    if(MyVehicle[EnCV] > 0)
    {
if(MyVehicle[EnCV] <= GetPlayerMoney(playerid))
{
    new Float:CPs;
   
    GetVehiclePos(MyVehicle[EnCV],CPs,CPs,CPs);
if(IsPlayerInRangeOfPoint(playerid,4.2,CPs,CPs,CPs))
{
    if(MyVehicle[EnCV] == 1 && AllMyCars(playerid) >= MAX_BUYED_VEHS) return SCM(playerid, COLOR_LIGHTRED, "Nemozes kupiti vise vozila ove vrste!");
    if(MyVehicle[EnCV] == 1 && AllMyBikes(playerid) >= MAX_BUYED_VEHS) return SCM(playerid, COLOR_LIGHTRED, "Nemozes kupiti vise vozila ove vrste!");
    if(MyVehicle[EnCV] == 1 && AllMyBoats(playerid) >= MAX_BUYED_VEHS) return SCM(playerid, COLOR_LIGHTRED, "Nemozes kupiti vise vozila ove vrste!");
    if(MyVehicle[EnCV] == 1 && AllMyAirs(playerid) >= MAX_BUYED_VEHS) return SCM(playerid, COLOR_LIGHTRED, "Nemozes kupiti vise vozila ove vrste!");
        new ime;
        GetPlayerName(playerid,ime,sizeof(ime));
        GivePlayerMoney(playerid, -MyVehicle[EnCV]);
strmid(MyVehicle[EnCV], ime, 0, strlen(ime), 64);
MyVehicle[EnCV] = 0;
UpdateMyVehSystem(EnCV);
EnCV = -1;
SCM(playerid, COLOR_GREEN, "You bought vehicle!");
}else{SCM(playerid, COLOR_LIGHTRED, "Nisi pokraj vozila kojeg zelis kupiti!");}
}else{SCM(playerid, COLOR_LIGHTRED, "Nemas dovoljno novca!");}
        }else{SCM(playerid, COLOR_LIGHTRED, "Ovo vozilo nije na prodaju!");}
    }else{SCM(playerid, COLOR_LIGHTRED, "Nisi pogledao niti jedan auto za kupnju!");}
  return 1;
}
CMD:sellveh(playerid, params[])
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
    new vozilo = GetPlayerVehicleID(playerid);
if(PlayerOwnedVehID(playerid,vozilo) != -1)
{
new Novac;
new Float:x,Float:y,Float:z;
new Float:a;
if (sscanf(params, "d",Novac)) SCM(playerid, COLOR_WHITE, "Koristenje: /sellveh ");
else
{
    GetVehiclePos(vozilo, x, y, z);
GetVehicleZAngle(vozilo, a);
    strmid(MyVehicle[MyCarID(playerid)], "Nitko", 0, strlen("Nitko"), 24);
MyVehicle[MyCarID(playerid)] = Novac;
GivePlayerMoney(playerid, Novac);
MyVehicle[MyCarID(playerid)] = x;
MyVehicle[MyCarID(playerid)] = y;
MyVehicle[MyCarID(playerid)] = z;
MyVehicle[MyCarID(playerid)] = a;
SetVehiclePos(vozilo, MyVehicle[MyCarID(playerid)], MyVehicle[MyCarID(playerid)],MyVehicle[MyCarID(playerid)]);
SetVehicleZAngle(vozilo, MyVehicle[MyCarID(playerid)]);
RemovePlayerFromVehicle(playerid);
    UpdateMyVehSystem(MyCarID(playerid));
SCM(playerid, COLOR_GREEN, "Prodao si svoje vozilo!");
}
            }else{SCM(playerid, COLOR_LIGHTRED, "Nemas dokumente ovog vozila!");}
        }else{SCM(playerid, COLOR_LIGHTRED, "Moras biti u vozilu!");}
    return 1;
}

CMD:mycar(playerid,params[])
{
new opcija,ime;
if (sscanf(params, "s", opcija)) SCM(playerid, COLOR_WHITE, "Koristenje: /mycar "),SCM(playerid, COLOR_WHITE, "opcija: park, lock, sell, locate");
else
{
GetPlayerName(playerid, ime,sizeof(ime));
if(strmatch("park",opcija))
  {
  ParkMyVehFnc(playerid);
          return 1;
      }
      if(strmatch("lock",opcija))
  {
        LockMyVehFnc(playerid);
          return 1;
      }
      if(strmatch("sell",opcija))
  {
        SellMyVehFnc(playerid);
          return 1;
      }
      if(strmatch("locate",opcija))
  {
        LocateMyVehFnc(playerid,0);
          return 1;
      }
}
return 1;
}

CMD:mybike(playerid,params[])
{
new opcija,ime;
if (sscanf(params, "s", opcija)) SCM(playerid, COLOR_WHITE, "Koristenje: /mybike "),SCM(playerid, COLOR_WHITE, "opcija: park, lock, sell, locate");
else
{
GetPlayerName(playerid, ime,sizeof(ime));
if(strmatch("park",opcija))
  {
  ParkMyVehFnc(playerid);
          return 1;
      }
      if(strmatch("lock",opcija))
  {
        LockMyVehFnc(playerid);
          return 1;
      }
      if(strmatch("sell",opcija))
  {
        SellMyVehFnc(playerid);
          return 1;
      }
      if(strmatch("locate",opcija))
  {
        LocateMyVehFnc(playerid,1);
          return 1;
      }
}
return 1;
}
CMD:myboat(playerid,params[])
{
new opcija,ime;
if (sscanf(params, "s", opcija)) SCM(playerid, COLOR_WHITE, "Koristenje: /myboat "),SCM(playerid, COLOR_WHITE, "opcija: park, lock, sell, locate");
else
{
GetPlayerName(playerid, ime,sizeof(ime));
if(strmatch("park",opcija))
  {
  ParkMyVehFnc(playerid);
          return 1;
      }
      if(strmatch("lock",opcija))
  {
        LockMyVehFnc(playerid);
          return 1;
      }
      if(strmatch("sell",opcija))
  {
        SellMyVehFnc(playerid);
          return 1;
      }
      if(strmatch("locate",opcija))
  {
        LocateMyVehFnc(playerid,2);
          return 1;
      }
}
return 1;
}
CMD:myair(playerid,params[])
{
new opcija,ime;
if (sscanf(params, "s", opcija)) SCM(playerid, COLOR_WHITE, "Koristenje: /myair "),SCM(playerid, COLOR_WHITE, "opcija: park, lock, sell, locate");
else
{
GetPlayerName(playerid, ime,sizeof(ime));
if(strmatch("park",opcija))
  {
  ParkMyVehFnc(playerid);
          return 1;
      }
      if(strmatch("lock",opcija))
  {
        LockMyVehFnc(playerid);
          return 1;
      }
      if(strmatch("sell",opcija))
  {
        SellMyVehFnc(playerid);
          return 1;
      }
      if(strmatch("locate",opcija))
  {
        LocateMyVehFnc(playerid,3);
          return 1;
      }
}
return 1;
}

CMD:apark(playerid,params[])
{
    if(IsPlayerInAnyVehicle(playerid))
{
    AparkMyVeh(playerid, MyCarID(playerid));
}
return 1;
}
CMD:asellveh(playerid,params[])
{
    if(IsPlayerInAnyVehicle(playerid))
{
    AsellMyVeh(playerid, MyCarID(playerid));
}
return 1;
}
CMD:makesaleveh(playerid, params[])
{
new vrsta,model,boja1,boja2,cijena;
if (sscanf(params, "ddddd",vrsta,model,boja1,boja2,cijena)) SCM(playerid, COLOR_WHITE, "Koristenje: /makesaleveh ");
else if(vrsta < 0 || vrsta > 3)  SCM(playerid, COLOR_LIGHTGREEN, "Vrste: 0-Auto,1-Motor,2-Brod,3-Avion");
else if(model < 400 || model > 611)  SCM(playerid, COLOR_WHITE, "Model vozila nemoze biti ispod 400 i preko 611!");
else if(boja1 < 0 || boja1 > 126)  SCM(playerid, COLOR_WHITE, "Boja vozila nemoze biti ispod 0 i preko 126!");
else if(boja2 < 0 || boja2 > 126)  SCM(playerid, COLOR_WHITE, "Boja vozila nemoze biti ispod 0 i preko 126!");
else if(cijena < 1 || cijena > 99999999)  SCM(playerid, COLOR_WHITE, "Cijena nemoze biti ispod 0!");
else
{
    if(IsPlayerAdmin(playerid))
    {
new Float:X,Float:Y,Float:Z,Float:A, s;
GetPlayerPos(playerid, X,Y,Z);
s = MakeXDCarFnc(playerid,vrsta,model,X+1.5,Y+2.5,Z+2.0,A,boja1,boja2,"Nitko");//THREAD-0=car=bike,2=boat,3=air
MyVehicle = cijena;
SCM(playerid, COLOR_LIGHTRED, "Stvorio si vozilo za prodaju!");
printf("TYP:%d, ID:%d",vrsta,s);
UpdateMyVehSystem(s);
}else{SCM(playerid, COLOR_LIGHTRED, "Niste autorizirani za koristenje ove komande!");}
}
return 1;
}

CMD:vehhelp(playerid,params[])
{
    SCM(playerid, COLOR_LIGHTBLUE, "|_____________________Vozila pomoc____________________|");
    SCM(playerid, COLOR_LIGHTBLUE, "CMD: /carshop, /carshopcol, /bikeshop, /bikeshopcol");
    SCM(playerid, COLOR_LIGHTBLUE, "CMD: /mycar");
    SCM(playerid, COLOR_LIGHTBLUE, "CMD: /mybike");
    SCM(playerid, COLOR_LIGHTBLUE, "CMD: /myboat (Treba samo napraviti salon)");
    SCM(playerid, COLOR_LIGHTBLUE, "CMD: /myair (Treba samo napraviti salon)");
    SCM(playerid, COLOR_LIGHTBLUE, "CMD: /sellveh, /buyveh (kada pokusate uci i cijena se pokaze))");
    SCM(playerid, COLOR_LIGHTBLUE, "ADMIN: /asellveh, /apark, /makesaleveh");
    return 1;
}




PS
: Ubaci kao FileScript!

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha