SERVER: unknown command. /BuyVehicle
#1

Код:
if(strcmp(cmd, "/buyvehicle", true) == 0)
{
	if(PlayerToPoint(10.0, playerid, 2131.885986,-1150.619750,24.138172))
	{
	    IWantCar[playerid] = 0;  PriceCar[playerid] = 0;
		if(PlayerInfo[playerid][pLevel] < 5)
		{
    		SendClientMessage(playerid, COLOR_RED, "You need to be level 5 to buy a car.");
          	return 1;
		}
		if(PINFO[playerid][pCar] != 0 && PINFO[playerid][pCar_2] != 0) return SCM(playerid,COLOR_ALI,"You already have 2 vehicles.");
		new pDialog[3000];
		strcat(pDialog, "                            {FFFFFF}** Welcome to the Light Life Dealer Shop, see cars & carids **{A9C4E4}\n__________________________________________________________________________________________\n", sizeof(pDialog));
		strcat(pDialog, "|(1)Bike[$1,000]\t|| (25)Oceanic[$29,000]\t|| (49)Freeway[$239,000]\t|| (73)Flash[$630,000]\n", sizeof(pDialog));
		strcat(pDialog, "|(2)BMX[$1,000]\t|| (26)Majestic[$32,000]\t|| (50)Merit[$240,000]\t|| (74)Jetmax[$630,000]\n", sizeof(pDialog));
		strcat(pDialog, "|(3)Mountain Bike[$2,000]\t|| (27)Hermes[$34,000]\t|| (51)Sanchez[$250,000]\t|| (75)FCR-900[$631,000]\n", sizeof(pDialog));
		strcat(pDialog, "|(4)Faggio[$3,000]\t|| (28)Greenwood[$36,000]\t|| (52)Speeder[$260,000]\t|| (76)Hotknife[$640,000]\n", sizeof(pDialog));
		strcat(pDialog, "|(5)Perenniel[$6,000]\t|| (29)Buccaneer[$42,000]\t|| (53)Tornado[$275,000]\t|| (77)ZR-350[$680,000]\n", sizeof(pDialog));
		strcat(pDialog, "|(6)Pony[$7,000]\t|| (30)Virgo[$43,000]\t|| (54)Elegant[$281,000]\t|| (78)Savanna[$695,000]\n", sizeof(pDialog));
		strcat(pDialog, "|(7)Cadrona[$8,000]\t|| (31)Blista Compact[$51,000]\t|| (55)Premier[$310,000]\t|| (79)Super GT[$750,000]\n", sizeof(pDialog));
		strcat(pDialog, "|(8)Manana[$9,000]\t|| (32)Regina[$58,000]\t|| (56)PCJ-600[$326,000]\t|| (80)Maverick[$755,000]\n", sizeof(pDialog));
		strcat(pDialog, "|(9)Moonbeam[$10,000]\t|| (33)Fortune[$78,000]\t|| (57)Club[$345,000]\t|| (81)Sandking[$768,000]\n", sizeof(pDialog));
		strcat(pDialog, "|(10)Tampa[$11,000]\t||(34)Quad[$83,000]\t||(58)Alpha[$368,000]\t|| (82)Buffalo[$780,000]\n", sizeof(pDialog));
		strcat(pDialog, "|(11)Bbobcat[$12,000]\t||(35)Hustler[$84,000]\t||(59)Sabre[$385,000]\t|| (83)Jester[$785,000]\n", sizeof(pDialog));
		strcat(pDialog, "|(12)Bravura[$13,000]\t|| (36)Admiral[$90,000]\t|| (60)Euros[$399,000]\t|| (84)Comet[$799,000] \n", sizeof(pDialog));
		strcat(pDialog, "|(13)Sadler[$14,000]\t|| (37)Voodoo[$90,000]\t|| (61)Stafford[$410,000]\t|| (85)Sultan[$830,000]\n", sizeof(pDialog));
		strcat(pDialog, "|(14)Previon[$17,000]\t|| (38)Willard[$114,000]\t|| (62)Sparrow[$420,000]\t|| (86)Elegy[$840,000]\n", sizeof(pDialog));
		strcat(pDialog, "|(15)Clover[$18,000]\t|| (39)Vincent[$133,000]\t|| (63)Tropic[$455,000]\t|| (87)cheetah[$860,000]\n", sizeof(pDialog));
		strcat(pDialog, "|(16)Primo[$19,000]\t|| (40)Mesa[$146,000]\t|| (64)Windsor[$475,000]\t|| (88)Turismo[$910,000]\n", sizeof(pDialog));
		strcat(pDialog, "|(17)Landstalker[$21,000]\t|| (41)Phoenix[$180,000]\t|| (65)Huntley[$512,000]\t|| (89)NRG-500[$940,000]\n", sizeof(pDialog));
		strcat(pDialog, "|(18)Sunrise[$22,000]\t|| (42)Intruder[$184,000]\t|| (66)Uranus[$530,000]\t|| (90)Banshee[$950,000]\n", sizeof(pDialog));
		strcat(pDialog, "|(19)Glendale[$23,000]\t|| (43)Solair[$187,000]\t|| (67)Remington[$530,000]\t|| (91)Bullet[$1,115,000]\n", sizeof(pDialog));
		strcat(pDialog, "|(20)BF Injection[$25,000]\t|| (44)Tahoma[$194,000]\t|| (68)Squallo[$540,000]\t|| (92)Infernus[$1,600,000]\n", sizeof(pDialog));
		strcat(pDialog, "|(21)Stallion[$25,000]\t|| (45)Sentinel[$200,000]\t|| (69)Feltzer[$562,000]\t|| \n", sizeof(pDialog));
		strcat(pDialog, "|(22)Nebula[$26,000]\t|| (46)BF-400[$205,000]\t|| (70)Slamvan[$596,000]\t|| \n", sizeof(pDialog));
		strcat(pDialog, "|(23)Dinghy[$27,000]\t|| (47)Washington[$230,000]\t|| (71)Blade[$615,000]\t|| \n", sizeof(pDialog));
		strcat(pDialog, "|(24)Esperanto[$29,000]\t|| (48)Rancher[$235,000]\t|| (72)Broadway[$625,000]\t|| \n", sizeof(pDialog));
		strcat(pDialog, "|________________________________________________________________________________________", sizeof(pDialog));
		ShowPlayerDialog(playerid, 1666, DIALOG_STYLE_MSGBOX, "List Of Available Vehicles", pDialog, "Forward", "Cancel");
		return 1;
	}
	else
	{
		SendClientMessage(playerid, COLOR_RED, "You are not at the Dealership");
		return 1;
	}
}
And
Код:
if(dialogid == 1666 && response == 1) // Dealership main
    {
        ShowPlayerDialog(playerid, 1667, DIALOG_STYLE_INPUT,"Dealership","Insert a Vehicle ID To Buy","Choose","Close");
        return 1;
    }
Код:
if(dialogid == 1667 && response == 1)
    {
        new VehModKharid;
        switch(strval(inputtext))
        {
            case 1: { IWantCar[playerid] = 509; PriceCar[playerid] = 1000; } // bike
            case 2: { IWantCar[playerid] = 481; PriceCar[playerid] = 1000; }
            case 3: { IWantCar[playerid] = 510; PriceCar[playerid] = 2000; }
            case 4: { IWantCar[playerid] = 462; PriceCar[playerid] = 3000; }
            case 5: { IWantCar[playerid] = 404; PriceCar[playerid] = 6000; }
            case 6: { IWantCar[playerid] = 413; PriceCar[playerid] = 7000; }
            case 7: { IWantCar[playerid] = 527; PriceCar[playerid] = 8000; }
            case 8: { IWantCar[playerid] = 410; PriceCar[playerid] = 9000; }
            case 9: { IWantCar[playerid] = 418; PriceCar[playerid] = 1000; }
            case 10: { IWantCar[playerid] = 549; PriceCar[playerid] = 11000; }
            case 11: { IWantCar[playerid] = 422; PriceCar[playerid] = 12000; }
            case 12: { IWantCar[playerid] = 401; PriceCar[playerid] = 13000; }
            case 13: { IWantCar[playerid] = 543; PriceCar[playerid] = 14000; }
            case 14: { IWantCar[playerid] = 436; PriceCar[playerid] = 17000; }
            case 15: { IWantCar[playerid] = 542; PriceCar[playerid] = 18000; }
            case 16: { IWantCar[playerid] = 547; PriceCar[playerid] = 19000; }
            case 17: { IWantCar[playerid] = 400; PriceCar[playerid] = 21000; }
            case 18: { IWantCar[playerid] = 550; PriceCar[playerid] = 22000; }
            case 19: { IWantCar[playerid] = 466; PriceCar[playerid] = 23000; }
            case 20: { IWantCar[playerid] = 424; PriceCar[playerid] = 25000; }
            case 21: { IWantCar[playerid] = 439; PriceCar[playerid] = 25000; }
            case 22: { IWantCar[playerid] = 516; PriceCar[playerid] = 26000; }
            case 23: { IWantCar[playerid] = 473; PriceCar[playerid] = 27000; VehModKharid = 1; }
            case 24: { IWantCar[playerid] = 419; PriceCar[playerid] = 29000; }
            case 25: { IWantCar[playerid] = 467; PriceCar[playerid] = 29000; }
            case 26: { IWantCar[playerid] = 517; PriceCar[playerid] = 32000; }
            case 27: { IWantCar[playerid] = 474; PriceCar[playerid] = 34000; }
            case 28: { IWantCar[playerid] = 492; PriceCar[playerid] = 36000; }
            case 29: { IWantCar[playerid] = 518; PriceCar[playerid] = 42000; }
            case 30: { IWantCar[playerid] = 491; PriceCar[playerid] = 43000; }
            case 31: { IWantCar[playerid] = 496; PriceCar[playerid] = 51000; }
            case 32: { IWantCar[playerid] = 479; PriceCar[playerid] = 58000; }
            case 33: { IWantCar[playerid] = 526; PriceCar[playerid] = 78000; }
            case 34: { IWantCar[playerid] = 471; PriceCar[playerid] = 83000; }
            case 35: { IWantCar[playerid] = 545; PriceCar[playerid] = 84000; }
            case 36: { IWantCar[playerid] = 445; PriceCar[playerid] = 90000; }
            case 37: { IWantCar[playerid] = 412; PriceCar[playerid] = 90000; }
            case 38: { IWantCar[playerid] = 529; PriceCar[playerid] = 114000; }
            case 39: { IWantCar[playerid] = 540; PriceCar[playerid] = 133000; }
            case 40: { IWantCar[playerid] = 500; PriceCar[playerid] = 146000; }
            case 41: { IWantCar[playerid] = 603; PriceCar[playerid] = 180000; }
            case 42: { IWantCar[playerid] = 546; PriceCar[playerid] = 184000; }
            case 43: { IWantCar[playerid] = 458; PriceCar[playerid] = 187000; }
            case 44: { IWantCar[playerid] = 566; PriceCar[playerid] = 194000; }
            case 45: { IWantCar[playerid] = 405; PriceCar[playerid] = 200000; }
            case 46: { IWantCar[playerid] = 581; PriceCar[playerid] = 205000; }
            case 47: { IWantCar[playerid] = 421; PriceCar[playerid] = 230000; }
            case 48: { IWantCar[playerid] = 489; PriceCar[playerid] = 235000; }
            case 49: { IWantCar[playerid] = 463; PriceCar[playerid] = 239000; }
            case 50: { IWantCar[playerid] = 551; PriceCar[playerid] = 240000; }
            case 51: { IWantCar[playerid] = 468; PriceCar[playerid] = 250000; }
            case 52: { IWantCar[playerid] = 452; PriceCar[playerid] = 260000; VehModKharid = 1; }
            case 53: { IWantCar[playerid] = 576; PriceCar[playerid] = 275000; }
            case 54: { IWantCar[playerid] = 507; PriceCar[playerid] = 281000; }
            case 55: { IWantCar[playerid] = 426; PriceCar[playerid] = 310000; }
            case 56: { IWantCar[playerid] = 461; PriceCar[playerid] = 326000; }
            case 57: { IWantCar[playerid] = 589; PriceCar[playerid] = 345000; }
            case 58: { IWantCar[playerid] = 602; PriceCar[playerid] = 368000; }
            case 59: { IWantCar[playerid] = 475; PriceCar[playerid] = 385000; }
            case 60: { IWantCar[playerid] = 587; PriceCar[playerid] = 399000; }
            case 61: { IWantCar[playerid] = 580; PriceCar[playerid] = 410000; }
            case 62: { IWantCar[playerid] = 469; PriceCar[playerid] = 420000; VehModKharid = 2; }
            case 63: { IWantCar[playerid] = 454; PriceCar[playerid] = 455000; VehModKharid = 1; }
            case 64: { IWantCar[playerid] = 555; PriceCar[playerid] = 475000; }
            case 65: { IWantCar[playerid] = 579; PriceCar[playerid] = 512000; }
            case 66: { IWantCar[playerid] = 558; PriceCar[playerid] = 530000; }
            case 67: { IWantCar[playerid] = 534; PriceCar[playerid] = 530000; }
            case 68: { IWantCar[playerid] = 446; PriceCar[playerid] = 540000; VehModKharid = 1; }
            case 69: { IWantCar[playerid] = 533; PriceCar[playerid] = 562000; }
            case 70: { IWantCar[playerid] = 535; PriceCar[playerid] = 596000; }
            case 71: { IWantCar[playerid] = 536; PriceCar[playerid] = 615000; }
            case 72: { IWantCar[playerid] = 575; PriceCar[playerid] = 625000; }
            case 73: { IWantCar[playerid] = 565; PriceCar[playerid] = 630000; }
            case 74: { IWantCar[playerid] = 493; PriceCar[playerid] = 630000; VehModKharid = 1; }
            case 75: { IWantCar[playerid] = 521; PriceCar[playerid] = 631000; }
            case 76: { IWantCar[playerid] = 434; PriceCar[playerid] = 640000; }
            case 77: { IWantCar[playerid] = 477; PriceCar[playerid] = 680000; }
            case 78: { IWantCar[playerid] = 567; PriceCar[playerid] = 695000; }
            case 79: { IWantCar[playerid] = 506; PriceCar[playerid] = 750000; }
            case 80: { IWantCar[playerid] = 487; PriceCar[playerid] = 755000; VehModKharid = 2; }
            case 81: { IWantCar[playerid] = 495; PriceCar[playerid] = 768000; }
            case 82: { IWantCar[playerid] = 402; PriceCar[playerid] = 780000; }
            case 83: { IWantCar[playerid] = 559; PriceCar[playerid] = 785000; }
            case 84: { IWantCar[playerid] = 480; PriceCar[playerid] = 799000; }
            case 85: { IWantCar[playerid] = 560; PriceCar[playerid] = 830000; }
            case 86: { IWantCar[playerid] = 562; PriceCar[playerid] = 840000; }
            case 87: { IWantCar[playerid] = 415; PriceCar[playerid] = 860000; }
            case 88: { IWantCar[playerid] = 451; PriceCar[playerid] = 910000; }
            case 89: { IWantCar[playerid] = 522; PriceCar[playerid] = 940000; }
            case 90: { IWantCar[playerid] = 429; PriceCar[playerid] = 950000; }
            case 91: { IWantCar[playerid] = 541; PriceCar[playerid] = 1115000; }
            case 92: { IWantCar[playerid] = 411; PriceCar[playerid] = 1250000; }
            default: { ShowPlayerDialog(playerid, 1667, DIALOG_STYLE_INPUT,"Dealership","{FF0000}Worng Id\n{FFFFFF}Insert a Vehicle ID To Buy","Choose","Close"); return 1; }
        }
        new want = IWantCar[playerid];
        if(want == 411 || want == 402 || want == 415 || want == 429 || want == 475 || want == 477 || want == 496 || want == 506 || want == 541)
        {
            if(PINFO[playerid][pPremiumAccount] <= 0)
            {
                new rouuz[256];
                new vehk = IWantCar[playerid] - 400;
                format(rouuz,256,"DealerShip: You can't buy a %s because you haven't a Premium account,",aVehicleNames[vehk]);
                SCM(playerid,COLOR_ALI,rouuz);
                SCM(playerid,COLOR_ROUZ,"DealerShip: if you want to have a Premium account, see Light Life iran forum(/forum).");
                IWantCar[playerid] = 0;
                PriceCar[playerid] = 0;
                return 1;
            }
        }
        if(want == 558 || want == 559 || want == 565 || want == 587 || want == 589 || want == 602 || want == 603)
        {
            if(PINFO[playerid][pPremiumAccount] <= 0)
            {
                new rouuz[256];
                new vehk = IWantCar[playerid] - 400;
                format(rouuz,256,"DealerShip: You can't buy a %s because you haven't a Premium account,",aVehicleNames[vehk]);
                SCM(playerid,COLOR_ALI,rouuz);
                SCM(playerid,COLOR_ROUZ,"DealerShip: if you want to have a Premium account, see Light Life iran Forum (Forum.Lightlifeiran.iR.");
                IWantCar[playerid] = 0;
                PriceCar[playerid] = 0;
                return 1;
            }
        }
        new price = PriceCar[playerid];
        if(GetPlayerPool(playerid) >= price)
        {
            if((PlayerInfo[playerid][pCar] == 0 && PINFO[playerid][pCar_2] == 0) || (PINFO[playerid][pCar] == 0 && PINFO[playerid][pCar_2] != 0))
            {
                new car = IWantCar[playerid];
                new carid;
                if(VehModKharid == 0) carid = CreateVehicle(car, 294.4691, -1540.4004, 24.2438, 54.5325, 1, 1,-1);
                else if(VehModKharid == 1) carid = CreateVehicle(car, 727.059692, -1529.186889, 0.101168, 180.0, 1, 1,-1);
                else if(VehModKharid == 2) carid = CreateVehicle(car, 1520.529541, -2464.192871, 13.760436, 180.0, 1, 1,-1);
                new sendername[MAX_PLAYER_NAME];
                PlayerInfo[playerid][pCar] = carid;
                SaveKonVal(playerid, "pCar", carid);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                GivePlayerPool(playerid, -price);
                OwnedMashin[carid] = 1;
                MashinOwner[carid] = playerid;
                if(VehModKharid == 0)
                {
                    PlayerInfo[playerid][cLocationx] = 294.4691;
                    SaveKonFloat(playerid, "cLocationx", 294.4691);
                    PlayerInfo[playerid][cLocationy] = -1540.4004;
                    SaveKonFloat(playerid, "cLocationy", -1540.4004);
                    PlayerInfo[playerid][cLocationz] = 24.2438;
                    SaveKonFloat(playerid, "cLocationz", 24.2438);
                    PlayerInfo[playerid][cAngle] = 54.5325;
                    SaveKonFloat(playerid, "cAngle", 54.5325);
                }
                else if(VehModKharid == 1)
                {
                    PlayerInfo[playerid][cLocationx] = 727.059692;
                    SaveKonFloat(playerid, "cLocationx", 727.059692);
                    PlayerInfo[playerid][cLocationy] = -1529.186889;
                    SaveKonFloat(playerid, "cLocationy", -1529.186889);
                    PlayerInfo[playerid][cLocationz] = 0.101168;
                    SaveKonFloat(playerid, "cLocationz", 0.101168);
                    PlayerInfo[playerid][cAngle] = 180;
                    SaveKonFloat(playerid, "cAngle", 180);
                }
                else if(VehModKharid == 2)
                {
                    PlayerInfo[playerid][cLocationx] = 1520.529541;
                    SaveKonFloat(playerid, "cLocationx", 1520.529541);
                    PlayerInfo[playerid][cLocationy] = -2464.192871;
                    SaveKonFloat(playerid, "cLocationy", -2464.192871);
                    PlayerInfo[playerid][cLocationz] = 13.760436;
                    SaveKonFloat(playerid, "cLocationz", 13.760436);
                    PlayerInfo[playerid][cAngle] = 180;
                    SaveKonFloat(playerid, "cAngle", 180);
                }
                PlayerInfo[playerid][cColor1] = 1;
                SaveKonVal(playerid, "cColor1", 1);
                PlayerInfo[playerid][cColor2] = 1;
                SaveKonVal(playerid, "cColor2", 1);
                PlayerInfo[playerid][cModel] = car;
                SaveKonVal(playerid, "cModel", car);
                PlayerInfo[playerid][cPrice] = PriceCar[playerid];
                SaveKonVal(playerid, "cPrice", PriceCar[playerid]);
                new string[256];
                format(string, sizeof(string), "NewVeh");
                strmid(PlayerInfo[playerid][cPlate], string, 0, strlen(string), 255);
                SaveKonStr(playerid, "cPlate", PINFO[playerid][cPlate]);
                SetVehicleNumberPlate(carid,"NewVeh");
                PlayerInfo[playerid][cLock] = 1;
                SaveKonVal(playerid, "cLock", 1);
                PlayerInfo[playerid][cDestroyed] = 0;
                SaveKonVal(playerid, "cDestroyed", 0);
                PlayerInfo[playerid][cFixed] = 1;
                SaveKonVal(playerid, "cFixed", 1);
                PlayerInfo[playerid][cInsurance] = DefaultInsurance;
                SaveKonVal(playerid, "cInsurance", DefaultInsurance);
                PlayerInfo[playerid][cFuel] = 100;
                SaveKonVal(playerid, "cFuel", 100);
                PlayerInfo[playerid][cHealth] = 1000.0;
                SaveKonFloat(playerid, "cHealth", 1000);
                PINFO[playerid][gLocationX] = 0;
                SaveKonFloat(playerid, "gLocationX", 0);
                PINFO[playerid][gLocationY] = 0;
                SaveKonFloat(playerid, "gLocationY", 0);
                PINFO[playerid][gLocationZ] = 0;
                SaveKonFloat(playerid, "gLocationZ", 0);
                PINFO[playerid][gAngle] = 0;
                SaveKonFloat(playerid, "gAngle", 0);
                PINFO[playerid][gParked] = 0;
                SaveKonVal(playerid, "gParked", 0);
                PlayerInfo[playerid][cMod1] = 0;
                SaveKonVal(playerid, "cMod1", 0);
                PlayerInfo[playerid][cMod3] = 0;
                SaveKonVal(playerid, "cMod3", 0);
                PlayerInfo[playerid][cMod4] = 0;
                SaveKonVal(playerid, "cMod4", 0);
                PlayerInfo[playerid][cMod5] = 0;
                SaveKonVal(playerid, "cMod5", 0);
                PlayerInfo[playerid][cMod6] = 0;
                SaveKonVal(playerid, "cMod6", 0);
                PlayerInfo[playerid][cMod7] = 0;
                SaveKonVal(playerid, "cMod7", 0);
                PlayerInfo[playerid][cMod8] = 0;
                SaveKonVal(playerid, "cMod8", 0);
                PlayerInfo[playerid][cMod9] = 0;
                SaveKonVal(playerid, "cMod9", 0);
                PlayerInfo[playerid][cMod10] = 0;
                SaveKonVal(playerid, "cMod10", 0);
                PlayerInfo[playerid][cMod11] = 0;
                SaveKonVal(playerid, "cMod11", 0);
                PlayerInfo[playerid][cMod12] = 0;
                SaveKonVal(playerid, "cMod12", 0);
                PlayerInfo[playerid][cMod13] = 0;
                SaveKonVal(playerid, "cMod13", 0);
                PlayerInfo[playerid][cMod14] = 0;
                SaveKonVal(playerid, "cMod14", 0);
                PlayerInfo[playerid][cMod15] = 0;
                SaveKonVal(playerid, "cMod15", 0);
                PlayerInfo[playerid][cMod16] = 0;
                SaveKonVal(playerid, "cMod16", 0);
                PlayerInfo[playerid][cMod17] = 0;
                SaveKonVal(playerid, "cMod17", 0);
                PlayerInfo[playerid][cPaintJob] = 3;
                SaveKonVal(playerid, "cPaintJob", 3);
                PlayerInfo[playerid][cKilo] = 0.0;
                SaveKonFloat(playerid, "cKilo", 0);
                PINFO[playerid][cPanel] = 0;
                SaveKonVal(playerid, "cPanel", 0);
                PINFO[playerid][cDoors] = 0;
                SaveKonVal(playerid, "cDoors", 0);
                PINFO[playerid][cLights] = 0;
                SaveKonVal(playerid, "cLights", 0);
                PINFO[playerid][cTires] = 0;
                SaveKonVal(playerid, "cTires", 0);
                SetVehicleParamsEx(PlayerInfo[playerid][pCar], 0, 0, 0, 1, 0, 0, 0);
                PlayerPlayMusic(playerid);
                new mod = IWantCar[playerid] - 400;
                new ali2[256];
                format(ali2,256,"Congratulation with your %s.",aVehicleNames[mod]);
                SCM(playerid,COLOR_ALI,ali2);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Type: /carhelp to view the car commands.");
                SCM(playerid,COLOR_ALI,"I give you a Checkpoint to you know where is it.");
                new Float:x,Float:y,Float:z;
                GetVehiclePos(carid, x, y, z);
                if(OnCheckpoint[playerid] == 0)
                {
                    OnCheckpoint[playerid] = 1;
                    SetPlayerCheckpoint(playerid, x, y, z, 6);
                    locatemashin[playerid] = 2;
                }
                else
                {
                    SCM(playerid,COLOR_Good,"You already have an enable checkpoint.");
                }
                PlayerPlaySound(playerid, 1054, 0.0, 0.0, 10.0)
                gEngine[playerid] = 0;
                OwnedMashin[carid] = 1;
                MashinOwner[carid] = playerid;
                EngineSTATE[carid] = 0;
                Benzin[carid] = 100;
                SetVehicleHealth(carid, 1000.0);
                IWantCar[playerid] = 0;
                PriceCar[playerid] = 0;
                for(new i = 0; i < LastPID; i++ )
                {
                    if(IsPlayerConnected(i))
                    {
                        SetVehicleParamsForPlayer(PlayerInfo[playerid][pCar],i,0,1);
                    }
                }
                //SaveAccount(playerid);
                return 1;
            }
            else if(PINFO[playerid][pCar] != 0 && PINFO[playerid][pCar_2] == 0)
            {
                if(PINFO[playerid][pPremiumAccount] == 0) return SCM(playerid,COLOR_ALI,"You must have a premium account to have 2 vehicles.");
                new car = IWantCar[playerid];
                new carid = CreateVehicle(car, 294.4691, -1540.4004, 24.2438, 54.5325, 1, 1,-1);
                new sendername[MAX_PLAYER_NAME];
                PlayerInfo[playerid][pCar_2] = carid;
                SaveKonVal(playerid, "pCar_2", carid);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                GivePlayerPool(playerid, -price);
                OwnedMashin_2[carid] = 1;
                MashinOwner_2[carid] = playerid;
                PlayerInfo[playerid][cLocationx_2] = 294.4691;
                SaveKonFloat(playerid, "cLocationx_2", 294.4691);
                PlayerInfo[playerid][cLocationy_2] = -1540.4004;
                SaveKonFloat(playerid, "cLocationy_2", -1540.4004);
                PlayerInfo[playerid][cLocationz_2] = 24.2438;
                SaveKonFloat(playerid, "cLocationz_2", 24.2438);
                PlayerInfo[playerid][cAngle_2] = 54.5325;
                SaveKonFloat(playerid, "cAngle_2", 54.5325);
                PlayerInfo[playerid][cColor1_2] = 1;
                SaveKonVal(playerid, "cColor1_2", 1);
                PlayerInfo[playerid][cColor2_2] = 1;
                SaveKonVal(playerid, "cColor2_2", 1);
                PlayerInfo[playerid][cModel_2] = car;
                SaveKonVal(playerid, "cModel_2", car);
                PlayerInfo[playerid][cPrice_2] = PriceCar[playerid];
                SaveKonVal(playerid, "cPrice_2", PriceCar[playerid]);
                new string[256];
                format(string, sizeof(string), "NewVeh");
                strmid(PlayerInfo[playerid][cPlate_2], string, 0, strlen(string), 255);
                SaveKonStr(playerid, "cPlate_2", PINFO[playerid][cPlate_2]);
                SetVehicleNumberPlate(carid,"NewVeh");
                PlayerInfo[playerid][cLock_2] = 1;
                SaveKonVal(playerid, "cLock_2", 1);
                PlayerInfo[playerid][cDestroyed_2] = 0;
                SaveKonVal(playerid, "cDestroyed_2", 0);
                PlayerInfo[playerid][cFixed_2] = 1;
                SaveKonVal(playerid, "cFixed_2", 1);
                PlayerInfo[playerid][cInsurance_2] = DefaultInsurance;
                SaveKonVal(playerid, "cInsurance_2", DefaultInsurance);
                PlayerInfo[playerid][cFuel_2] = 100;
                SaveKonVal(playerid, "cFuel_2", 100);
                PlayerInfo[playerid][cHealth_2] = 1000.0;
                SaveKonFloat(playerid, "cHealth_2", 1000);
                PlayerInfo[playerid][cMod1_2] = 0;
                SaveKonVal(playerid, "cMod1_2", 0);
                PlayerInfo[playerid][cMod3_2] = 0;
                SaveKonVal(playerid, "cMod3_2", 0);
                PINFO[playerid][gLocationX_2] = 0;
                SaveKonFloat(playerid, "gLocationX_2", 0);
                PINFO[playerid][gLocationY_2] = 0;
                SaveKonFloat(playerid, "gLocationY_2", 0);
                PINFO[playerid][gLocationZ_2] = 0;
                SaveKonFloat(playerid, "gLocationZ_2", 0);
                PINFO[playerid][gAngle_2] = 0;
                SaveKonFloat(playerid, "gAngle_2", 0);
                PINFO[playerid][gParked_2] = 0;
                SaveKonVal(playerid, "gParked_2", 0);
                PlayerInfo[playerid][cMod4_2] = 0;
                SaveKonVal(playerid, "cMod4_2", 0);
                PlayerInfo[playerid][cMod5_2] = 0;
                SaveKonVal(playerid, "cMod5_2", 0);
                PlayerInfo[playerid][cMod6_2] = 0;
                SaveKonVal(playerid, "cMod6_2", 0);
                PlayerInfo[playerid][cMod7_2] = 0;
                SaveKonVal(playerid, "cMod7_2", 0);
                PlayerInfo[playerid][cMod8_2] = 0;
                SaveKonVal(playerid, "cMod8_2", 0);
                PlayerInfo[playerid][cMod9_2] = 0;
                SaveKonVal(playerid, "cMod9_2", 0);
                PlayerInfo[playerid][cMod10_2] = 0;
                SaveKonVal(playerid, "cMod10_2", 0);
                PlayerInfo[playerid][cMod11_2] = 0;
                SaveKonVal(playerid, "cMod11_2", 0);
                PlayerInfo[playerid][cMod12_2] = 0;
                SaveKonVal(playerid, "cMod12_2", 0);
                PlayerInfo[playerid][cMod13_2] = 0;
                SaveKonVal(playerid, "cMod13_2", 0);
                PlayerInfo[playerid][cMod14_2] = 0;
                SaveKonVal(playerid, "cMod14_2", 0);
                PlayerInfo[playerid][cMod15_2] = 0;
                SaveKonVal(playerid, "cMod15_2", 0);
                PlayerInfo[playerid][cMod16_2] = 0;
                SaveKonVal(playerid, "cMod16_2", 0);
                PlayerInfo[playerid][cMod17_2] = 0;
                SaveKonVal(playerid, "cMod17_2", 0);
                PlayerInfo[playerid][cPaintJob_2] = 3;
                SaveKonVal(playerid, "cPaintJob_2", 3);
                PlayerInfo[playerid][cKilo_2] = 0.0;
                SaveKonFloat(playerid, "cKilo_2", 0);
                PINFO[playerid][cPanel_2] = 0;
                SaveKonVal(playerid, "cPanel_2", 0);
                PINFO[playerid][cDoors_2] = 0;
                SaveKonVal(playerid, "cDoors_2", 0);
                PINFO[playerid][cLights_2] = 0;
                SaveKonVal(playerid, "cLights_2", 0);
                PINFO[playerid][cTires_2] = 0;
                SaveKonVal(playerid, "cTires_2", 0);
                SetVehicleParamsEx(PlayerInfo[playerid][pCar_2], 0, 0, 0, 1, 0, 0, 0);
                PlayerPlayMusic(playerid);
                new mod = IWantCar[playerid] - 400;
                new ali2[256];
                format(ali2,256,"Congratulation with your %s.",aVehicleNames[mod]);
                SCM(playerid,COLOR_ALI,ali2);
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "Type: /carhelp to view the car commands.");
                SCM(playerid,COLOR_ALI,"I give you a Checkpoint to you know where is it.");
                new Float:x,Float:y,Float:z;
                GetVehiclePos(carid, x, y, z);
                if(OnCheckpoint[playerid] == 0)
                {
                    OnCheckpoint[playerid] = 1;
                    SetPlayerCheckpoint(playerid, x, y, z, 6);
                    locatemashin[playerid] = 2;
                }
                else
                {
                    SCM(playerid,COLOR_Good,"You already have an enable checkpoint.");
                }
                PlayerPlaySound(playerid, 1054, 0.0, 0.0, 10.0)
                gEngine[playerid] = 0;
                EngineSTATE[carid] = 0;
                Benzin[carid] = 100;
                SetVehicleHealth(carid, 1000.0);
                IWantCar[playerid] = 0;
                PriceCar[playerid] = 0;
                for(new i = 0; i < LastPID; i++ )
                {
                    if(IsPlayerConnected(i))
                    {
                        SetVehicleParamsForPlayer(PlayerInfo[playerid][pCar_2],i,0,1);
                    }
                }
                //SaveAccount(playerid);
                return 1;
            }
            else return SCM(playerid,COLOR_ALI,"You already have 2 cars.");
        }
        else
        {
            SendClientMessage(playerid, COLOR_ALI, "You haven't enough cash with you.");
            PlayerPlaySound(playerid, 1053, 0.0, 0.0, 10.0);
            return 1;
        }
    }
pls help
Reply
#2

I don't know how you type the command in-game. but if you type it like /BuyVehicle..

This:
Код:
if(strcmp(cmd, "/buyvehicle", true) == 0)
Should be this
Код:
if(strcmp(cmd, "/BuyVehicle", true) == 0)
Reply
#3

The command needs to return something after closing the last bracket, if it doesn't work maybe you're using zcmd so strcmp won't work
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)