[POMOC]Bug kod kupnje kola

Započeo Marley, Januar 03, 2012, 17:56:45 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Marley

Skripta koju koristim: GF edit
Detaljan opis problema: Kad neko oce da kupi kola na serveru moze imati samo po jedan auto,jedan bike,jedan helis,camac i tako, ne moze da ima 2 auta,2 helisa i tako to
Dio skripte:

if(strcmp(cmd, "/kupivozilo", true) == 0)
{
    if (Spectating[playerid][0]!=-1)
    {
        if (Carlist[playerid][Typ]==-1)
        {
            new price = Buylist[Spectating[playerid][0]][Price];
            if (price <= GetPlayerMoney(playerid))
            {
                new autohaus=Buylist[Spectating[playerid][0]][Autohaus];
            GivePlayerMoney(playerid, - price);
            Carlist[playerid][Typ] = Spectating[playerid][0]; Carlist[playerid][X3] = Carspawns[autohaus][X3]; Carlist[playerid][Y3] = Carspawns[autohaus][Y3];
Carlist[playerid][Z3] = Carspawns[autohaus][Z3]; Carlist[playerid][Rotation] = Carspawns[autohaus][Rotation]; Carlist[playerid][Status] = 1; Carlist[playerid][Lock] = 0;
Carlist[playerid][Carid] = CreateVehicle(Buylist[Spectating[playerid][0]][Modelid],Carlist[playerid][X3],Carlist[playerid][Y3],Carlist[playerid][Z3],Carlist[playerid][Rotation],-1,-1,-1);
        SetVehicleParamsForAll(Buylist[Spectating[playerid][0]][Carid],0,0);
        TogglePlayerControllable(playerid,1);
        Spectating[playerid][0]=-1;
        RemovePlayerFromVehicle(playerid);
        VehicleSave(playerid);
        TextDrawHideForPlayer(playerid, imevozila[playerid]);
TextDrawHideForPlayer(playerid, cijenavozila[playerid]);
TextDrawHideForPlayer(playerid, registracijavozila[playerid]);
format(string,128,"* Cestitamo! Kupili ste auto {FFFFFF}$%s "COL_YELLOW"za {FFFFFF}%i!",Buylist[Carlist[playerid][Typ]][Name],price);
SendClientMessage(playerid, YELLOW, string);
SendClientMessage(playerid, NICERED, "Ako je vas auto pokvaren, upisite {FFFFFF}/v fix "COL_RED"da popravite.");
SendClientMessage(playerid, NICERED, "Mozete otkljucati/zakljucati vas auto sa naredbom {FFFFFF}/v lock.");
SendClientMessage(playerid, NICERED, "Ostalo: {FFFFFF}(/v)ozilo.");
                    SendClientMessage(playerid, COLOR_YELLOW, "Vase vozilo je dostavljeno, Uzivajte!");
}
                else { format(string, 128, "* Nedovoljno novca za kupnju automobila (trebate: {FFFFFF}$%i)!", price); SendClientMessage(playerid, YELLOW, string); }
}
else { SendClientMessage(playerid, COLOR_GREY, "Vi vec imate auto!"); }
    }
    else { SendClientMessage(playerid, COLOR_GREY, "Nisi u izlozbenom vozilu!"); }
    return 1;
}
if(strcmp(cmd, "/prodajauto", true) == 0)
{
        tmp = strtok(cmdtext, idx);
if (!strlen(tmp))
{
    SendClientMessage(playerid, COLOR_GREY, "Koristite: /prodajauto [ID Igraca] [Cijena]");
            return 1;
        }
        new sellplayerid = ReturnUser(tmp);
        tmp = strtok(cmdtext, idx);
if (!strlen(tmp))
{
    SendClientMessage(playerid, COLOR_GREY, "Koristite: /prodajauto [ID Igraca] [Cijena]");
            return 1;
        }
        new price = strval(tmp);
        if (price<0)
        {
    SendClientMessage(playerid, COLOR_GREY, "Cijena mora biti veca od $0.");
            return 1;
        }
    if (Carlist[playerid][Typ]==-1)
    {
        SendClientMessage(playerid, COLOR_GREY, "Vi nemate auto!");
        return 1;
    }
        if (!IsPlayerConnected(sellplayerid))
        {
    SendClientMessage(playerid, COLOR_GREY, "Igrac je offline.");
            return 1;
        }
        offerCar[sellplayerid][0]=playerid;
offerCar[sellplayerid][1]=price;
new sellplayername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
GetPlayerName(sellplayerid,sellplayername,sizeof(sellplayername));
format(string,128,"Vi ste ponudili  %s vas auto za $%i!",sellplayername,price);
SendClientMessage(playerid, COLOR_RED, string);
SendClientMessage(playerid, COLOR_YELLOW, "Da odustanete upisite /cancelsell.");
        format(string,128,"%s nudi %s za $%i.",playername,Buylist[Carlist[playerid][Typ]][Name],price);
        SendClientMessage(sellplayerid, COLOR_RED, string);
        SendClientMessage(sellplayerid, COLOR_YELLOW, "Da primite upisite /prihvatisell.");
    return 1;
}
if(strcmp(cmd, "/cancelsell", true) == 0)
{
    for (new i=0; i<MAX_PLAYERS; i++)
    {
        if (offerCar[i][0]==playerid)
        {
            offerCar[i]={-1,0};
            SendClientMessage(playerid, COLOR_RED, "Otkazali ste prodaju Automobila.");
            if (IsPlayerConnected(i))
            {
GetPlayerName(playerid,playername,sizeof(playername));
                format(string,128,"%s cancelled the deal.",playername);
                    SendClientMessage(i, COLOR_GREEN, string);
            }
            return 1;
        }
        if (offerBike[i][0]==playerid)
        {
            offerBike[i]={-1,0};
            SendClientMessage(playerid, COLOR_RED, "Otkazali ste prodaju Motora/Bicikla.");
            if (IsPlayerConnected(i))
            {
GetPlayerName(playerid,playername,sizeof(playername));
                format(string,128,"%s cancelled the deal.",playername);
                    SendClientMessage(i, COLOR_GREEN, string);
            }
            return 1;
        }
        if (offerBoat[i][0]==playerid)
        {
            offerBoat[i]={-1,0};
            SendClientMessage(playerid, COLOR_RED, "Otkazali ste prodaju Broda.");
            if (IsPlayerConnected(i))
            {
GetPlayerName(playerid,playername,sizeof(playername));
                format(string,128,"%s cancelled the deal.",playername);
                    SendClientMessage(i, COLOR_GREEN, string);
            }
            return 1;
        }
        if (offerPlane[i][0]==playerid)
        {
            offerPlane[i]={-1,0};
            SendClientMessage(playerid, COLOR_RED, "You cancelled the deal.");
            if (IsPlayerConnected(i))
            {
GetPlayerName(playerid,playername,sizeof(playername));
                format(string,128,"%s cancelled the deal.",playername);
                    SendClientMessage(i, COLOR_GREEN, string);
            }
            return 1;
        }
    }
    SendClientMessage(playerid, COLOR_GREY, "Tvoje vozilo nije na prodaji!");
    return 1;
}
if(strcmp(cmd, "/prihvatisell", true) == 0)
{
    if (offerCar[playerid][0]!=-1)
    {
        if (IsPlayerConnected(offerCar[playerid][0]))
        {
            if (Carlist[playerid][Typ]==-1)
            {
                if (Carlist[offerCar[playerid][0]][Typ]!=-1)
                {
                    if (GetPlayerMoney(playerid)>=offerCar[playerid][1])
                    {
                        new sellerid=offerCar[playerid][0];
                        new price=offerCar[playerid][1];
                        offerCar[playerid]={-1,0};
                    GivePlayerMoney(playerid, - price);
                    GivePlayerMoney(sellerid, price);
                    Carlist[playerid][Typ]=Carlist[sellerid][Typ];
                    Carlist[playerid][X3]=Carlist[sellerid][X3];
                    Carlist[playerid][Y3]=Carlist[sellerid][Y3];
        Carlist[playerid][Z3]=Carlist[sellerid][Z3];
        Carlist[playerid][Rotation]=Carlist[sellerid][Rotation];
        Carlist[playerid][Status]=Carlist[sellerid][Status];
        Carlist[playerid][Lock]=Carlist[sellerid][Lock];
        Carlist[playerid][Carid]=Carlist[sellerid][Carid];
                Carlist[playerid][Color1]=Carlist[sellerid][Color1];
                Carlist[playerid][Color2]=Carlist[sellerid][Color2];
                Carlist[playerid][mod1]=Carlist[sellerid][mod1];
                Carlist[playerid][mod2]=Carlist[sellerid][mod2];
                Carlist[playerid][mod3]=Carlist[sellerid][mod3];
                Carlist[playerid][mod4]=Carlist[sellerid][mod4];
                Carlist[playerid][mod5]=Carlist[sellerid][mod5];
                Carlist[playerid][mod6]=Carlist[sellerid][mod6];
                Carlist[playerid][mod7]=Carlist[sellerid][mod7];
                Carlist[playerid][mod8]=Carlist[sellerid][mod8];
                Carlist[playerid][mod9]=Carlist[sellerid][mod9];
                Carlist[playerid][mod10]=Carlist[sellerid][mod10];
                Carlist[playerid][mod11]=Carlist[sellerid][mod11];
                Carlist[playerid][mod12]=Carlist[sellerid][mod12];
                Carlist[playerid][mod13]=Carlist[sellerid][mod13];
                Carlist[playerid][mod14]=Carlist[sellerid][mod14];
                Carlist[playerid][mod15]=Carlist[sellerid][mod15];
                Carlist[playerid][mod16]=Carlist[sellerid][mod16];
                Carlist[playerid][mod17]=Carlist[sellerid][mod17];
                Carlist[playerid][Paintjob]=Carlist[sellerid][Paintjob];
                Carlist[sellerid][Typ]=-1; Carlist[sellerid][X3]=0.0; Carlist[sellerid][Y3]=0.0; Carlist[sellerid][Z3]=0.0;
                Carlist[sellerid][Rotation]=0.0; Carlist[sellerid][Status]=0; Carlist[sellerid][Lock]=0; Carlist[sellerid][Carid]=-1;
                Carlist[sellerid][Color1]=-1; Carlist[sellerid][Color2]=-1; Carlist[sellerid][mod1]=-1; Carlist[sellerid][mod2]=-1;
                Carlist[sellerid][mod3]=-1; Carlist[sellerid][mod4]=-1; Carlist[sellerid][mod5]=-1; Carlist[sellerid][mod6]=-1;
                Carlist[sellerid][mod7]=-1; Carlist[sellerid][mod8]=-1; Carlist[sellerid][mod9]=-1; Carlist[sellerid][mod10]=-1;
                Carlist[sellerid][mod11]=-1; Carlist[sellerid][mod12]=-1; Carlist[sellerid][mod13]=-1; Carlist[sellerid][mod14]=-1;
                Carlist[sellerid][mod15]=-1; Carlist[sellerid][mod16]=-1; Carlist[sellerid][mod17]=-1; Carlist[sellerid][Paintjob]=-1;
        if (Carlist[playerid][Status]==1)
        {
                    SetVehicleParamsForAll(Carlist[playerid][Carid],0,Carlist[playerid][Lock]);
                    SetVehicleParamsForPlayer(Carlist[playerid][Carid],playerid,0,0);
                }
                VehicleSave(playerid);
                            format(string,128,"* Cestitamo! Kupili ste auto {FFFFFF}$%s "COL_YELLOW"za {FFFFFF}%i!",Buylist[Carlist[playerid][Typ]][Name],price);
SendClientMessage(playerid, YELLOW, string);
SendClientMessage(playerid, NICERED, "Ako je vas auto pokvaren, upisite {FFFFFF}/v fix "COL_RED"da popravite.");
SendClientMessage(playerid, NICERED, "Mozete otkljucati/zakljucati vas auto sa naredbom {FFFFFF}/v lock.");
SendClientMessage(playerid, NICERED, "Ostalo: {FFFFFF}(/v)ozilo.");
SendClientMessage(playerid, COLOR_YELLOW, "Automobil je sada vas! Zabavite se!");
GetPlayerName(playerid,playername,sizeof(playername));
                format(string,128,"* Prodao si svoj automobil {FFFFFF}%s "COL_YELLOW"za {FFFFFF}$%i!",playername, price);
                SendClientMessage(sellerid, YELLOW, string);
                    }
                    else
                    {
                        format(string, 128, "* Nedovoljno novca za kupnju automobila (Potrebno: {FFFFFF}$%i)!!", offerCar[playerid][1]);
                        SendClientMessage(playerid, COLOR_YELLOW, string);
                    }
                    }
                    else
                    {
                        offerCar[playerid]={-1,0};
                        SendClientMessage(playerid, COLOR_GREY, "Prodavac nema automobil!.");
                    }
            }
            else
            {
        SendClientMessage(playerid, COLOR_GREY, "Vi vec imate automobil!");
            }
}
            else
            {
                offerCar[playerid]={-1,0};
                SendClientMessage(playerid, COLOR_GREY, "The seller is offline.");
            }
    }
    if (offerBike[playerid][0]!=-1)
    {
        if (IsPlayerConnected(offerBike[playerid][0]))
        {
            if (Bikelist[playerid][bTyp]==-1)
            {
                if (Bikelist[offerBike[playerid][0]][bTyp]!=-1)
                {
                    if (GetPlayerMoney(playerid)>=offerBike[playerid][1])
                    {
                        new sellerid=offerBike[playerid][0];
                        new price=offerBike[playerid][1];
                        offerBike[playerid]={-1,0};
                    GivePlayerMoney(playerid, - price);
                    GivePlayerMoney(sellerid, price);
                    Bikelist[playerid][bTyp]=Bikelist[sellerid][bTyp];
                    Bikelist[playerid][mX]=Bikelist[sellerid][mX];
                    Bikelist[playerid][mY]=Bikelist[sellerid][mY];
        Bikelist[playerid][mZ]=Bikelist[sellerid][mZ];
        Bikelist[playerid][mRotation]=Bikelist[sellerid][mRotation];
        Bikelist[playerid][Status]=Bikelist[sellerid][Status];
        Bikelist[playerid][Lock]=Bikelist[sellerid][Lock];
        Bikelist[playerid][Carid]=Bikelist[sellerid][Carid];
                Bikelist[playerid][Color1]=Bikelist[sellerid][Color1];
                Bikelist[playerid][Color2]=Bikelist[sellerid][Color2];
                Bikelist[playerid][mod1]=Bikelist[sellerid][mod1];
                Bikelist[playerid][mod2]=Bikelist[sellerid][mod2];
                Bikelist[playerid][mod3]=Bikelist[sellerid][mod3];
                Bikelist[playerid][mod4]=Bikelist[sellerid][mod4];
                Bikelist[playerid][mod5]=Bikelist[sellerid][mod5];
                Bikelist[playerid][mod6]=Bikelist[sellerid][mod6];
                Bikelist[playerid][mod7]=Bikelist[sellerid][mod7];
                Bikelist[playerid][mod8]=Bikelist[sellerid][mod8];
                Bikelist[playerid][mod9]=Bikelist[sellerid][mod9];
                Bikelist[playerid][mod10]=Bikelist[sellerid][mod10];
                Bikelist[playerid][mod11]=Bikelist[sellerid][mod11];
                Bikelist[playerid][mod12]=Bikelist[sellerid][mod12];
                Bikelist[playerid][mod13]=Bikelist[sellerid][mod13];
                Bikelist[playerid][mod14]=Bikelist[sellerid][mod14];
                Bikelist[playerid][mod15]=Bikelist[sellerid][mod15];
                Bikelist[playerid][mod16]=Bikelist[sellerid][mod16];
                Bikelist[playerid][mod17]=Bikelist[sellerid][mod17];
                Bikelist[playerid][Paintjob]=Bikelist[sellerid][Paintjob];
                Bikelist[sellerid][bTyp]=-1; Bikelist[sellerid][mX]=0.0; Bikelist[sellerid][mY]=0.0; Bikelist[sellerid][mZ]=0.0;
                Bikelist[sellerid][mRotation]=0.0; Bikelist[sellerid][Status]=0; Bikelist[sellerid][Lock]=0; Bikelist[sellerid][Carid]=-1;
                Bikelist[sellerid][Color1]=-1; Bikelist[sellerid][Color2]=-1; Bikelist[sellerid][mod1]=-1; Bikelist[sellerid][mod2]=-1;
                Bikelist[sellerid][mod3]=-1; Bikelist[sellerid][mod4]=-1; Bikelist[sellerid][mod5]=-1; Bikelist[sellerid][mod6]=-1;
                Bikelist[sellerid][mod7]=-1; Bikelist[sellerid][mod8]=-1; Bikelist[sellerid][mod9]=-1; Bikelist[sellerid][mod10]=-1;
                Bikelist[sellerid][mod11]=-1; Bikelist[sellerid][mod12]=-1; Bikelist[sellerid][mod13]=-1; Bikelist[sellerid][mod14]=-1;
                Bikelist[sellerid][mod15]=-1; Bikelist[sellerid][mod16]=-1; Bikelist[sellerid][mod17]=-1; Bikelist[sellerid][Paintjob]=-1;
        if (Bikelist[playerid][Status]==1)
        {
                    SetBikeParamsForAll(Bikelist[playerid][Carid],0,Bikelist[playerid][Lock]);
                    SetVehicleParamsForPlayer(Bikelist[playerid][Carid],playerid,0,0);
                }
                MotoSave(playerid);
                            format(string,128,"* Cestitamo, kupili ste motor marke {FFFFFF}%s "COL_YELLOW"za {FFFFFF}$%i!",BikeBuylist[Bikelist[playerid][bTyp]][bName],price);
SendClientMessage(playerid, YELLOW, string);
SendClientMessage(playerid, SVETLOPLAVA, "Ako ti je motor unisten {FFFFFF}/mo fix "COL_SVPLAVA"za popravak.");
SendClientMessage(playerid, SVETLOPLAVA, "Motor mozees zakljucat i otkljucat sa komandom {FFFFFF}/mo lock.");
SendClientMessage(playerid, SVETLOPLAVA, "Ostalo: {FFFFFF}(/mo)to.");
SendClientMessage(playerid, COLOR_YELLOW, "Motor sada pripada vama! Zabavite se!");
GetPlayerName(playerid,playername,sizeof(playername));
                format(string,128,"* Svoj motor si prodao igracu {FFFFFF}%s "COL_YELLOW"za {FFFFFF}$%i!",playername, price);
                SendClientMessage(sellerid, YELLOW, string);
                    }
                    else
                    {
                        format(string, 128, "Nemas dovoljno novca za kupovinu motora (Potrebno: $%i)!", offerBike[playerid][1]);
                        SendClientMessage(playerid, COLOR_GREY, string);
                    }
                    }
                    else
                    {
                        offerBike[playerid]={-1,0};
                        SendClientMessage(playerid, COLOR_GREY, "Prodavac ne posjeduje motor/bicikli!.");
                    }
            }
            else
            {
        SendClientMessage(playerid, COLOR_GREY, "Vec imas motor/bicikli!");
            }
}
            else
            {
                offerBike[playerid]={-1,0};
                SendClientMessage(playerid, COLOR_GREY, "Prodavac nije online.");
            }
    }
    if (offerBoat[playerid][0]!=-1)
    {
        if (IsPlayerConnected(offerBoat[playerid][0]))
        {
            if (Boatlist[playerid][BoatTyp]==-1)
            {
                if (Boatlist[offerBoat[playerid][0]][BoatTyp]!=-1)
                {
                    if (GetPlayerMoney(playerid)>=offerBoat[playerid][1])
                    {
                        new sellerid=offerBoat[playerid][0];
                        new price=offerBoat[playerid][1];
                        offerBoat[playerid]={-1,0};
                    GivePlayerMoney(playerid, - price);
                    GivePlayerMoney(sellerid, price);
                    Boatlist[playerid][BoatTyp]=Boatlist[sellerid][BoatTyp];
                    Boatlist[playerid][X3]=Boatlist[sellerid][X3];
                    Boatlist[playerid][Y3]=Boatlist[sellerid][Y3];
        Boatlist[playerid][Z3]=Boatlist[sellerid][Z3];
        Boatlist[playerid][Rotation]=Boatlist[sellerid][Rotation];
        Boatlist[playerid][Status]=Boatlist[sellerid][Status];
        Boatlist[playerid][Lock]=Boatlist[sellerid][Lock];
        Boatlist[playerid][Carid]=Boatlist[sellerid][Carid];
                Boatlist[playerid][Color1]=Boatlist[sellerid][Color1];
                Boatlist[playerid][Color2]=Boatlist[sellerid][Color2];
                Boatlist[playerid][mod1]=Boatlist[sellerid][mod1];
                Boatlist[playerid][mod2]=Boatlist[sellerid][mod2];
                Boatlist[playerid][mod3]=Boatlist[sellerid][mod3];
                Boatlist[playerid][mod4]=Boatlist[sellerid][mod4];
                Boatlist[playerid][mod5]=Boatlist[sellerid][mod5];
                Boatlist[playerid][mod6]=Boatlist[sellerid][mod6];
                Boatlist[playerid][mod7]=Boatlist[sellerid][mod7];
                Boatlist[playerid][mod8]=Boatlist[sellerid][mod8];
                Boatlist[playerid][mod9]=Boatlist[sellerid][mod9];
                Boatlist[playerid][mod10]=Boatlist[sellerid][mod10];
                Boatlist[playerid][mod11]=Boatlist[sellerid][mod11];
                Boatlist[playerid][mod12]=Boatlist[sellerid][mod12];
                Boatlist[playerid][mod13]=Boatlist[sellerid][mod13];
                Boatlist[playerid][mod14]=Boatlist[sellerid][mod14];
                Boatlist[playerid][mod15]=Boatlist[sellerid][mod15];
                Boatlist[playerid][mod16]=Boatlist[sellerid][mod16];
                Boatlist[playerid][mod17]=Boatlist[sellerid][mod17];
                Boatlist[playerid][Paintjob]=Boatlist[sellerid][Paintjob];
                Boatlist[sellerid][BoatTyp]=-1; Boatlist[sellerid][X3]=0.0; Boatlist[sellerid][Y3]=0.0; Boatlist[sellerid][Z3]=0.0;
                Boatlist[sellerid][Rotation]=0.0; Boatlist[sellerid][Status]=0; Boatlist[sellerid][Lock]=0; Boatlist[sellerid][Carid]=-1;
                Boatlist[sellerid][Color1]=-1; Boatlist[sellerid][Color2]=-1; Boatlist[sellerid][mod1]=-1; Boatlist[sellerid][mod2]=-1;
                Boatlist[sellerid][mod3]=-1; Boatlist[sellerid][mod4]=-1; Boatlist[sellerid][mod5]=-1; Boatlist[sellerid][mod6]=-1;
                Boatlist[sellerid][mod7]=-1; Boatlist[sellerid][mod8]=-1; Boatlist[sellerid][mod9]=-1; Boatlist[sellerid][mod10]=-1;
                Boatlist[sellerid][mod11]=-1; Boatlist[sellerid][mod12]=-1; Boatlist[sellerid][mod13]=-1; Boatlist[sellerid][mod14]=-1;
                Boatlist[sellerid][mod15]=-1; Boatlist[sellerid][mod16]=-1; Boatlist[sellerid][mod17]=-1; Boatlist[sellerid][Paintjob]=-1;
        if (Boatlist[playerid][Status]==1)
        {
                    SetBoatParamsForAll(Boatlist[playerid][Carid],0,Boatlist[playerid][Lock]);
                    SetVehicleParamsForPlayer(Boatlist[playerid][Carid],playerid,0,0);
                }
                PlSave(playerid);
                            format(string,128,"Cestitamo, Kupili ste plovilo marke {FFFFFF}%s "COL_YELLOW"za {FFFFFF}$%i !",BoatBuylist[Boatlist[playerid][BoatTyp]][plName],price);
SendClientMessage(playerid, YELLOW, string);
SendClientMessage(playerid, YELLOW, "Ako ti je plovilo unisten {FFFFFF}/p fix "COL_YELLOW"za popravak.");
SendClientMessage(playerid, YELLOW, "Plovilo mozes zakljucavati i otkljucavati sa komandom {FFFFFF}/p lock.");
SendClientMessage(playerid, YELLOW, "Ostalo: {FFFFFF}(/pl)ovilo.");
SendClientMessage(playerid, COLOR_YELLOW, "Plovilo je sada tvoje! Uzivaj!");
GetPlayerName(playerid,playername,sizeof(playername));
                format(string,128,"Prodao si svoje plovilo igracu {FFFFFF}%s "COL_YELLOW"za {FFFFFF}$%i!",playername, price);
                SendClientMessage(sellerid, COLOR_YELLOW, string);
                    }
                    else
                    {
                        format(string, 128, "Nemas dovoljno novaca za brod! (Potrebno: $%i)!", offerBoat[playerid][1]);
                        SendClientMessage(playerid, COLOR_GREY, string);
                    }
                    }
                    else
                    {
                        offerBoat[playerid]={-1,0};
                        SendClientMessage(playerid, COLOR_GREY, "Prodavac ne posjeduje brod!.");
                    }
            }
            else
            {
        SendClientMessage(playerid, COLOR_GREY, "Vec posjedujes brod!");
            }
}
            else
            {
                offerBoat[playerid]={-1,0};
                SendClientMessage(playerid, COLOR_GREY, "Prodavac nije online.");
            }
    }
    if (offerPlane[playerid][0]!=-1)
    {
        if (IsPlayerConnected(offerPlane[playerid][0]))
        {
            if (Planelist[playerid][planeTyp]==-1)
            {
                if (Planelist[offerPlane[playerid][0]][planeTyp]!=-1)
                {
                    if (GetPlayerMoney(playerid)>=offerPlane[playerid][1])
                    {
                        new sellerid=offerPlane[playerid][0];
                        new price=offerPlane[playerid][1];
                        offerPlane[playerid]={-1,0};
                    GivePlayerMoney(playerid, - price);
                    GivePlayerMoney(sellerid, price);
                    Planelist[playerid][planeTyp]=Planelist[sellerid][planeTyp];
                    Planelist[playerid][X3]=Planelist[sellerid][X3];
                    Planelist[playerid][Y3]=Planelist[sellerid][Y3];
        Planelist[playerid][Z3]=Planelist[sellerid][Z3];
        Planelist[playerid][Rotation]=Planelist[sellerid][Rotation];
        Planelist[playerid][Status]=Planelist[sellerid][Status];
        Planelist[playerid][Lock]=Planelist[sellerid][Lock];
        Planelist[playerid][Carid]=Planelist[sellerid][Carid];
                Planelist[playerid][Color1]=Planelist[sellerid][Color1];
                Planelist[playerid][Color2]=Planelist[sellerid][Color2];
                Planelist[playerid][mod1]=Planelist[sellerid][mod1];
                Planelist[playerid][mod2]=Planelist[sellerid][mod2];
                Planelist[playerid][mod3]=Planelist[sellerid][mod3];
                Planelist[playerid][mod4]=Planelist[sellerid][mod4];
                Planelist[playerid][mod5]=Planelist[sellerid][mod5];
                Planelist[playerid][mod6]=Planelist[sellerid][mod6];
                Planelist[playerid][mod7]=Planelist[sellerid][mod7];
                Planelist[playerid][mod8]=Planelist[sellerid][mod8];
                Planelist[playerid][mod9]=Planelist[sellerid][mod9];
                Planelist[playerid][mod10]=Planelist[sellerid][mod10];
                Planelist[playerid][mod11]=Planelist[sellerid][mod11];
                Planelist[playerid][mod12]=Planelist[sellerid][mod12];
                Planelist[playerid][mod13]=Planelist[sellerid][mod13];
                Planelist[playerid][mod14]=Planelist[sellerid][mod14];
                Planelist[playerid][mod15]=Planelist[sellerid][mod15];
                Planelist[playerid][mod16]=Planelist[sellerid][mod16];
                Planelist[playerid][mod17]=Planelist[sellerid][mod17];
                Planelist[playerid][Paintjob]=Planelist[sellerid][Paintjob];
                Planelist[sellerid][planeTyp]=-1; Planelist[sellerid][X3]=0.0; Planelist[sellerid][Y3]=0.0; Planelist[sellerid][Z3]=0.0;
                Planelist[sellerid][Rotation]=0.0; Planelist[sellerid][Status]=0; Planelist[sellerid][Lock]=0; Planelist[sellerid][Carid]=-1;
                Planelist[sellerid][Color1]=-1; Planelist[sellerid][Color2]=-1; Planelist[sellerid][mod1]=-1; Planelist[sellerid][mod2]=-1;
                Planelist[sellerid][mod3]=-1; Planelist[sellerid][mod4]=-1; Planelist[sellerid][mod5]=-1; Planelist[sellerid][mod6]=-1;
                Planelist[sellerid][mod7]=-1; Planelist[sellerid][mod8]=-1; Planelist[sellerid][mod9]=-1; Planelist[sellerid][mod10]=-1;
                Planelist[sellerid][mod11]=-1; Planelist[sellerid][mod12]=-1; Planelist[sellerid][mod13]=-1; Planelist[sellerid][mod14]=-1;
                Planelist[sellerid][mod15]=-1; Planelist[sellerid][mod16]=-1; Planelist[sellerid][mod17]=-1; Planelist[sellerid][Paintjob]=-1;
        if (Planelist[playerid][Status]==1)
        {
                    SetPlaneParamsForAll(Planelist[playerid][Carid],0,Planelist[playerid][Lock]);
                    SetVehicleParamsForPlayer(Planelist[playerid][Carid],playerid,0,0);
                }
                LetjeliceSave(playerid);
                            format(string,128,"* Cestitamo! Kupili ste letjelicu {FFFFFF}%s "COL_YELLOW"za {FFFFFF}$%i!",planeBuylist[Planelist[playerid][planeTyp]][leName],price);
SendClientMessage(playerid, YELLOW, string);
SendClientMessage(playerid, ZELENKASTA, "Ako je vasa letjelica pokvaren, upisite {FFFFFF}/le fix "COL_ZELENA"da popravite.");
SendClientMessage(playerid, ZELENKASTA, "Mozete otkljucati/zakljucati vasu letjelicu sa naredbom {FFFFFF}/le lock.");
SendClientMessage(playerid, ZELENKASTA, "Ostalo: {FFFFFF}(/le)tjelica.");
                    SendClientMessage(playerid, COLOR_YELLOW, "Vasa letjelica je dostavljeno, Uzivajte!");
GetPlayerName(playerid,playername,sizeof(playername));
                format(string,128,"* Prodalo si svoju letjelicu {FFFFFF}%s "COL_YELLOW"za {FFFFFF}$%i!",playername, price);
                SendClientMessage(sellerid, YELLOW, string);
                    }
                    else
                    {
                        format(string, 128, "* Nedovoljno novca za kupnju letjelice (potrebno: {FFFFFF]$%i"COL_YELLOW")!", offerPlane[playerid][1]);
                        SendClientMessage(playerid, YELLOW, string);
                    }
                    }
                    else
                    {
                        offerPlane[playerid]={-1,0};
                        SendClientMessage(playerid, COLOR_GREY, "Prodavatelj nema automobil!.");
                    }
            }
            else
            {
        SendClientMessage(playerid, COLOR_GREY, "Vec imas auto!");
            }
}
            else
            {
                offerPlane[playerid]={-1,0};
                SendClientMessage(playerid, COLOR_GREY, "Prodavatelj je offline.");
            }
    }
    else
    {
        SendClientMessage(playerid, COLOR_GREY, "Nemas ponuda za kupovinu vozila (Auto,Motor/Bicikli,Brod,Letjelica).");
    }
    return 1;
}
if(strcmp(cmd, "/napusti", true) == 0)
{
if (Spectating[playerid][0]!=-1)
{
TogglePlayerControllable(playerid,1);
SetVehicleParamsForAll(Buylist[Spectating[playerid][0]][Carid],0,0);
Spectating[playerid][0]=-1;
RemovePlayerFromVehicle(playerid);
TextDrawDestroy(imevozila[playerid]);TextDrawDestroy(cijenavozila[playerid]);TextDrawDestroy(registracijavozila[playerid]);
TextDrawHideForPlayer(playerid, imevozila[playerid]);
TextDrawHideForPlayer(playerid, cijenavozila[playerid]);
TextDrawHideForPlayer(playerid, registracijavozila[playerid]);
}
if (bSpectating[playerid][0]!=-1)
{
TogglePlayerControllable(playerid,1);
SetVehicleParamsForAll(BikeBuylist[bSpectating[playerid][0]][Carid],0,0);
bSpectating[playerid][0]=-1;
RemovePlayerFromVehicle(playerid);
}
if (BrodSpectating[playerid][0]!=-1)
{
TogglePlayerControllable(playerid,1);
SetBoatParamsForAll(BoatBuylist[BrodSpectating[playerid][0]][Carid],0,0);
BrodSpectating[playerid][0]=-1;
RemovePlayerFromVehicle(playerid);
}
if (planeSpectating[playerid][0]!=-1)
{
TogglePlayerControllable(playerid,1);
SetPlaneParamsForAll(planeBuylist[planeSpectating[playerid][0]][Carid],0,0);
planeSpectating[playerid][0]=-1;
RemovePlayerFromVehicle(playerid);
}
return 1;
}