[Pomoc] Oko vozila

Započeo kim3205, Jul 04, 2013, 17:54:32 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: edit nbe
Detaljan opis problema:Idem na pijacu kupim vozilo izadje mi label drugog vozila i kad ga /v park pretvori se vozilo koje je bilo na labelu
Dio skripte:Eto Dole
Neke slike/video za lakse dobivanje pomoci(neobavezno):

Eo:

if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vehicle", true) == 0) // By Ellis
{
    if(IsPlayerConnected(playerid))
    {
        if(gPlayerLogged[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "   Morate prvo da se prijavite ! ");
            return 1;
        }
        new x_nr[64];
        x_nr = strtok(cmdtext, idx);
        if(!strlen(x_nr))
        {
            SendClientMessage(playerid, COLOR_RED," ");
            SendClientMessage(playerid, COLOR_RED, "|----------------------------------------------------------------------------|");
            SendClientMessage(playerid, COLOR_GREY, "                     (/v)ehicle [name]                                       ");
            SendClientMessage(playerid, COLOR_WHITE, "        park   lock(1-3)   sell   sellto   color  list  tablice  |  /findcar(1,2,3)  ");
            SendClientMessage(playerid, COLOR_RED, "|----------------------------------------------------------------------------|");
            return 1;
        }
        if(strcmp(x_nr,"sell",true) == 0)
        {
            if(IsAtDealership(playerid))
            {
                if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3])
                {
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    new ownvehkey;
                    if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey])
{
ownvehkey = PlayerInfo[playerid][pPcarkey];
PlayerInfo[playerid][pRegVozilo1] = 0;
PlayerInfo[playerid][pPorez1] = 0;
}
                    else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2])
{
    ownvehkey = PlayerInfo[playerid][pPcarkey2];
    PlayerInfo[playerid][pRegVozilo2] = 0;
    PlayerInfo[playerid][pPorez2] = 0;
}
                    else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3])
{
ownvehkey = PlayerInfo[playerid][pPcarkey3];
PlayerInfo[playerid][pRegVozilo3] = 0;
PlayerInfo[playerid][pPorez3] = 0;
}
                    else { return 1; }
                    if(strcmp(sendername, CarInfo[ownvehkey][cOwner], true) == 0)
                    {
                        new carsellprice = CarInfo[ownvehkey][cValue] / 4 * 3;
                        new Float:x,Float:y,Float:z;
                        new Float:a;
                        CarInfo[ownvehkey][cOwned] = 0;
                        strmid(CarInfo[ownvehkey][cOwner], "Dealership", 0, strlen("Dealership"), 999);
                        JBC_GivePlayerMoney(playerid,carsellprice);
                        PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                        format(string, sizeof(string), "~w~Prodali ste kola za: ~n~~g~$%d", carsellprice);
                        GameTextForPlayer(playerid, string, 10000, 3);
                        GetVehiclePos(ownvehkey, x, y, z);
                        GetVehicleZAngle(ownvehkey, a);
                        CarInfo[ownvehkey][cLocationx] = x;
                        CarInfo[ownvehkey][cLocationy] = y;
                        CarInfo[ownvehkey][cLocationz] = z;
                        CarInfo[ownvehkey][cAngle] = a;
                        if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { PlayerInfo[playerid][pPcarkey] = 999; }
                        else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { PlayerInfo[playerid][pPcarkey2] = 999; }
                        else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { PlayerInfo[playerid][pPcarkey3] = 999; }
                        RemovePlayerFromVehicle(playerid);
                        JBC_TogglePlayerControllable(playerid, 1);
                        if(PlayerInfo[playerid][pLocal] == ownvehkey)
                        {
                            SetPlayerInterior(playerid,0);
                            JBC_SetPlayerPos(playerid,CarInfo[ownvehkey][cLocationx],CarInfo[ownvehkey][cLocationy],CarInfo[ownvehkey][cLocationz]);
                            PlayerInfo[playerid][pInt] = 0;
                        }
                         OnPropUpdate();
                        SacuvajIgraca(playerid);
                        DestroyVehicle(ownvehkey);
CreateVehicle(CarInfo[ownvehkey][cModel],CarInfo[ownvehkey][cLocationx],CarInfo[ownvehkey][cLocationy],CarInfo[ownvehkey][cLocationz]+1.0,CarInfo[ownvehkey][cAngle],CarInfo[ownvehkey][cColorOne],CarInfo[ownvehkey][cColorTwo],60000);
                        return 1;
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "  Morate sedeti u svom vozilu da bi ste ga prodali! ");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "Niste u prodavnici automobila!");
                return 1;
            }
        }
        else if(strcmp(x_nr,"sellto",true) == 0)
        {
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3])
{
                    for(new c = 0; c < MAX_VEHICLES; c++)
                    {
    GetPlayerName(playerid, sendername, sizeof(sendername));
    new ownvehkey;
                if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey])
{
ownvehkey = PlayerInfo[playerid][pPcarkey];
PlayerInfo[playerid][pRegVozilo1] = 0;
}
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2])
{
ownvehkey = PlayerInfo[playerid][pPcarkey2];
PlayerInfo[playerid][pRegVozilo2] = 0;
}
                else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3])
{
ownvehkey = PlayerInfo[playerid][pPcarkey3];
PlayerInfo[playerid][pRegVozilo3] = 0;
}
        else { return 1; }
    if(strcmp(sendername, CarInfo[ownvehkey][cOwner], true) == 0)
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
    SendClientMessage(playerid, COLOR_WHITE, "Koriscenje: /v sellto [playerid/ime] [cena]");
    return 1;
}
new model[24]; GetVehicleName(c,model,sizeof(model));
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
    if(ProxDetectorS(8.0, playerid, giveplayerid))
        {
    if(PlayerInfo[giveplayerid][pPcarkey] == 999)
    {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "Koriscenje: /v sellto [playerid/ime] [cena]");
                return 1;
            }
            new price;
            price = strval(tmp);
            if(price < 1 || price > 1500000)
            {
                SendClientMessage(playerid, COLOR_GREY, "  Cena ne sme biti ispod 1 ili iznad 1500000.");
                return 1;
            }
            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
        format(string, sizeof(string), "* Ponudio si %s da kupi %s za $%d .", giveplayer, model, price);
        SendClientMessage(playerid, COLOR_WHITE, string);
        format(string, sizeof(string), "* Vlasnik automobila %s ti nudi da kupis %s za $%d (type /accept ownablecar) da kupite.", playername, model, price);
        SendClientMessage(giveplayerid, COLOR_WHITE, string);
        OwnableCarOffer[giveplayerid] = playerid;
        OwnableCarID[giveplayerid] = ownvehkey;
        OwnableCarPrice[giveplayerid] = price;
        return 1;
        }
        else if(PlayerInfo[giveplayerid][pPcarkey2] == 999)
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "Koriscenje: /v sellto [playerid/ime] [cena]");
                return 1;
            }
            new price;
            price = strval(tmp);
            if(price < 1 || price > 1500000)
            {
                SendClientMessage(playerid, COLOR_GREY, "  Cena ne sme biti ispod 1 ili iznad 1500000. ");
                return 1;
            }
            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
        format(string, sizeof(string), "* Ponudio si %s da kupi %s za $%d .", giveplayer, model, price);
        SendClientMessage(playerid, COLOR_WHITE, string);
        format(string, sizeof(string), "* Vlasnik automobila %s ti nudi da kupis %s za $%d (type /accept ownablecar) da kupite.", playername, model, price);
        SendClientMessage(giveplayerid, COLOR_WHITE, string);
        OwnableCarOffer[giveplayerid] = playerid;
        OwnableCarID[giveplayerid] = ownvehkey;
        OwnableCarPrice[giveplayerid] = price;
        return 1;
        }
        else if(PlayerInfo[giveplayerid][pPcarkey3] == 999)
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "Koriscenje: /v sellto [playerid/ime] [cena]");
                return 1;
            }
            new price;
            price = strval(tmp);
            if(price < 1 || price > 1500000)
            {
                SendClientMessage(playerid, COLOR_GREY, "  Cena ne sme biti ispod 1 ili iznad 1500000. ");
                return 1;
            }
            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
        format(string, sizeof(string), "* Ponudio si %s da %s za $%d .", giveplayer, model, price);
        SendClientMessage(playerid, COLOR_WHITE, string);
        format(string, sizeof(string), "* Vlasnik automobila %s ti nudi da kupis %s za $%d (type /accept ownablecar) da kupite.", playername, model, price);
        SendClientMessage(giveplayerid, COLOR_WHITE, string);
        OwnableCarOffer[giveplayerid] = playerid;
        OwnableCarID[giveplayerid] = ownvehkey;
        OwnableCarPrice[giveplayerid] = price;
        return 1;
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "   Igrac ima vec 3 vozila ! ");
            return 1;
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_GREY, "   Igrac nije blizu tebe ! ");
        return 1;
    }
}
}
    }
    else
    {
        SendClientMessage(playerid, COLOR_GREY, "  Ovo nije tvoje vozilo");
        return 1;
    }
    }
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "  Morate biti u svom vozilu da bi ga prodali!");
    return 1;
}
        }
        else if(strcmp(x_nr,"park",true) == 0)
        {
            new Float:x,Float:y,Float:z;
new Float:a;
new carid;
new getcarid;
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { carid = PlayerInfo[playerid][pPcarkey3]; }
else { return 1; }
getcarid = GetPlayerVehicleID(playerid);
GetPlayerName(playerid, playername, sizeof(playername));
GetVehiclePos(carid, x, y, z);
//GetPlayerFacingAngle(playerid, a);
GetVehicleZAngle(carid, a);
if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)
{
    if(PlayerInfo[playerid][pPcarkey] == 999 && PlayerInfo[playerid][pPcarkey2] == 999 & PlayerInfo[playerid][pPcarkey3])
{
SendClientMessage(playerid, COLOR_GREY, "Ti ne posedujes kola.");
return 1;
}
if(getcarid == carid)
{
CarInfo[carid][cLocationx] = x;
CarInfo[carid][cLocationy] = y;
CarInfo[carid][cLocationz] = z;
CarInfo[carid][cAngle] = a;
format(string, sizeof(string), "~n~ Parkirali ste vase vozilo na ovoj lokaciji. ~n~");
GameTextForPlayer(playerid, "Parkirali ste vozilo na ovoj poziciji i ono ce se stvarati tu.", 10000, 3);
      OnPropUpdate();
SacuvajIgraca(playerid);
DestroyVehicle(carid);
CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
JBC_TogglePlayerControllable(playerid, 1);
return 1;
    }
}
        }
        else if(strcmp(x_nr,"lock1",true) == 0)
        {
                new keycar = PlayerInfo[playerid][pPcarkey];
                if(keycar != 999)
                {
                    new locked[256];
                    locked = strtok(cmdtext, idx);
                    if(CarInfo[keycar][cLock] == 1)
                    {
                    for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,0);
}
}
format(string, sizeof(string), "~w~Vozilo~n~~g~Otkljucano");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 0;
      OnPropUpdate();
return 1;
}
else if(CarInfo[keycar][cLock] == 0)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,1);
}
}
format(string, sizeof(string), "~w~Vozilo~n~~r~Zakljucano");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 1;
      OnPropUpdate();
return 1;
}
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "  Nemate vozilo na slotu 1.");
                    return 1;
                }
        }
        else if(strcmp(x_nr,"lock2",true) == 0)
        {
                new keycar = PlayerInfo[playerid][pPcarkey2];
                if(keycar != 999)
                {
                    new locked[256];
                    locked = strtok(cmdtext, idx);
                    if(CarInfo[keycar][cLock] == 1)
                    {
                    for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,0);
}
}
format(string, sizeof(string), "~w~Vozilo~n~~g~otkljucano");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 0;
      OnPropUpdate();
return 1;
}
else if(CarInfo[keycar][cLock] == 0)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,1);
}
}
format(string, sizeof(string), "~w~Vozilo~n~~r~zakljucano");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 1;
      OnPropUpdate();
return 1;
}
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "  Nemate vozilo na slotu 2.");
                    return 1;
                }
        }
        else if(strcmp(x_nr,"lock3",true) == 0)
        {
                new keycar = PlayerInfo[playerid][pPcarkey3];
                if(keycar != 999)
                {
                    new locked[256];
                    locked = strtok(cmdtext, idx);
                    if(CarInfo[keycar][cLock] == 1)
                    {
                    for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,0);
}
}
format(string, sizeof(string), "~w~Vozilo~n~~g~otkljucano");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 0;
      OnPropUpdate();
return 1;
}
else if(CarInfo[keycar][cLock] == 0)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
SetVehicleParamsForPlayer(keycar,i,0,1);
}
}
format(string, sizeof(string), "~w~Vozilo~n~~r~Zakljucano");
GameTextForPlayer(playerid, string, 4000, 3);
CarInfo[keycar][cLock] = 1;
      OnPropUpdate();
return 1;
}
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "  Nemate vozilo na slotu 3.");
                    return 1;
                }
}
        else if(strcmp(x_nr,"list",true) == 0)
        {
        new carkey = PlayerInfo[playerid][pPcarkey];
new carkey2 = PlayerInfo[playerid][pPcarkey2];
new carkey3 = PlayerInfo[playerid][pPcarkey3];
            if(PlayerInfo[playerid][pPcarkey] == 999 && PlayerInfo[playerid][pPcarkey2] == 999 && PlayerInfo[playerid][pPcarkey3] == 999)
        {
            SendClientMessage(playerid, COLOR_RED," ");
            SendClientMessage(playerid, COLOR_RED,"----------------------------------[ Lista Vozila ]-----------------------------------------");
            SendClientMessage(playerid, COLOR_WHITE,"  Vi nemate vozila!");
            SendClientMessage(playerid, COLOR_RED,"-------------------------------------------------------------------------------------------");
            return 1;
}
else
{
    SendClientMessage(playerid, COLOR_RED," ");
    SendClientMessage(playerid, COLOR_RED,"----------------------------------[ Lista Vozila ]----------------------------------------");
if (PlayerInfo[playerid][pPcarkey] != 999)
{
format(string, sizeof(string), " 1| Model:[%s]  Cena:[%d]  Boja1:[%d]   Boja2:[%d]   Otkljucan/Zakljucan:[%d]   Reg:[%d]", CarInfo[carkey][cDescription], CarInfo[carkey][cValue], CarInfo[carkey][cColorOne], CarInfo[carkey][cColorTwo], CarInfo[carkey][cLock], PlayerInfo[playerid][pRegVozilo1]);
    SendClientMessage(playerid, COLOR_GRAD5,string);
}
if (PlayerInfo[playerid][pPcarkey2] != 999)
{
    format(string, sizeof(string), " 2| Model:[%s]  Cena:[%d]  Boja1:[%d]   Boja2:[%d]   Otkljucano/Zakljucano:[%d]   Reg:[%d]", CarInfo[carkey2][cDescription], CarInfo[carkey2][cValue], CarInfo[carkey2][cColorOne], CarInfo[carkey2][cColorTwo], CarInfo[carkey2][cLock], PlayerInfo[playerid][pRegVozilo2]);
    SendClientMessage(playerid, COLOR_GRAD5,string);
}
if (PlayerInfo[playerid][pPcarkey3] != 999)
{
    format(string, sizeof(string), " 3| Model:[%s]  Cena:[%d]  Boja01:[%d]  Boja2:[%d]   Otkljucano/Zakljucano:[%d]   Reg:[%d]", CarInfo[carkey3][cDescription], CarInfo[carkey3][cValue], CarInfo[carkey3][cColorOne], CarInfo[carkey3][cColorTwo], CarInfo[carkey3][cLock], PlayerInfo[playerid][pRegVozilo3]);
    SendClientMessage(playerid, COLOR_GRAD5,string);
}
    SendClientMessage(playerid, COLOR_RED,"-------------------------------------------------------------------------------------------");
            return 1;
        }
        }
        else if(strcmp(x_nr,"color",true) == 0)
        {
            if(PlayerInfo[playerid][pPcarkey] == 999 && PlayerInfo[playerid][pPcarkey2] == 999 && PlayerInfo[playerid][pPcarkey3] == 999)
        {
            SendClientMessage(playerid, COLOR_GREY,"   Nemate vozilo da ga obojite.");
            return 1;
        }
        if(JBC_GetPlayerMoney(playerid) < 1000)
        {
            SendClientMessage(playerid, COLOR_GREY,"   Nemate dovoljno novca da obojite vozilo.");
            return 1;
        }
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Koriscenje: /v color [Boja1ID] [Boja2ID]");
return 1;
}
new color1;
color1 = strval(tmp);
if(color1 < 0 && color1 > 126)
{
    SendClientMessage(playerid, COLOR_GREY, "   Pogresan ID boje!");
    return 1;
}
tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Koriscenje: /v color [Boja1ID] [Boja2ID]");
return 1;
}
new color2;
color2 = strval(tmp);
if(color2 < 0 && color2 > 126)
{
    SendClientMessage(playerid, COLOR_GREY, "   Pogresan ID boje!");
    return 1;
}

new vehid;
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { vehid = PlayerInfo[playerid][pPcarkey]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { vehid = PlayerInfo[playerid][pPcarkey2]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { vehid = PlayerInfo[playerid][pPcarkey3]; }
else { return 1; }

        if(IsPlayerInVehicle(playerid, vehid))
        {
          CarInfo[vehid][cColorOne] = color1;
                CarInfo[vehid][cColorTwo] = color2;
                JBC_GivePlayerMoney(playerid, -1000);
                GameTextForPlayer(playerid, "~w~Platili ste:~n~~r~-$1000", 5000, 1);
                ChangeVehicleColor(vehid, color1, color2);
                 OnPropUpdate();
SacuvajIgraca(playerid);
return 1;
    }
        else
        {
            SendClientMessage(playerid, COLOR_GREY,"   Niste u svojem vozilu.");
            return 1;
        }
        }
        else if(strcmp(x_nr,"buy",true) == 0)
        {
            if(IsAnOwnableCar(idcar))
            {
                if(PlayerInfo[playerid][pLevel] < 2)
    {
                    SendClientMessage(playerid, COLOR_GREY, "Morate biti level 2 da kupite vozilo!");
                    return 1;
    }
    if(BizzInfo[45][bProducts] == 0)
{
GameTextForPlayer(playerid, "~r~Rasporodato", 5000, 1);
return 1;
}
    if(PlayerInfo[playerid][pPcarkey] == 999) { }
    else if(PlayerInfo[playerid][pPcarkey2] == 999) { }
    else if(PlayerInfo[playerid][pPcarkey3] == 999) { }
    else { SendClientMessage(playerid, COLOR_GREY, "   Ti vec imas 3 vozila."); return 1; }
if(CarInfo[idcar][cOwned]==1)
{
    SendClientMessage(playerid, COLOR_GREY, "Neko je vec kupio ovo vozilo.");
    return 1;
}
if(JBC_GetPlayerMoney(playerid) >= CarInfo[idcar][cValue])
{
    if(PlayerInfo[playerid][pPcarkey] == 999)
{
PlayerInfo[playerid][pPcarkey] = idcar;
PlayerInfo[playerid][pRegVozilo1] = 0;
PlayerInfo[playerid][pPorez1] = CarInfo[idcar][cValue]/500;
}
    else if(PlayerInfo[playerid][pPcarkey2] == 999)
{
PlayerInfo[playerid][pPcarkey2] = idcar;
PlayerInfo[playerid][pRegVozilo2] = 0;
PlayerInfo[playerid][pPorez2] = CarInfo[idcar][cValue]/500;
}
    else if(PlayerInfo[playerid][pPcarkey3] == 999)
{
PlayerInfo[playerid][pPcarkey3] = idcar;
PlayerInfo[playerid][pRegVozilo3] = 0;
PlayerInfo[playerid][pPorez3] = CarInfo[idcar][cValue]/500;
}
    else { return 1; }
CarInfo[idcar][cOwned] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(CarInfo[idcar][cOwner], sendername, 0, strlen(sendername), 999);
JBC_GivePlayerMoney(playerid,-CarInfo[idcar][cValue]);
BizzInfo[45][bTill] += 5000;
ExtortionSBiz(1, BizzInfo[45][bEntranceCost]);
BizzInfo[45][bProducts]--;
PlayerPlayMusic(playerid);
GameTextForPlayer(playerid, "~w~Cestitamo~n~Ne zaboravite da [ /v park ] vase vozilo!", 5000, 3);
SendClientMessage(playerid, COLOR_GRAD2, "Cestitamo, kupili ste vozilo!");
SendClientMessage(playerid, COLOR_GRAD2, "Kucajte /vehiclehelp da vidite instrukcije za vozilo!");
SendClientMessage(playerid, COLOR_YELLOW2, "Mozete pokrenuti vas motor sad ( /engine ili pritisnite C ) !");
gEngine[playerid] = 0;
engineOn[GetPlayerVehicleID(playerid)] = false;
DateProp(playerid);
      OnPropUpdate();
SacuvajIgraca(playerid);
return 1;
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "  Nemate dovoljno novca kod sebe ! ");
    return 1;
}
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "Koriscenje: (/v)ehicle [ime]");
            SendClientMessage(playerid, COLOR_WHITE, "Dostupna imena: park, lock(1-3), sell, sellto, color, /findcar [1,2,3]");
            return 1;
        }
    }
    return 1;
}

i am king!