Jump to content
  • 0

Ajutor va rog dau un host de sa-mp il platesc eu in fiecare luna


AndreiB

Question

Salut  am o problema la gamemodeul bigzone se suprapune slot 6 cu slotul 5

 la /v sa zicem ca pe slotul 5 am elegy si pe slotul 6 infernus cand ies de pe server si intru i,i arata ca pe slotul 6 am tot elegy dar aveam infernus

Cine ma ajuta ii dau host de sa-mp il platesc eu nici o problema

  • Haha 1
Link to comment
Share on other sites

Recommended Posts

  • 0
Acum 19 ore, AndreiB a spus:

Salut  am o problema la gamemodeul bigzone se suprapune slot 6 cu slotul 5

 la /v sa zicem ca pe slotul 5 am elegy si pe slotul 6 infernus cand ies de pe server si intru i,i arata ca pe slotul 6 am tot elegy dar aveam infernus

Cine ma ajuta ii dau host de sa-mp il platesc eu nici o problema

codul sursa pt tot ce tine de /buycar si incarcarea datelor din baza de date pt sloturile de masini

Link to comment
Share on other sites

  • 0

CMD:buycar(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid,COLOR_WHITE,"{FFB870}Please get out of the car.");
    if(IsPlayerInRangeOfPoint(playerid, 7.0, 328.3534,-1513.1687,36.0391))
    {
        if(PlayerInfo[playerid][pLevel] < 3) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}You need to be level 3 to buy a vehicle.");
        BuyCar[playerid] = -1;
        ShowPlayerDialog(playerid,DIALOG_CARBUY, DIALOG_STYLE_LIST, "Buy a car", "Cheap cars\nRegular cars\nExpensive cars\nPremium cars", "Select", "Close");
    }
    else return SCM(playerid,COLOR_WHITE,"{FFB870}You are not the place where you can buy a car.");
      return 1;
}

// type 1 - car | 2 - moto/bike | 3 - heli | 4 - premium cars.
public InsertCar(playerid,type,stockid)
{
    new string[128],sendername[25],namecar[100];
    new idd = Findcar();
    new model = Stock[stockid][vModel];
    new value = Stock[stockid][vPrice];
    strmid(namecar,Stock[stockid][vName], 0, 100, 255);
    GetPlayerName(playerid,sendername,sizeof(sendername));
    BuyCar[playerid] = -1;
    if(idd != 0)
    {
        if(GetPlayerCash(playerid) < value) return SCM(playerid,COLOR_WHITE,"You do not have enough money.");
        if(type == 1)
        {
            if(PlayerInfo[playerid][pPremiumAccount] == 0 && PlayerInfo[playerid][pPlusSlot1] == 0 && PlayerInfo[playerid][pPlusSlot2] == 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 0)
                {
                    PlayerInfo[playerid][pPcarkey] = idd;
                    Update(playerid,pPcarkeyx);
                    CarInfo[idd][cLocationx] = 284.5032;
                    CarInfo[idd][cLocationy] = -1526.4036;
                    CarInfo[idd][cLocationz] = 24.3208;
                    CarInfo[idd][cAngle] = 235.1191;
                }
                else
                {
                        if(PlayerInfo[playerid][pmotokey] == 0)
                        {
                            PlayerInfo[playerid][pmotokey] = idd;
                            Update(playerid,pmotokeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else return SCM(playerid,COLOR_WHITE,"Already own 2 cars.");
                }
            }
            if(PlayerInfo[playerid][pPlusSlot1] == 1 && PlayerInfo[playerid][pPremiumAccount] == 0 && PlayerInfo[playerid][pPlusSlot2] == 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 0)
                {
                    PlayerInfo[playerid][pPcarkey] = idd;
                    Update(playerid,pPcarkeyx);
                    CarInfo[idd][cLocationx] = 284.5032;
                    CarInfo[idd][cLocationy] = -1526.4036;
                    CarInfo[idd][cLocationz] = 24.3208;
                    CarInfo[idd][cAngle] = 235.1191;
                }
                else
                {
                        if(PlayerInfo[playerid][pmotokey] == 0)
                        {
                            PlayerInfo[playerid][pmotokey] = idd;
                            Update(playerid,pmotokeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pPPluscarkey] == 0)
                        {
                            PlayerInfo[playerid][pPPluscarkey] = idd;
                            Update(playerid,pPPluscarkeyx);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else return SCM(playerid,COLOR_WHITE,"Already own 2 cars + 1 plus car.");
                }
            }
            if(PlayerInfo[playerid][pPlusSlot1] == 1 && PlayerInfo[playerid][pPlusSlot2] == 1 && PlayerInfo[playerid][pPremiumAccount] == 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 0)
                {
                    PlayerInfo[playerid][pPcarkey] = idd;
                    Update(playerid,pPcarkeyx);
                    CarInfo[idd][cLocationx] = 284.5032;
                    CarInfo[idd][cLocationy] = -1526.4036;
                    CarInfo[idd][cLocationz] = 24.3208;
                    CarInfo[idd][cAngle] = 235.1191;
                }
                else
                {
                        if(PlayerInfo[playerid][pmotokey] == 0)
                        {
                            PlayerInfo[playerid][pmotokey] = idd;
                            Update(playerid,pmotokeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pPPluscarkey] == 0)
                        {
                            PlayerInfo[playerid][pPPluscarkey] = idd;
                            Update(playerid,pPPluscarkeyx);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pPPluscarkey2] == 0)
                        {
                            PlayerInfo[playerid][pPPluscarkey2] = idd;
                            Update(playerid,pPPluscarkey2x);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else return SCM(playerid,COLOR_WHITE,"Already own 2 cars + 2 plus cars.");
                }
            }
            if(PlayerInfo[playerid][pPlusSlot1] == 1 && PlayerInfo[playerid][pPlusSlot2] == 0 && PlayerInfo[playerid][pPremiumAccount] > 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 0)
                {
                    PlayerInfo[playerid][pPcarkey] = idd;
                    Update(playerid,pPcarkeyx);
                    CarInfo[idd][cLocationx] = 284.5032;
                    CarInfo[idd][cLocationy] = -1526.4036;
                    CarInfo[idd][cLocationz] = 24.3208;
                    CarInfo[idd][cAngle] = 235.1191;
                }
                else
                {
                        if(PlayerInfo[playerid][pmotokey] == 0)
                        {
                            PlayerInfo[playerid][pmotokey] = idd;
                            Update(playerid,pmotokeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pprcarkey] == 0)
                        {
                            PlayerInfo[playerid][pprcarkey] = idd;
                            Update(playerid,pprcarkeyx);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pprcarkey2] == 0)
                        {
                            PlayerInfo[playerid][pprcarkey2] = idd;
                            Update(playerid,pprcarkey2x);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pPPluscarkey] == 0)
                        {
                            PlayerInfo[playerid][pPPluscarkey] = idd;
                            Update(playerid,pPPluscarkeyx);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else return SCM(playerid,COLOR_WHITE,"Already own 2 cars + 2 premium cars + 1 plus car.");
                }
            }
            if(PlayerInfo[playerid][pPlusSlot1] == 1 && PlayerInfo[playerid][pPlusSlot2] == 1 && PlayerInfo[playerid][pPremiumAccount] > 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 0)
                {
                    PlayerInfo[playerid][pPcarkey] = idd;
                    Update(playerid,pPcarkeyx);
                    CarInfo[idd][cLocationx] = 284.5032;
                    CarInfo[idd][cLocationy] = -1526.4036;
                    CarInfo[idd][cLocationz] = 24.3208;
                    CarInfo[idd][cAngle] = 235.1191;
                }
                else
                {
                        if(PlayerInfo[playerid][pmotokey] == 0)
                        {
                            PlayerInfo[playerid][pmotokey] = idd;
                            Update(playerid,pmotokeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pprcarkey] == 0)
                        {
                            PlayerInfo[playerid][pprcarkey] = idd;
                            Update(playerid,pprcarkeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pprcarkey2] == 0)
                        {
                            PlayerInfo[playerid][pprcarkey2] = idd;
                            Update(playerid,pprcarkey2x);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pPPluscarkey] == 0)
                        {
                            PlayerInfo[playerid][pPPluscarkey] = idd;
                            Update(playerid,pPPluscarkeyx);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pPPluscarkey2] == 0)
                        {
                            PlayerInfo[playerid][pPPluscarkey2] = idd;
                            Update(playerid,pPPluscarkey2x);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else return SCM(playerid,COLOR_WHITE,"Already own 2 cars + 2 premium cars + 2 plus cars.");
                }
            }
            if(PlayerInfo[playerid][pPremiumAccount] > 0 && PlayerInfo[playerid][pPlusSlot1] == 0 && PlayerInfo[playerid][pPlusSlot2] == 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 0)
                {
                    PlayerInfo[playerid][pPcarkey] = idd;
                    Update(playerid,pPcarkeyx);
                     CarInfo[idd][cLocationx] = 284.5032;
                    CarInfo[idd][cLocationy] = -1526.4036;
                    CarInfo[idd][cLocationz] = 24.3208;
                    CarInfo[idd][cAngle] = 235.1191;
                 }
                 else
                 {
                         if(PlayerInfo[playerid][pmotokey] == 0)
                        {
                            PlayerInfo[playerid][pmotokey] = idd;
                            Update(playerid,pmotokeyx);
                             CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pprcarkey] == 0)
                        {
                            PlayerInfo[playerid][pprcarkey] = idd;
                            Update(playerid,pprcarkeyx);
                             CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                         }
                         else if(PlayerInfo[playerid][pprcarkey2] == 0)
                        {
                            PlayerInfo[playerid][pprcarkey2] = idd;
                            Update(playerid,pprcarkey2x);
                             CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                         }
                        else return SCM(playerid,COLOR_WHITE,"Already own 2 premium cars + 2 cars.");
                }
            }
        }

        Stock[stockid][vStock]--;
        mysql_format(SQL, string, sizeof(string), "UPDATE stock SET Stock='%d' WHERE ID='%d'", Stock[stockid][vStock],stockid);
        mysql_tquery(SQL,string,"","");

        GivePlayerCash(playerid,-value);
        Update(playerid,pCashx);

        CarInfo[idd][cSell] = 1;
        CarInfo[idd][cID] = idd;
        CarInfo[idd][cModel] = model;

        CarInfo[idd][cColorOne] = 1;
        CarInfo[idd][cColorTwo] = 1;
        strmid(CarInfo[idd][cOwner], PlayerInfo[playerid][pNormalName], 0, 25, 255);
        strmid(CarInfo[idd][cDescription],namecar, 0, strlen(namecar), 255);
        CarInfo[idd][cValue] = value;
        strmid(CarInfo[idd][cLicense], "NewCar", 0, 6, 255);
        CarInfo[idd][cOwned] = 1;
        CarInfo[idd][cLock] = 0;
        CarInfo[idd][cTimed] = 0;
        CarInfo[idd][cInscarprice] = 100;
        CarInfo[idd][cInsurancecar] = 4;
        CarInfo[idd][cKM] = 0.0;
        CarInfo[idd][cHP] = 1000.0;
        CarInfo[idd][cDamage1] = 0;
        CarInfo[idd][cDamage2] = 0;
        CarInfo[idd][cDamage3] = 0;
        CarInfo[idd][cDamage4] = 0;
        CarInfo[idd][cGas] = 100;
        CarInfo[idd][cPaintJ] = 6;
        CarInfo[idd][mod1] = 0;
        CarInfo[idd][mod2] = 0;
        CarInfo[idd][mod3] = 0;
        CarInfo[idd][mod4] = 0;
        CarInfo[idd][mod5] = 0;
        CarInfo[idd][mod6] = 0;
        CarInfo[idd][mod7] = 0;
        CarInfo[idd][mod8] = 0;
        CarInfo[idd][mod9] = 0;
        CarInfo[idd][mod10] = 0;
        CarInfo[idd][mod11] = 0;
        CarInfo[idd][mod12] = 0;
        CarInfo[idd][mod13] = 0;
        CarInfo[idd][mod14] = 0;
        CarInfo[idd][mod15] = 0;
        CarInfo[idd][mod16] = 0;
        CarInfo[idd][mod17] = 0;
        CarInfo[idd][cDays] = 0;

        vUpdate(idd, cModsx);
        vUpdate(idd, cPaintJx);
        vUpdate(idd, cSellx);
        vUpdate(idd, cLocationxx);
        vUpdate(idd, cLocationyx);
        vUpdate(idd, cLocationzx);
        vUpdate(idd, cAnglex);
        vUpdate(idd, cModelx);
        vUpdate(idd, cColorOnex);
        vUpdate(idd, cColorTwox);
        vUpdate(idd, cOwnerx);
        vUpdate(idd, cValuex);
        vUpdate(idd, cLicensex);
        vUpdate(idd, cDescriptionx);
        vUpdate(idd, cLockx);
        vUpdate(idd, cTimedx);
        vUpdate(idd, cInscarpricex);
        vUpdate(idd, cInsurancecarx);
        vUpdate(idd, cKMx);
        vUpdate(idd, cOwnedx);
        vUpdate(idd, cDaysx);
        vUpdate(idd, cHPx);
        vUpdate(idd, cDamage1x);
        vUpdate(idd, cDamage2x);
        vUpdate(idd, cDamage3x);
        vUpdate(idd, cDamage4x);
        vUpdate(idd, cGasx);

        new car = CreateVehicle(CarInfo[idd][cModel],CarInfo[idd][cLocationx],CarInfo[idd][cLocationy],CarInfo[idd][cLocationz],CarInfo[idd][cAngle],1,1,500000);
        SetVehicleNumberPlate(car,CarInfo[idd][cLicense]);

        new disp[184],stringsss[256],numele[30];
        format(disp,sizeof(disp),"You bought %s.Please take your car and park it elsewhere.",CarInfo[idd][cDescription]);
        SCM(playerid,COLOR_GREEN,disp);
        GetPlayerName(playerid, numele, sizeof(numele));
        format(stringsss,sizeof(stringsss),"%s [user:%d] bought a %s [car:%d] for $%s.",numele,PlayerInfo[playerid][pSQLID],CarInfo[idd][cDescription],CarInfo[idd][cID],FormatNumber(value));
        ABroadCast(COLOR_YELLOW,stringsss,1);
        new var100[256],y,m,d,h,mi,s,string2[256],string3[256];
        getdate(y,m,d);
        gettime(h,mi,s);
        format(string2,sizeof(string2),"[%02d-%02d-%d %02d:%02d:%02d] %s",d,m,y,h,mi,s,stringsss);
        mysql_real_escape_string(string2, string3);
        mysql_format(SQL, var100, sizeof(var100), "INSERT INTO playerlogs (`playerid`,`giverid`,`action`,`time`) VALUES ('%d','0','%s','%02d-%02d-%d %02d:%02d:%02d')", PlayerInfo[playerid][pSQLID],string3,d,m,y,h,mi,s);
        mysql_tquery(SQL,var100,"","");

        OwnedVeh(car) = idd;
        if(idd == PlayerInfo[playerid][pPcarkey])
        {
            personalcar[0][playerid] = car;
        }
        if(idd == PlayerInfo[playerid][pmotokey])
        {
            personalcar[1][playerid] = car;
        }
        if(idd == PlayerInfo[playerid][pprcarkey])
        {
            personalcar[2][playerid] = car;
        }
        if(idd == PlayerInfo[playerid][pprcarkey2])
        {
            personalcar[3][playerid] = car;
        }
        if(idd == PlayerInfo[playerid][pPPluscarkey])
        {
            personalcar[4][playerid] = car;
        }
        if(idd == PlayerInfo[playerid][pPPluscarkey2])
        {
            personalcar[5][playerid] = car;
        }
        masini++;
        SwitchKey[playerid] = 1;
    }
    if(idd == 0)
    {
        if(GetPlayerCash(playerid) < value) return SCM(playerid,COLOR_WHITE,"You do not have enough money.");

        new Cache: sar = mysql_query(SQL,"SELECT * FROM `cars`");
        idd = cache_num_rows()+1;
        cache_delete(sar);

        if(type == 1)
        {
            if(PlayerInfo[playerid][pPremiumAccount] == 0 && PlayerInfo[playerid][pPlusSlot1] == 0 && PlayerInfo[playerid][pPlusSlot2] == 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 0)
                {
                    PlayerInfo[playerid][pPcarkey] = idd;
                    Update(playerid,pPcarkeyx);
                    CarInfo[idd][cLocationx] = 284.5032;
                    CarInfo[idd][cLocationy] = -1526.4036;
                    CarInfo[idd][cLocationz] = 24.3208;
                    CarInfo[idd][cAngle] = 235.1191;
                }
                else
                {
                        if(PlayerInfo[playerid][pmotokey] == 0)
                        {
                            PlayerInfo[playerid][pmotokey] = idd;
                            Update(playerid,pmotokeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else return SCM(playerid,COLOR_WHITE,"Already own 2 cars.");
                }
            }
            if(PlayerInfo[playerid][pPlusSlot1] == 1 && PlayerInfo[playerid][pPremiumAccount] == 0 && PlayerInfo[playerid][pPlusSlot2] == 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 0)
                {
                    PlayerInfo[playerid][pPcarkey] = idd;
                    Update(playerid,pPcarkeyx);
                    CarInfo[idd][cLocationx] = 284.5032;
                    CarInfo[idd][cLocationy] = -1526.4036;
                    CarInfo[idd][cLocationz] = 24.3208;
                    CarInfo[idd][cAngle] = 235.1191;
                }
                else
                {
                        if(PlayerInfo[playerid][pmotokey] == 0)
                        {
                            PlayerInfo[playerid][pmotokey] = idd;
                            Update(playerid,pmotokeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pPPluscarkey] == 0)
                        {
                            PlayerInfo[playerid][pPPluscarkey] = idd;
                            Update(playerid,pPPluscarkeyx);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else return SCM(playerid,COLOR_WHITE,"Already own 2 cars + 1 plus car.");
                }
            }
            if(PlayerInfo[playerid][pPlusSlot1] == 1 && PlayerInfo[playerid][pPlusSlot2] == 1 && PlayerInfo[playerid][pPremiumAccount] == 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 0)
                {
                    PlayerInfo[playerid][pPcarkey] = idd;
                    Update(playerid,pPcarkeyx);
                    CarInfo[idd][cLocationx] = 284.5032;
                    CarInfo[idd][cLocationy] = -1526.4036;
                    CarInfo[idd][cLocationz] = 24.3208;
                    CarInfo[idd][cAngle] = 235.1191;
                }
                else
                {
                        if(PlayerInfo[playerid][pmotokey] == 0)
                        {
                            PlayerInfo[playerid][pmotokey] = idd;
                            Update(playerid,pmotokeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pPPluscarkey] == 0)
                        {
                            PlayerInfo[playerid][pPPluscarkey] = idd;
                            Update(playerid,pPPluscarkeyx);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pPPluscarkey2] == 0)
                        {
                            PlayerInfo[playerid][pPPluscarkey2] = idd;
                            Update(playerid,pPPluscarkey2x);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else return SCM(playerid,COLOR_WHITE,"Already own 2 cars + 2 plus cars.");
                }
            }
            if(PlayerInfo[playerid][pPlusSlot1] == 1 && PlayerInfo[playerid][pPlusSlot2] == 0 && PlayerInfo[playerid][pPremiumAccount] > 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 0)
                {
                    PlayerInfo[playerid][pPcarkey] = idd;
                    Update(playerid,pPcarkeyx);
                    CarInfo[idd][cLocationx] = 284.5032;
                    CarInfo[idd][cLocationy] = -1526.4036;
                    CarInfo[idd][cLocationz] = 24.3208;
                    CarInfo[idd][cAngle] = 235.1191;
                }
                else
                {
                        if(PlayerInfo[playerid][pmotokey] == 0)
                        {
                            PlayerInfo[playerid][pmotokey] = idd;
                            Update(playerid,pmotokeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pprcarkey] == 0)
                        {
                            PlayerInfo[playerid][pprcarkey] = idd;
                            Update(playerid,pprcarkeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pprcarkey2] == 0)
                        {
                            PlayerInfo[playerid][pprcarkey2] = idd;
                            Update(playerid,pprcarkey2x);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pPPluscarkey] == 0)
                        {
                            PlayerInfo[playerid][pPPluscarkey] = idd;
                            Update(playerid,pPPluscarkeyx);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else return SCM(playerid,COLOR_WHITE,"Already own 2 cars + 2 premium cars + 1 plus car.");
                }
            }
            if(PlayerInfo[playerid][pPlusSlot1] == 1 && PlayerInfo[playerid][pPlusSlot2] == 1 && PlayerInfo[playerid][pPremiumAccount] > 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 0)
                {
                    PlayerInfo[playerid][pPcarkey] = idd;
                    Update(playerid,pPcarkeyx);
                    CarInfo[idd][cLocationx] = 284.5032;
                    CarInfo[idd][cLocationy] = -1526.4036;
                    CarInfo[idd][cLocationz] = 24.3208;
                    CarInfo[idd][cAngle] = 235.1191;
                }
                else
                {
                        if(PlayerInfo[playerid][pmotokey] == 0)
                        {
                            PlayerInfo[playerid][pmotokey] = idd;
                            Update(playerid,pmotokeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pprcarkey] == 0)
                        {
                            PlayerInfo[playerid][pprcarkey] = idd;
                            Update(playerid,pprcarkeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pprcarkey2] == 0)
                        {
                            PlayerInfo[playerid][pprcarkey2] = idd;
                            Update(playerid,pprcarkey2x);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pPPluscarkey] == 0)
                        {
                            PlayerInfo[playerid][pPPluscarkey] = idd;
                            Update(playerid,pPPluscarkeyx);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pPPluscarkey2] == 0)
                        {
                            PlayerInfo[playerid][pPPluscarkey2] = idd;
                            Update(playerid,pPPluscarkey2x);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else return SCM(playerid,COLOR_WHITE,"Already own 2 cars + 2 premium cars + 2 plus cars.");
                }
            }
            if(PlayerInfo[playerid][pPremiumAccount] > 0 && PlayerInfo[playerid][pPlusSlot1] == 0 && PlayerInfo[playerid][pPlusSlot2] == 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 0)
                {
                    PlayerInfo[playerid][pPcarkey] = idd;
                    Update(playerid,pPcarkeyx);
                     CarInfo[idd][cLocationx] = 284.5032;
                    CarInfo[idd][cLocationy] = -1526.4036;
                    CarInfo[idd][cLocationz] = 24.3208;
                    CarInfo[idd][cAngle] = 235.1191;
                 }
                 else
                 {
                         if(PlayerInfo[playerid][pmotokey] == 0)
                        {
                            PlayerInfo[playerid][pmotokey] = idd;
                            Update(playerid,pmotokeyx);
                             CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pprcarkey] == 0)
                        {
                            PlayerInfo[playerid][pprcarkey] = idd;
                            Update(playerid,pprcarkeyx);
                             CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                         }
                         else if(PlayerInfo[playerid][pprcarkey2] == 0)
                        {
                            PlayerInfo[playerid][pprcarkey2] = idd;
                            Update(playerid,pprcarkey2x);
                             CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                         }
                        else return SCM(playerid,COLOR_WHITE,"Already own 2 premium cars + 2 cars.");
                }
            }
        }

        Stock[stockid][vStock]--;
        mysql_format(SQL, string, sizeof(string), "UPDATE stock SET Stock='%d' WHERE ID='%d'", Stock[stockid][vStock],stockid);
        mysql_tquery(SQL,string,"","");

        GivePlayerCash(playerid,-value);
        Update(playerid,pCashx);

        CarInfo[idd][cID] = idd;
        CarInfo[idd][cModel] = model;

        CarInfo[idd][cColorOne] = 1;
        CarInfo[idd][cColorTwo] = 1;
        strmid(CarInfo[idd][cOwner], PlayerInfo[playerid][pNormalName], 0, 25, 255);
        strmid(CarInfo[idd][cDescription],namecar, 0, strlen(namecar), 255);
        CarInfo[idd][cValue] = value;
        strmid(CarInfo[idd][cLicense], "NewCar", 0, 6, 255);
        CarInfo[idd][cOwned] = 1;
        CarInfo[idd][cLock] = 0;
        CarInfo[idd][cTimed] = 0;
        CarInfo[idd][cInscarprice] = 100;
        CarInfo[idd][cInsurancecar] = 4;
        CarInfo[idd][cKM] = 0.0;
        CarInfo[idd][cHP] = 1000.0;
        CarInfo[idd][cDamage1] = 0;
        CarInfo[idd][cDamage2] = 0;
        CarInfo[idd][cDamage3] = 0;
        CarInfo[idd][cDamage4] = 0;
        CarInfo[idd][cGas] = 100;
        CarInfo[idd][cSell] = 1;
        CarInfo[idd][cPaintJ] = 6;
        CarInfo[idd][mod1] = 0;
        CarInfo[idd][mod2] = 0;
        CarInfo[idd][mod3] = 0;
        CarInfo[idd][mod4] = 0;
        CarInfo[idd][mod5] = 0;
        CarInfo[idd][mod6] = 0;
        CarInfo[idd][mod7] = 0;
        CarInfo[idd][mod8] = 0;
        CarInfo[idd][mod9] = 0;
        CarInfo[idd][mod10] = 0;
        CarInfo[idd][mod11] = 0;
        CarInfo[idd][mod12] = 0;
        CarInfo[idd][mod13] = 0;
        CarInfo[idd][mod14] = 0;
        CarInfo[idd][mod15] = 0;
        CarInfo[idd][mod16] = 0;
        CarInfo[idd][mod17] = 0;
        CarInfo[idd][cDays] = 0;

        mysql_format(SQL, string, sizeof(string),"INSERT INTO cars (ID, Model) VALUES (%d, %d)",  idd, CarInfo[idd][cModel]);
        mysql_tquery(SQL,string,"","");

        vUpdate(idd, cModsx);
        vUpdate(idd, cPaintJx);
        vUpdate(idd, cSellx);
        vUpdate(idd, cLocationxx);
        vUpdate(idd, cLocationyx);
        vUpdate(idd, cLocationzx);
        vUpdate(idd, cAnglex);
        vUpdate(idd, cColorOnex);
        vUpdate(idd, cColorTwox);
        vUpdate(idd, cOwnerx);
        vUpdate(idd, cValuex);
        vUpdate(idd, cLicensex);
        vUpdate(idd, cDescriptionx);
        vUpdate(idd, cLockx);
        vUpdate(idd, cTimedx);
        vUpdate(idd, cInscarpricex);
        vUpdate(idd, cInsurancecarx);
        vUpdate(idd, cKMx);
        vUpdate(idd, cOwnedx);
        vUpdate(idd, cDaysx);
        vUpdate(idd, cHPx);
        vUpdate(idd, cDamage1x);
        vUpdate(idd, cDamage2x);
        vUpdate(idd, cDamage3x);
        vUpdate(idd, cDamage4x);
        vUpdate(idd, cGasx);

        new car = CreateVehicle(CarInfo[idd][cModel],CarInfo[idd][cLocationx],CarInfo[idd][cLocationy],CarInfo[idd][cLocationz],CarInfo[idd][cAngle],1,1,500000);
        SetVehicleNumberPlate(car,CarInfo[idd][cLicense]);

        new disp[184],stringsss[256],numele[30];
        format(disp,sizeof(disp),"You bought %s.Please take your car and park it elsewhere.",CarInfo[idd][cDescription]);
        SCM(playerid,COLOR_GREEN,disp);
        GetPlayerName(playerid, numele, sizeof(numele));
        format(stringsss,sizeof(stringsss),"%s [user:%d] bought a %s [car:%d] for $%s.",numele,PlayerInfo[playerid][pSQLID],CarInfo[idd][cDescription],CarInfo[idd][cID],FormatNumber(value));
        ABroadCast(COLOR_YELLOW,stringsss,1);
        new var100[256],y,m,d,h,mi,s,string2[256],string3[256];
        getdate(y,m,d);
        gettime(h,mi,s);
        format(string2,sizeof(string2),"[%02d-%02d-%d %02d:%02d:%02d] %s",d,m,y,h,mi,s,stringsss);
        mysql_real_escape_string(string2, string3);
        mysql_format(SQL, var100, sizeof(var100), "INSERT INTO playerlogs (`playerid`,`giverid`,`action`,`time`) VALUES ('%d','0','%s','%02d-%02d-%d %02d:%02d:%02d')", PlayerInfo[playerid][pSQLID],string3,d,m,y,h,mi,s);
        mysql_tquery(SQL,var100,"","");

        OwnedVeh(car) = idd;
        if(idd == PlayerInfo[playerid][pPcarkey])
        {
            personalcar[0][playerid] = car;
        }
        if(idd == PlayerInfo[playerid][pmotokey])
        {
            personalcar[1][playerid] = car;
        }
        if(idd == PlayerInfo[playerid][pprcarkey])
        {
            personalcar[2][playerid] = car;
        }
        if(idd == PlayerInfo[playerid][pprcarkey2])
        {
            personalcar[3][playerid] = car;
        }
        if(idd == PlayerInfo[playerid][pPPluscarkey])
        {
            personalcar[4][playerid] = car;
        }
        if(idd == PlayerInfo[playerid][pPPluscarkey2])
        {
            personalcar[5][playerid] = car;
        }

        masini++;
        SwitchKey[playerid] = 1;
    }
    return 1;
}
 

Link to comment
Share on other sites

  • 0
Acum 7 ore, AndreiB a spus:

CMD:buycar(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(IsPlayerInAnyVehicle(playerid)) return SCM(playerid,COLOR_WHITE,"{FFB870}Please get out of the car.");
    if(IsPlayerInRangeOfPoint(playerid, 7.0, 328.3534,-1513.1687,36.0391))
    {
        if(PlayerInfo[playerid][pLevel] < 3) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}You need to be level 3 to buy a vehicle.");
        BuyCar[playerid] = -1;
        ShowPlayerDialog(playerid,DIALOG_CARBUY, DIALOG_STYLE_LIST, "Buy a car", "Cheap cars\nRegular cars\nExpensive cars\nPremium cars", "Select", "Close");
    }
    else return SCM(playerid,COLOR_WHITE,"{FFB870}You are not the place where you can buy a car.");
      return 1;
}

// type 1 - car | 2 - moto/bike | 3 - heli | 4 - premium cars.
public InsertCar(playerid,type,stockid)
{
    new string[128],sendername[25],namecar[100];
    new idd = Findcar();
    new model = Stock[stockid][vModel];
    new value = Stock[stockid][vPrice];
    strmid(namecar,Stock[stockid][vName], 0, 100, 255);
    GetPlayerName(playerid,sendername,sizeof(sendername));
    BuyCar[playerid] = -1;
    if(idd != 0)
    {
        if(GetPlayerCash(playerid) < value) return SCM(playerid,COLOR_WHITE,"You do not have enough money.");
        if(type == 1)
        {
            if(PlayerInfo[playerid][pPremiumAccount] == 0 && PlayerInfo[playerid][pPlusSlot1] == 0 && PlayerInfo[playerid][pPlusSlot2] == 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 0)
                {
                    PlayerInfo[playerid][pPcarkey] = idd;
                    Update(playerid,pPcarkeyx);
                    CarInfo[idd][cLocationx] = 284.5032;
                    CarInfo[idd][cLocationy] = -1526.4036;
                    CarInfo[idd][cLocationz] = 24.3208;
                    CarInfo[idd][cAngle] = 235.1191;
                }
                else
                {
                        if(PlayerInfo[playerid][pmotokey] == 0)
                        {
                            PlayerInfo[playerid][pmotokey] = idd;
                            Update(playerid,pmotokeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else return SCM(playerid,COLOR_WHITE,"Already own 2 cars.");
                }
            }
            if(PlayerInfo[playerid][pPlusSlot1] == 1 && PlayerInfo[playerid][pPremiumAccount] == 0 && PlayerInfo[playerid][pPlusSlot2] == 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 0)
                {
                    PlayerInfo[playerid][pPcarkey] = idd;
                    Update(playerid,pPcarkeyx);
                    CarInfo[idd][cLocationx] = 284.5032;
                    CarInfo[idd][cLocationy] = -1526.4036;
                    CarInfo[idd][cLocationz] = 24.3208;
                    CarInfo[idd][cAngle] = 235.1191;
                }
                else
                {
                        if(PlayerInfo[playerid][pmotokey] == 0)
                        {
                            PlayerInfo[playerid][pmotokey] = idd;
                            Update(playerid,pmotokeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pPPluscarkey] == 0)
                        {
                            PlayerInfo[playerid][pPPluscarkey] = idd;
                            Update(playerid,pPPluscarkeyx);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else return SCM(playerid,COLOR_WHITE,"Already own 2 cars + 1 plus car.");
                }
            }
            if(PlayerInfo[playerid][pPlusSlot1] == 1 && PlayerInfo[playerid][pPlusSlot2] == 1 && PlayerInfo[playerid][pPremiumAccount] == 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 0)
                {
                    PlayerInfo[playerid][pPcarkey] = idd;
                    Update(playerid,pPcarkeyx);
                    CarInfo[idd][cLocationx] = 284.5032;
                    CarInfo[idd][cLocationy] = -1526.4036;
                    CarInfo[idd][cLocationz] = 24.3208;
                    CarInfo[idd][cAngle] = 235.1191;
                }
                else
                {
                        if(PlayerInfo[playerid][pmotokey] == 0)
                        {
                            PlayerInfo[playerid][pmotokey] = idd;
                            Update(playerid,pmotokeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pPPluscarkey] == 0)
                        {
                            PlayerInfo[playerid][pPPluscarkey] = idd;
                            Update(playerid,pPPluscarkeyx);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pPPluscarkey2] == 0)
                        {
                            PlayerInfo[playerid][pPPluscarkey2] = idd;
                            Update(playerid,pPPluscarkey2x);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else return SCM(playerid,COLOR_WHITE,"Already own 2 cars + 2 plus cars.");
                }
            }
            if(PlayerInfo[playerid][pPlusSlot1] == 1 && PlayerInfo[playerid][pPlusSlot2] == 0 && PlayerInfo[playerid][pPremiumAccount] > 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 0)
                {
                    PlayerInfo[playerid][pPcarkey] = idd;
                    Update(playerid,pPcarkeyx);
                    CarInfo[idd][cLocationx] = 284.5032;
                    CarInfo[idd][cLocationy] = -1526.4036;
                    CarInfo[idd][cLocationz] = 24.3208;
                    CarInfo[idd][cAngle] = 235.1191;
                }
                else
                {
                        if(PlayerInfo[playerid][pmotokey] == 0)
                        {
                            PlayerInfo[playerid][pmotokey] = idd;
                            Update(playerid,pmotokeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pprcarkey] == 0)
                        {
                            PlayerInfo[playerid][pprcarkey] = idd;
                            Update(playerid,pprcarkeyx);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pprcarkey2] == 0)
                        {
                            PlayerInfo[playerid][pprcarkey2] = idd;
                            Update(playerid,pprcarkey2x);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pPPluscarkey] == 0)
                        {
                            PlayerInfo[playerid][pPPluscarkey] = idd;
                            Update(playerid,pPPluscarkeyx);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else return SCM(playerid,COLOR_WHITE,"Already own 2 cars + 2 premium cars + 1 plus car.");
                }
            }
            if(PlayerInfo[playerid][pPlusSlot1] == 1 && PlayerInfo[playerid][pPlusSlot2] == 1 && PlayerInfo[playerid][pPremiumAccount] > 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 0)
                {
                    PlayerInfo[playerid][pPcarkey] = idd;
                    Update(playerid,pPcarkeyx);
                    CarInfo[idd][cLocationx] = 284.5032;
                    CarInfo[idd][cLocationy] = -1526.4036;
                    CarInfo[idd][cLocationz] = 24.3208;
                    CarInfo[idd][cAngle] = 235.1191;
                }
                else
                {
                        if(PlayerInfo[playerid][pmotokey] == 0)
                        {
                            PlayerInfo[playerid][pmotokey] = idd;
                            Update(playerid,pmotokeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pprcarkey] == 0)
                        {
                            PlayerInfo[playerid][pprcarkey] = idd;
                            Update(playerid,pprcarkeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pprcarkey2] == 0)
                        {
                            PlayerInfo[playerid][pprcarkey2] = idd;
                            Update(playerid,pprcarkey2x);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pPPluscarkey] == 0)
                        {
                            PlayerInfo[playerid][pPPluscarkey] = idd;
                            Update(playerid,pPPluscarkeyx);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pPPluscarkey2] == 0)
                        {
                            PlayerInfo[playerid][pPPluscarkey2] = idd;
                            Update(playerid,pPPluscarkey2x);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else return SCM(playerid,COLOR_WHITE,"Already own 2 cars + 2 premium cars + 2 plus cars.");
                }
            }
            if(PlayerInfo[playerid][pPremiumAccount] > 0 && PlayerInfo[playerid][pPlusSlot1] == 0 && PlayerInfo[playerid][pPlusSlot2] == 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 0)
                {
                    PlayerInfo[playerid][pPcarkey] = idd;
                    Update(playerid,pPcarkeyx);
                     CarInfo[idd][cLocationx] = 284.5032;
                    CarInfo[idd][cLocationy] = -1526.4036;
                    CarInfo[idd][cLocationz] = 24.3208;
                    CarInfo[idd][cAngle] = 235.1191;
                 }
                 else
                 {
                         if(PlayerInfo[playerid][pmotokey] == 0)
                        {
                            PlayerInfo[playerid][pmotokey] = idd;
                            Update(playerid,pmotokeyx);
                             CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pprcarkey] == 0)
                        {
                            PlayerInfo[playerid][pprcarkey] = idd;
                            Update(playerid,pprcarkeyx);
                             CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                         }
                         else if(PlayerInfo[playerid][pprcarkey2] == 0)
                        {
                            PlayerInfo[playerid][pprcarkey2] = idd;
                            Update(playerid,pprcarkey2x);
                             CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                         }
                        else return SCM(playerid,COLOR_WHITE,"Already own 2 premium cars + 2 cars.");
                }
            }
        }

        Stock[stockid][vStock]--;
        mysql_format(SQL, string, sizeof(string), "UPDATE stock SET Stock='%d' WHERE ID='%d'", Stock[stockid][vStock],stockid);
        mysql_tquery(SQL,string,"","");

        GivePlayerCash(playerid,-value);
        Update(playerid,pCashx);

        CarInfo[idd][cSell] = 1;
        CarInfo[idd][cID] = idd;
        CarInfo[idd][cModel] = model;

        CarInfo[idd][cColorOne] = 1;
        CarInfo[idd][cColorTwo] = 1;
        strmid(CarInfo[idd][cOwner], PlayerInfo[playerid][pNormalName], 0, 25, 255);
        strmid(CarInfo[idd][cDescription],namecar, 0, strlen(namecar), 255);
        CarInfo[idd][cValue] = value;
        strmid(CarInfo[idd][cLicense], "NewCar", 0, 6, 255);
        CarInfo[idd][cOwned] = 1;
        CarInfo[idd][cLock] = 0;
        CarInfo[idd][cTimed] = 0;
        CarInfo[idd][cInscarprice] = 100;
        CarInfo[idd][cInsurancecar] = 4;
        CarInfo[idd][cKM] = 0.0;
        CarInfo[idd][cHP] = 1000.0;
        CarInfo[idd][cDamage1] = 0;
        CarInfo[idd][cDamage2] = 0;
        CarInfo[idd][cDamage3] = 0;
        CarInfo[idd][cDamage4] = 0;
        CarInfo[idd][cGas] = 100;
        CarInfo[idd][cPaintJ] = 6;
        CarInfo[idd][mod1] = 0;
        CarInfo[idd][mod2] = 0;
        CarInfo[idd][mod3] = 0;
        CarInfo[idd][mod4] = 0;
        CarInfo[idd][mod5] = 0;
        CarInfo[idd][mod6] = 0;
        CarInfo[idd][mod7] = 0;
        CarInfo[idd][mod8] = 0;
        CarInfo[idd][mod9] = 0;
        CarInfo[idd][mod10] = 0;
        CarInfo[idd][mod11] = 0;
        CarInfo[idd][mod12] = 0;
        CarInfo[idd][mod13] = 0;
        CarInfo[idd][mod14] = 0;
        CarInfo[idd][mod15] = 0;
        CarInfo[idd][mod16] = 0;
        CarInfo[idd][mod17] = 0;
        CarInfo[idd][cDays] = 0;

        vUpdate(idd, cModsx);
        vUpdate(idd, cPaintJx);
        vUpdate(idd, cSellx);
        vUpdate(idd, cLocationxx);
        vUpdate(idd, cLocationyx);
        vUpdate(idd, cLocationzx);
        vUpdate(idd, cAnglex);
        vUpdate(idd, cModelx);
        vUpdate(idd, cColorOnex);
        vUpdate(idd, cColorTwox);
        vUpdate(idd, cOwnerx);
        vUpdate(idd, cValuex);
        vUpdate(idd, cLicensex);
        vUpdate(idd, cDescriptionx);
        vUpdate(idd, cLockx);
        vUpdate(idd, cTimedx);
        vUpdate(idd, cInscarpricex);
        vUpdate(idd, cInsurancecarx);
        vUpdate(idd, cKMx);
        vUpdate(idd, cOwnedx);
        vUpdate(idd, cDaysx);
        vUpdate(idd, cHPx);
        vUpdate(idd, cDamage1x);
        vUpdate(idd, cDamage2x);
        vUpdate(idd, cDamage3x);
        vUpdate(idd, cDamage4x);
        vUpdate(idd, cGasx);

        new car = CreateVehicle(CarInfo[idd][cModel],CarInfo[idd][cLocationx],CarInfo[idd][cLocationy],CarInfo[idd][cLocationz],CarInfo[idd][cAngle],1,1,500000);
        SetVehicleNumberPlate(car,CarInfo[idd][cLicense]);

        new disp[184],stringsss[256],numele[30];
        format(disp,sizeof(disp),"You bought %s.Please take your car and park it elsewhere.",CarInfo[idd][cDescription]);
        SCM(playerid,COLOR_GREEN,disp);
        GetPlayerName(playerid, numele, sizeof(numele));
        format(stringsss,sizeof(stringsss),"%s [user:%d] bought a %s [car:%d] for $%s.",numele,PlayerInfo[playerid][pSQLID],CarInfo[idd][cDescription],CarInfo[idd][cID],FormatNumber(value));
        ABroadCast(COLOR_YELLOW,stringsss,1);
        new var100[256],y,m,d,h,mi,s,string2[256],string3[256];
        getdate(y,m,d);
        gettime(h,mi,s);
        format(string2,sizeof(string2),"[%02d-%02d-%d %02d:%02d:%02d] %s",d,m,y,h,mi,s,stringsss);
        mysql_real_escape_string(string2, string3);
        mysql_format(SQL, var100, sizeof(var100), "INSERT INTO playerlogs (`playerid`,`giverid`,`action`,`time`) VALUES ('%d','0','%s','%02d-%02d-%d %02d:%02d:%02d')", PlayerInfo[playerid][pSQLID],string3,d,m,y,h,mi,s);
        mysql_tquery(SQL,var100,"","");

        OwnedVeh(car) = idd;
        if(idd == PlayerInfo[playerid][pPcarkey])
        {
            personalcar[0][playerid] = car;
        }
        if(idd == PlayerInfo[playerid][pmotokey])
        {
            personalcar[1][playerid] = car;
        }
        if(idd == PlayerInfo[playerid][pprcarkey])
        {
            personalcar[2][playerid] = car;
        }
        if(idd == PlayerInfo[playerid][pprcarkey2])
        {
            personalcar[3][playerid] = car;
        }
        if(idd == PlayerInfo[playerid][pPPluscarkey])
        {
            personalcar[4][playerid] = car;
        }
        if(idd == PlayerInfo[playerid][pPPluscarkey2])
        {
            personalcar[5][playerid] = car;
        }
        masini++;
        SwitchKey[playerid] = 1;
    }
    if(idd == 0)
    {
        if(GetPlayerCash(playerid) < value) return SCM(playerid,COLOR_WHITE,"You do not have enough money.");

        new Cache: sar = mysql_query(SQL,"SELECT * FROM `cars`");
        idd = cache_num_rows()+1;
        cache_delete(sar);

        if(type == 1)
        {
            if(PlayerInfo[playerid][pPremiumAccount] == 0 && PlayerInfo[playerid][pPlusSlot1] == 0 && PlayerInfo[playerid][pPlusSlot2] == 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 0)
                {
                    PlayerInfo[playerid][pPcarkey] = idd;
                    Update(playerid,pPcarkeyx);
                    CarInfo[idd][cLocationx] = 284.5032;
                    CarInfo[idd][cLocationy] = -1526.4036;
                    CarInfo[idd][cLocationz] = 24.3208;
                    CarInfo[idd][cAngle] = 235.1191;
                }
                else
                {
                        if(PlayerInfo[playerid][pmotokey] == 0)
                        {
                            PlayerInfo[playerid][pmotokey] = idd;
                            Update(playerid,pmotokeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else return SCM(playerid,COLOR_WHITE,"Already own 2 cars.");
                }
            }
            if(PlayerInfo[playerid][pPlusSlot1] == 1 && PlayerInfo[playerid][pPremiumAccount] == 0 && PlayerInfo[playerid][pPlusSlot2] == 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 0)
                {
                    PlayerInfo[playerid][pPcarkey] = idd;
                    Update(playerid,pPcarkeyx);
                    CarInfo[idd][cLocationx] = 284.5032;
                    CarInfo[idd][cLocationy] = -1526.4036;
                    CarInfo[idd][cLocationz] = 24.3208;
                    CarInfo[idd][cAngle] = 235.1191;
                }
                else
                {
                        if(PlayerInfo[playerid][pmotokey] == 0)
                        {
                            PlayerInfo[playerid][pmotokey] = idd;
                            Update(playerid,pmotokeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pPPluscarkey] == 0)
                        {
                            PlayerInfo[playerid][pPPluscarkey] = idd;
                            Update(playerid,pPPluscarkeyx);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else return SCM(playerid,COLOR_WHITE,"Already own 2 cars + 1 plus car.");
                }
            }
            if(PlayerInfo[playerid][pPlusSlot1] == 1 && PlayerInfo[playerid][pPlusSlot2] == 1 && PlayerInfo[playerid][pPremiumAccount] == 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 0)
                {
                    PlayerInfo[playerid][pPcarkey] = idd;
                    Update(playerid,pPcarkeyx);
                    CarInfo[idd][cLocationx] = 284.5032;
                    CarInfo[idd][cLocationy] = -1526.4036;
                    CarInfo[idd][cLocationz] = 24.3208;
                    CarInfo[idd][cAngle] = 235.1191;
                }
                else
                {
                        if(PlayerInfo[playerid][pmotokey] == 0)
                        {
                            PlayerInfo[playerid][pmotokey] = idd;
                            Update(playerid,pmotokeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pPPluscarkey] == 0)
                        {
                            PlayerInfo[playerid][pPPluscarkey] = idd;
                            Update(playerid,pPPluscarkeyx);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pPPluscarkey2] == 0)
                        {
                            PlayerInfo[playerid][pPPluscarkey2] = idd;
                            Update(playerid,pPPluscarkey2x);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else return SCM(playerid,COLOR_WHITE,"Already own 2 cars + 2 plus cars.");
                }
            }
            if(PlayerInfo[playerid][pPlusSlot1] == 1 && PlayerInfo[playerid][pPlusSlot2] == 0 && PlayerInfo[playerid][pPremiumAccount] > 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 0)
                {
                    PlayerInfo[playerid][pPcarkey] = idd;
                    Update(playerid,pPcarkeyx);
                    CarInfo[idd][cLocationx] = 284.5032;
                    CarInfo[idd][cLocationy] = -1526.4036;
                    CarInfo[idd][cLocationz] = 24.3208;
                    CarInfo[idd][cAngle] = 235.1191;
                }
                else
                {
                        if(PlayerInfo[playerid][pmotokey] == 0)
                        {
                            PlayerInfo[playerid][pmotokey] = idd;
                            Update(playerid,pmotokeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pprcarkey] == 0)
                        {
                            PlayerInfo[playerid][pprcarkey] = idd;
                            Update(playerid,pprcarkeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pprcarkey2] == 0)
                        {
                            PlayerInfo[playerid][pprcarkey2] = idd;
                            Update(playerid,pprcarkey2x);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pPPluscarkey] == 0)
                        {
                            PlayerInfo[playerid][pPPluscarkey] = idd;
                            Update(playerid,pPPluscarkeyx);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else return SCM(playerid,COLOR_WHITE,"Already own 2 cars + 2 premium cars + 1 plus car.");
                }
            }
            if(PlayerInfo[playerid][pPlusSlot1] == 1 && PlayerInfo[playerid][pPlusSlot2] == 1 && PlayerInfo[playerid][pPremiumAccount] > 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 0)
                {
                    PlayerInfo[playerid][pPcarkey] = idd;
                    Update(playerid,pPcarkeyx);
                    CarInfo[idd][cLocationx] = 284.5032;
                    CarInfo[idd][cLocationy] = -1526.4036;
                    CarInfo[idd][cLocationz] = 24.3208;
                    CarInfo[idd][cAngle] = 235.1191;
                }
                else
                {
                        if(PlayerInfo[playerid][pmotokey] == 0)
                        {
                            PlayerInfo[playerid][pmotokey] = idd;
                            Update(playerid,pmotokeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pprcarkey] == 0)
                        {
                            PlayerInfo[playerid][pprcarkey] = idd;
                            Update(playerid,pprcarkeyx);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pprcarkey2] == 0)
                        {
                            PlayerInfo[playerid][pprcarkey2] = idd;
                            Update(playerid,pprcarkey2x);
                              CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pPPluscarkey] == 0)
                        {
                            PlayerInfo[playerid][pPPluscarkey] = idd;
                            Update(playerid,pPPluscarkeyx);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pPPluscarkey2] == 0)
                        {
                            PlayerInfo[playerid][pPPluscarkey2] = idd;
                            Update(playerid,pPPluscarkey2x);
                            CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else return SCM(playerid,COLOR_WHITE,"Already own 2 cars + 2 premium cars + 2 plus cars.");
                }
            }
            if(PlayerInfo[playerid][pPremiumAccount] > 0 && PlayerInfo[playerid][pPlusSlot1] == 0 && PlayerInfo[playerid][pPlusSlot2] == 0)
            {
                if(PlayerInfo[playerid][pPcarkey] == 0)
                {
                    PlayerInfo[playerid][pPcarkey] = idd;
                    Update(playerid,pPcarkeyx);
                     CarInfo[idd][cLocationx] = 284.5032;
                    CarInfo[idd][cLocationy] = -1526.4036;
                    CarInfo[idd][cLocationz] = 24.3208;
                    CarInfo[idd][cAngle] = 235.1191;
                 }
                 else
                 {
                         if(PlayerInfo[playerid][pmotokey] == 0)
                        {
                            PlayerInfo[playerid][pmotokey] = idd;
                            Update(playerid,pmotokeyx);
                             CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                        }
                        else if(PlayerInfo[playerid][pprcarkey] == 0)
                        {
                            PlayerInfo[playerid][pprcarkey] = idd;
                            Update(playerid,pprcarkeyx);
                             CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                         }
                         else if(PlayerInfo[playerid][pprcarkey2] == 0)
                        {
                            PlayerInfo[playerid][pprcarkey2] = idd;
                            Update(playerid,pprcarkey2x);
                             CarInfo[idd][cLocationx] = 284.5032;
                            CarInfo[idd][cLocationy] = -1526.4036;
                            CarInfo[idd][cLocationz] = 24.3208;
                            CarInfo[idd][cAngle] = 235.1191;
                         }
                        else return SCM(playerid,COLOR_WHITE,"Already own 2 premium cars + 2 cars.");
                }
            }
        }

        Stock[stockid][vStock]--;
        mysql_format(SQL, string, sizeof(string), "UPDATE stock SET Stock='%d' WHERE ID='%d'", Stock[stockid][vStock],stockid);
        mysql_tquery(SQL,string,"","");

        GivePlayerCash(playerid,-value);
        Update(playerid,pCashx);

        CarInfo[idd][cID] = idd;
        CarInfo[idd][cModel] = model;

        CarInfo[idd][cColorOne] = 1;
        CarInfo[idd][cColorTwo] = 1;
        strmid(CarInfo[idd][cOwner], PlayerInfo[playerid][pNormalName], 0, 25, 255);
        strmid(CarInfo[idd][cDescription],namecar, 0, strlen(namecar), 255);
        CarInfo[idd][cValue] = value;
        strmid(CarInfo[idd][cLicense], "NewCar", 0, 6, 255);
        CarInfo[idd][cOwned] = 1;
        CarInfo[idd][cLock] = 0;
        CarInfo[idd][cTimed] = 0;
        CarInfo[idd][cInscarprice] = 100;
        CarInfo[idd][cInsurancecar] = 4;
        CarInfo[idd][cKM] = 0.0;
        CarInfo[idd][cHP] = 1000.0;
        CarInfo[idd][cDamage1] = 0;
        CarInfo[idd][cDamage2] = 0;
        CarInfo[idd][cDamage3] = 0;
        CarInfo[idd][cDamage4] = 0;
        CarInfo[idd][cGas] = 100;
        CarInfo[idd][cSell] = 1;
        CarInfo[idd][cPaintJ] = 6;
        CarInfo[idd][mod1] = 0;
        CarInfo[idd][mod2] = 0;
        CarInfo[idd][mod3] = 0;
        CarInfo[idd][mod4] = 0;
        CarInfo[idd][mod5] = 0;
        CarInfo[idd][mod6] = 0;
        CarInfo[idd][mod7] = 0;
        CarInfo[idd][mod8] = 0;
        CarInfo[idd][mod9] = 0;
        CarInfo[idd][mod10] = 0;
        CarInfo[idd][mod11] = 0;
        CarInfo[idd][mod12] = 0;
        CarInfo[idd][mod13] = 0;
        CarInfo[idd][mod14] = 0;
        CarInfo[idd][mod15] = 0;
        CarInfo[idd][mod16] = 0;
        CarInfo[idd][mod17] = 0;
        CarInfo[idd][cDays] = 0;

        mysql_format(SQL, string, sizeof(string),"INSERT INTO cars (ID, Model) VALUES (%d, %d)",  idd, CarInfo[idd][cModel]);
        mysql_tquery(SQL,string,"","");

        vUpdate(idd, cModsx);
        vUpdate(idd, cPaintJx);
        vUpdate(idd, cSellx);
        vUpdate(idd, cLocationxx);
        vUpdate(idd, cLocationyx);
        vUpdate(idd, cLocationzx);
        vUpdate(idd, cAnglex);
        vUpdate(idd, cColorOnex);
        vUpdate(idd, cColorTwox);
        vUpdate(idd, cOwnerx);
        vUpdate(idd, cValuex);
        vUpdate(idd, cLicensex);
        vUpdate(idd, cDescriptionx);
        vUpdate(idd, cLockx);
        vUpdate(idd, cTimedx);
        vUpdate(idd, cInscarpricex);
        vUpdate(idd, cInsurancecarx);
        vUpdate(idd, cKMx);
        vUpdate(idd, cOwnedx);
        vUpdate(idd, cDaysx);
        vUpdate(idd, cHPx);
        vUpdate(idd, cDamage1x);
        vUpdate(idd, cDamage2x);
        vUpdate(idd, cDamage3x);
        vUpdate(idd, cDamage4x);
        vUpdate(idd, cGasx);

        new car = CreateVehicle(CarInfo[idd][cModel],CarInfo[idd][cLocationx],CarInfo[idd][cLocationy],CarInfo[idd][cLocationz],CarInfo[idd][cAngle],1,1,500000);
        SetVehicleNumberPlate(car,CarInfo[idd][cLicense]);

        new disp[184],stringsss[256],numele[30];
        format(disp,sizeof(disp),"You bought %s.Please take your car and park it elsewhere.",CarInfo[idd][cDescription]);
        SCM(playerid,COLOR_GREEN,disp);
        GetPlayerName(playerid, numele, sizeof(numele));
        format(stringsss,sizeof(stringsss),"%s [user:%d] bought a %s [car:%d] for $%s.",numele,PlayerInfo[playerid][pSQLID],CarInfo[idd][cDescription],CarInfo[idd][cID],FormatNumber(value));
        ABroadCast(COLOR_YELLOW,stringsss,1);
        new var100[256],y,m,d,h,mi,s,string2[256],string3[256];
        getdate(y,m,d);
        gettime(h,mi,s);
        format(string2,sizeof(string2),"[%02d-%02d-%d %02d:%02d:%02d] %s",d,m,y,h,mi,s,stringsss);
        mysql_real_escape_string(string2, string3);
        mysql_format(SQL, var100, sizeof(var100), "INSERT INTO playerlogs (`playerid`,`giverid`,`action`,`time`) VALUES ('%d','0','%s','%02d-%02d-%d %02d:%02d:%02d')", PlayerInfo[playerid][pSQLID],string3,d,m,y,h,mi,s);
        mysql_tquery(SQL,var100,"","");

        OwnedVeh(car) = idd;
        if(idd == PlayerInfo[playerid][pPcarkey])
        {
            personalcar[0][playerid] = car;
        }
        if(idd == PlayerInfo[playerid][pmotokey])
        {
            personalcar[1][playerid] = car;
        }
        if(idd == PlayerInfo[playerid][pprcarkey])
        {
            personalcar[2][playerid] = car;
        }
        if(idd == PlayerInfo[playerid][pprcarkey2])
        {
            personalcar[3][playerid] = car;
        }
        if(idd == PlayerInfo[playerid][pPPluscarkey])
        {
            personalcar[4][playerid] = car;
        }
        if(idd == PlayerInfo[playerid][pPPluscarkey2])
        {
            personalcar[5][playerid] = car;
        }

        masini++;
        SwitchKey[playerid] = 1;
    }
    return 1;
}
 

Arata comada /v si si sistemul de incarcare a datelelor jucatorilor din db cand se logheaza.

Link to comment
Share on other sites

  • 0
On 3/16/2018 at 3:10 PM, AndreiB said:

Salut  am o problema la gamemodeul bigzone se suprapune slot 6 cu slotul 5

 la /v sa zicem ca pe slotul 5 am elegy si pe slotul 6 infernus cand ies de pe server si intru i,i arata ca pe slotul 6 am tot elegy dar aveam infernus

Cine ma ajuta ii dau host de sa-mp il platesc eu nici o problema

problema e la pPluscarkey si pPluscarkey2, la spawnarea vehiculelor pe server/tractare, analizeaza sistemul daca tii neaparat sa ramai la gamemode-ul bigzone si vezi unde apare pPluscarkey inloc de pPluscarkey2, personal iti recomand sa refaci sistemul de vehicule personale, acela este unu destul de vechi si ineficient, deoarece intampini multe probleme si la transferul vehiculelor si mai ocupa si pe putin 7000 de linii din gamemode

Link to comment
Share on other sites

  • 0
1 hour ago, Ionut_WS said:

problema e la pPluscarkey si pPluscarkey2, la spawnarea vehiculelor pe server/tractare, analizeaza sistemul daca tii neaparat sa ramai la gamemode-ul bigzone si vezi unde apare pPluscarkey inloc de pPluscarkey2, personal iti recomand sa refaci sistemul de vehicule personale, acela este unu destul de vechi si ineficient, deoarece intampini multe probleme si la transferul vehiculelor si mai ocupa si pe putin 7000 de linii din gamemode

ma poti ajuta pe la ce este

Link to comment
Share on other sites

  • 0
24 minutes ago, Ionut_WS said:

e pe la sistemul de respawnare, cum a zis si @MiritaXD trebuie vazut cum functioneaza sistemul pentru fiecare slot

nu sti un gamemode de inceput gen bigzone fara bug la systemul de vehicule atunci ca nu vreau gamemodeuri gen edison #5 sua burned etc;si nici saints ca nu stiu sa ii schimb versiunea de mysql

Link to comment
Share on other sites

  • 0

@MiritaXD uite functia e pPluscarkey2

stock RespawnPVeh(vid,playerid)
{
    new masinalui,carid;
    if(vid == personalcar[0][playerid])
    {
        DestryVIPNameVehicle(personalcar[0][playerid], playerid);
        vehEngine[personalcar[0][playerid]] = 0;
        DestroyVehicle(personalcar[0][playerid]);
        OwnedVeh(personalcar[0][playerid]) = 0;
        carid = PlayerInfo[playerid][pPcarkey];
        Gas[personalcar[0][playerid]] = CarInfo[carid][cGas];
        masinalui = 1;
    }
    else if(vid == personalcar[1][playerid])
    {
        DestryVIPNameVehicle(personalcar[1][playerid], playerid);
        vehEngine[personalcar[1][playerid]] = 0;
        DestroyVehicle(personalcar[1][playerid]);
        OwnedVeh(personalcar[1][playerid]) = 0;
        carid = PlayerInfo[playerid][pmotokey];
        Gas[personalcar[1][playerid]] = CarInfo[carid][cGas];
        masinalui = 2;
    }
    else if(vid == personalcar[2][playerid])
    {
        DestryVIPNameVehicle(personalcar[2][playerid], playerid);
        vehEngine[personalcar[2][playerid]] = 0;
        DestroyVehicle(personalcar[2][playerid]);
        OwnedVeh(personalcar[2][playerid]) = 0;
        carid = PlayerInfo[playerid][pprcarkey];
        Gas[personalcar[2][playerid]] = CarInfo[carid][cGas];
        masinalui = 3;
    }
    else if(vid == personalcar[3][playerid])
    {
        DestryVIPNameVehicle(personalcar[3][playerid], playerid);
        vehEngine[personalcar[3][playerid]] = 0;
        DestroyVehicle(personalcar[3][playerid]);
        OwnedVeh(personalcar[3][playerid]) = 0;
        carid = PlayerInfo[playerid][pprcarkey2];
        Gas[personalcar[3][playerid]] = CarInfo[carid][cGas];
        masinalui = 4;
    }
    else if(vid == personalcar[4][playerid])
    {
        DestryVIPNameVehicle(personalcar[4][playerid], playerid);
        vehEngine[personalcar[4][playerid]] = 0;
        DestroyVehicle(personalcar[4][playerid]);
        OwnedVeh(personalcar[4][playerid]) = 0;
        carid = PlayerInfo[playerid][pPPluscarkey];
        Gas[personalcar[4][playerid]] = CarInfo[carid][cGas];
        masinalui = 5;
    }
    else if(vid == personalcar[5][playerid])
    {
        DestryVIPNameVehicle(personalcar[5][playerid], playerid);
        vehEngine[personalcar[5][playerid]] = 0;
        DestroyVehicle(personalcar[5][playerid]);
        OwnedVeh(personalcar[5][playerid]) = 0;
        carid = PlayerInfo[playerid][pPPluscarkey2];
        Gas[personalcar[5][playerid]] = CarInfo[carid][cGas];
        masinalui = 6;
    }
    new car = CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz],CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],500000);
    SetVehicleNumberPlate(car, CarInfo[carid][cLicense]);
    SetVehicleHealth(car, CarInfo[carid][cHP]);
    UpdateVehicleDamageStatus(car, CarInfo[carid][cDamage1], CarInfo[carid][cDamage2], CarInfo[carid][cDamage3], CarInfo[carid][cDamage4]);
    new engine,lights,alarm,doors,bonnet,boot,objective;
    if(CarInfo[carid][cLock] == 1)
    {
        GetVehicleParamsEx(car,engine,lights,alarm,doors,bonnet,boot,objective);
        SetVehicleParamsEx(car,engine,lights,alarm,1,bonnet,boot,objective);
    }
    if(CarInfo[carid][cLock] == 0)
    {
        GetVehicleParamsEx(car,engine,lights,alarm,doors,bonnet,boot,objective);
        SetVehicleParamsEx(car,engine,lights,alarm,0,bonnet,boot,objective);
    }
    OwnedVeh(car) = carid;
    if(masinalui == 1)
        personalcar[0][playerid] = car;
    if(masinalui == 2)
        personalcar[1][playerid] = car;
    if(masinalui == 3)
        personalcar[2][playerid] = car;
    if(masinalui == 4)
        personalcar[3][playerid] = car;
    if(masinalui == 5)
        personalcar[4][playerid] = car;
    if(masinalui == 6)
        personalcar[5][playerid] = car;
    SwitchKey[playerid] = 1;
    ModVehicle(car);
    return 1;
}
    

Link to comment
Share on other sites

  • 0
4 minutes ago, AndreiB said:

nu sti un gamemode de inceput gen bigzone fara bug la systemul de vehicule atunci ca nu vreau gamemodeuri gen edison #5 sua burned etc;si nici saints ca nu stiu sa ii schimb versiunea de mysql

Gamemode-ul lui Droom e bunicel la sisteme, tot ce ar trebuii sa faci e sa modifici coordonate, spawn-uri, textdraw-uri e destul de bun gm-ul, ti  l-as fi recomandat pe al meu, wster, dar e destul de vechi

Link to comment
Share on other sites

  • 0
9 minutes ago, Ionut_WS said:

Gamemode-ul lui Droom e bunicel la sisteme, tot ce ar trebuii sa faci e sa modifici coordonate, spawn-uri, textdraw-uri e destul de bun gm-ul, ti  l-as fi recomandat pe al meu, wster, dar e destul de vechi

nu are problema la dealesrship sa se buguieasca?

Link to comment
Share on other sites

  • 0
10 minutes ago, Ionut_WS said:

Gamemode-ul lui Droom e bunicel la sisteme, tot ce ar trebuii sa faci e sa modifici coordonate, spawn-uri, textdraw-uri e destul de bun gm-ul, ti  l-as fi recomandat pe al meu, wster, dar e destul de vechi

sau gamemode-ul tau are bug la systemul de vehicule

Link to comment
Share on other sites

  • 0
Just now, Ionut_WS said:

nici al meu, nici a lui droom nu are, insa iti recomand gamemode-ul lui droom pentru ca este gandit mult mai bine sistemul de vehicule

@Ionut_WS

Gamemode-ul lui droom imi da asta  in crashinfo si se inchide samp-server.exe


--------------------------
SA-MP Server: 0.3.7-R2

Exception At Address: 0x75EDC42D Module: (Unknown)

Registers:
EAX: 0x0018EB7C    EBX: 0x0024F128    ECX: 0x00000003    EDX: 0x00000000
ESI: 0x6FD94938    EDI: 0x0018EC20    EBP: 0x0018EBCC    ESP: 0x0018EB7C
EFLAGS: 0x00000202

Stack:
+0000: 0xE06D7363   0x00000001   0x00000000   0x75EDC42D
+0010: 0x00000003   0x19930520   0x0018EC20   0x6FD94938
+0020: 0x0018EC70   0x0018EC70   0x0018EC20   0x0024F128
+0030: 0x0018EBDC   0x6FD68FCE   0x0018EC84   0x08D6CB75
+0040: 0x0018EC70   0x0018EC20   0x0024F128   0x00000000
+0050: 0x0018EC0C   0x6FB29339   0xE06D7363   0x00000001
+0060: 0x00000003   0x0018EC00   0x6A570B40   0x56883AC0
+0070: 0xE06D7363   0x00000001   0x00000000   0x00000000
+0080: 0x00000003   0x19930520   0x0018EC20   0x6FD94938
+0090: 0x0018ECC0   0x6FD68595   0x0018EC20   0x6FD94938
+00A0: 0x08D6CC8D   0x6FD8C8DC   0x6A1B0E28   0xFFFF0001
+00B0: 0x0000000B   0x6FD9795C   0x0018EA00   0x6FD87360
+00C0: 0x2F8C95C8   0x00000001   0x00000000   0x0000000F
+00D0: 0x6FD8C8E8   0x00000000   0x00000000   0x00000000
+00E0: 0xFFFFFFFF   0x6FD8CE80   0x00000000   0x6FD8C8F0
+00F0: 0x0018ECE0   0x6FD8C8C8   0x6A1B0E00   0x6A1B0D01
+0100: 0x0000000B   0x6FD9795C   0x6FD97900   0x0018ECE0
+0110: 0x0018EC9C   0x6FBADD4E   0x00000000   0x0000000F
+0120: 0x6FD8C8D4   0x00000000   0x00000000   0x00000000
+0130: 0xFFFFFFFF   0x0024F128   0x0018ED10   0x6FD892F8

--------------------------

Loaded Modules:
-FailedCreate-

--------------------------
SA-MP Server: 0.3.7-R2

Exception At Address: 0x75EDC42D Module: (Unknown)

Registers:
EAX: 0x0018EB7C    EBX: 0x0066F128    ECX: 0x00000003    EDX: 0x00000000
ESI: 0x6FBF4938    EDI: 0x0018EC20    EBP: 0x0018EBCC    ESP: 0x0018EB7C
EFLAGS: 0x00000202

Stack:
+0000: 0xE06D7363   0x00000001   0x00000000   0x75EDC42D
+0010: 0x00000003   0x19930520   0x0018EC20   0x6FBF4938
+0020: 0x0018EC70   0x0018EC70   0x0018EC20   0x0066F128
+0030: 0x0018EBDC   0x6FBC8FCE   0x0018EC84   0x1D96EC9C
+0040: 0x0018EC70   0x0018EC20   0x0066F128   0x00000000
+0050: 0x0018EC0C   0x6FAE9339   0xE06D7363   0x00000001
+0060: 0x00000003   0x0018EC00   0x69E9C0A0   0x57DEF080
+0070: 0xE06D7363   0x00000001   0x00000000   0x00000000
+0080: 0x00000003   0x19930520   0x0018EC20   0x6FBF4938
+0090: 0x0018ECC0   0x6FBC8595   0x0018EC20   0x6FBF4938
+00A0: 0x1D96EB64   0x6FBEC8DC   0x69E48EE8   0xFFFF0001
+00B0: 0x0000000B   0x6FBF795C   0x0018EA00   0x6FBE7360
+00C0: 0x307AA518   0x00000001   0x00000000   0x0000000F
+00D0: 0x6FBEC8E8   0x00000000   0x00000000   0x00000000
+00E0: 0xFFFFFFFF   0x6FBECE80   0x00000000   0x6FBEC8F0
+00F0: 0x0018ECE0   0x6FBEC8C8   0x69E48EC0   0x69E48E01
+0100: 0x0000000B   0x6FBF795C   0x6FBF7900   0x0018ECE0
+0110: 0x0018EC9C   0x6FB6DD4E   0x00000000   0x0000000F
+0120: 0x6FBEC8D4   0x00000000   0x00000000   0x00000000
+0130: 0xFFFFFFFF   0x0066F128   0x0018ED10   0x6FBE92F8

--------------------------

Loaded Modules:
-FailedCreate-
 

SI SERVER log


----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3.7-R2, (C)2005-2015 SA-MP Team

[15:50:11] filterscripts = ""  (string)
[15:50:11] 
[15:50:11] Server Plugins
[15:50:11] --------------
[15:50:11]  Loading plugin: mysql
[15:50:12]  >> plugin.mysql: R39-3 successfully loaded.
[15:50:12]   Loaded.
[15:50:12]  Loading plugin: sscanf
[15:50:12] 

[15:50:12]  ===============================

[15:50:12]       sscanf plugin loaded.     

[15:50:12]          Version:  2.8.1        

[15:50:12]    (c) 2012 Alex "Y_Less" Cole  

[15:50:12]  ===============================

[15:50:12]   Loaded.
[15:50:12]  Loading plugin: streamer
[15:50:12] 

*** Streamer Plugin v2.9.1 by Incognito loaded ***

[15:50:12]   Loaded.
[15:50:12]  Loaded 3 plugins.

[15:50:12] 
[15:50:12] Ban list
[15:50:12] --------
[15:50:12]  Loaded: samp.ban
[15:50:12] 
[15:50:12] 
[15:50:12] Filterscripts
[15:50:12] ---------------
[15:50:12]   Loaded 0 filterscripts.

[15:50:12] ---------- SERVER START ----------
[15:50:12] [debug] OnGameModeInit()

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3.7-R2, (C)2005-2015 SA-MP Team

[15:50:38] filterscripts = ""  (string)
[15:50:38] 
[15:50:38] Server Plugins
[15:50:38] --------------
[15:50:38]  Loading plugin: mysql
[15:50:38]  >> plugin.mysql: R39-3 successfully loaded.
[15:50:38]   Loaded.
[15:50:38]  Loading plugin: sscanf
[15:50:38] 

[15:50:38]  ===============================

[15:50:38]       sscanf plugin loaded.     

[15:50:38]          Version:  2.8.1        

[15:50:38]    (c) 2012 Alex "Y_Less" Cole  

[15:50:38]  ===============================

[15:50:38]   Loaded.
[15:50:38]  Loading plugin: streamer
[15:50:38] 

*** Streamer Plugin v2.9.1 by Incognito loaded ***

[15:50:38]   Loaded.
[15:50:38]  Loaded 3 plugins.

[15:50:38] 
[15:50:38] Ban list
[15:50:38] --------
[15:50:38]  Loaded: samp.ban
[15:50:38] 
[15:50:38] 
[15:50:38] Filterscripts
[15:50:38] ---------------
[15:50:38]   Loaded 0 filterscripts.

[15:50:38] ---------- SERVER START ----------
[15:50:38] [debug] OnGameModeInit()
 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.