Jump to content
  • 0

Question

Posted

Salut! Am si eu probleme mari la DealerShip si chiar sunt incepator, nu prea stiu nimic si nu am cunostintele necesare pentru a le rezolva. Daca se poate sa-mi dati si mie un sistem dealership. Multumesc !

17 answers to this question

Recommended Posts

  • 0
Posted

ce fel de probleme?

  • Upvote 1

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

  • 0
Posted

Dau [/buycar], dau la premium cars, dau pe Hotring Racer A, imi ia si puncte premium si bani, la fel la fiecare masina. Cumpar 4 masini spre exemplu, vand o masina unui player si se dau toate 3-4. Am Hotring Racer A si la "Expensive Cars" si cand dau sa cumpar imi cumpara Vortex.E buguit rau, sunt incepator, nu am absolut nici o idee ce sa fac.

  • 0
Posted

arata cod sursa daca vrei sa te ajut

  • Upvote 1

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

  • 0
Posted

Ce cod sursa? public InsertCar? Scuze, dar chiar nu prea stiu absolut nimic, sunt incepator.

  • 0
Posted
Acum 30 minute, BMN a spus:

Ce cod sursa? public InsertCar? Scuze, dar chiar nu prea stiu absolut nimic, sunt incepator.

da aratal

  • Upvote 1

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

  • 0
Posted
Acum 8 minute, BMN a spus:
// 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,"{FFB870}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,"{FFB870}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,"{FFB870}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,"{FFB870}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,"{FFB870}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,"{FFB870}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,"{FFB870}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;

		new randomds = random(12)+1;
        CarInfo[idd][cLocationx] = RandomDealership[randomds][0];
		CarInfo[idd][cLocationy] = RandomDealership[randomds][1];
		CarInfo[idd][cLocationz] = RandomDealership[randomds][2];
		CarInfo[idd][cAngle] = RandomDealership[randomds][3];
				        	
		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_LIGHTBLUE,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,"{FFB870}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,"{FFB870}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,"{FFB870}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,"{FFB870}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,"{FFB870}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,"{FFB870}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,"{FFB870}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;
		
		new randomds = random(12)+1;
        CarInfo[idd][cLocationx] = RandomDealership[randomds][0];
		CarInfo[idd][cLocationy] = RandomDealership[randomds][1];
		CarInfo[idd][cLocationz] = RandomDealership[randomds][2];
		CarInfo[idd][cAngle] = RandomDealership[randomds][3];

        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_LIGHTBLUE,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;
}

 

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

  • 0
Posted

Sincer m-ai bagat in ceata, nu am inteles. Eu am postat pe pastebin public insertcar, era si publicvipcar, iar eu inlocuiesc codul asta cu cele 2 publice? Sau cum? nu inteleg.

  • 0
Posted

nu stergi ce ai la  public insertca si il adaugi pe care team dat eu 

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

  • 0
Posted

E:\Jocuri\Server SAMP\Rolex SERVER - TEST DEALERSHIP\gamemodes\rolex.pwn(59376) : error 017: undefined symbol "RandomDealership"
E:\Jocuri\Server SAMP\Rolex SERVER - TEST DEALERSHIP\gamemodes\rolex.pwn(59376) : warning 215: expression has no effect
E:\Jocuri\Server SAMP\Rolex SERVER - TEST DEALERSHIP\gamemodes\rolex.pwn(59376) : error 001: expected token: ";", but found "]"
E:\Jocuri\Server SAMP\Rolex SERVER - TEST DEALERSHIP\gamemodes\rolex.pwn(59376) : error 029: invalid expression, assumed zero
E:\Jocuri\Server SAMP\Rolex SERVER - TEST DEALERSHIP\gamemodes\rolex.pwn(59376) : fatal error 107: too many error messages on one line

 Aceasta este linia 59376: CarInfo[idd][cLocationx] = RandomDealership[randomds][0];

  • 0
Posted (edited)
Acum 4 ore, BMN a spus:

E:\Jocuri\Server SAMP\Rolex SERVER - TEST DEALERSHIP\gamemodes\rolex.pwn(59376) : error 017: undefined symbol "RandomDealership"
E:\Jocuri\Server SAMP\Rolex SERVER - TEST DEALERSHIP\gamemodes\rolex.pwn(59376) : warning 215: expression has no effect
E:\Jocuri\Server SAMP\Rolex SERVER - TEST DEALERSHIP\gamemodes\rolex.pwn(59376) : error 001: expected token: ";", but found "]"
E:\Jocuri\Server SAMP\Rolex SERVER - TEST DEALERSHIP\gamemodes\rolex.pwn(59376) : error 029: invalid expression, assumed zero
E:\Jocuri\Server SAMP\Rolex SERVER - TEST DEALERSHIP\gamemodes\rolex.pwn(59376) : fatal error 107: too many error messages on one line

 Aceasta este linia 59376: CarInfo[idd][cLocationx] = RandomDealership[randomds][0];

este simplu aia este diferite locuri pentru sa de spawneze masinile la ds 

 

 

 

Spoiler

new Float:RandomDealership[10][4] = {
{1082.8112,-1760.7478,13.1035,269.9429},
{1083.9628,-1766.7467,13.0904,270.4363},
{1083.0736,-1772.5280,13.0783,270.1123},
{1098.6257,-1757.8400,13.0791,89.8158},
{1099.0072,-1763.8464,13.0764,89.2697},
{1099.0583,-1769.6859,13.0744,89.7400},
{1099.0018,-1775.5155,13.0716,90.0020},
{1077.9497,-1772.6519,13.0780,90.1477},
{1078.2830,-1766.7454,13.0906,90.2900},
{1077.7037,-1760.9420,13.1063,89.8762}
};
uite ca te-am facut si asta de acum descurcate!

 

Edited by Geani

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

  • 0
Posted
Acum 45 minute, BMN a spus:

Cum rezolv aceste erori ? 

 

ai la continuturi ascunse facute de mine

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

  • 0
Posted

daca nu intelegi nu mai incerca sa sa mai inveti scripting

ps: nimeni nuti iti va da mura in gura doar iti da unele probleme care trebuie sa le rezolvi doar tu, daca te duce capul.

 

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

  • 0
Posted

Posibil sa nu fie organizate bine in baza de date probabil la "stock", daca le organizezi bine acolo trebuie sa modifici si la "DIALOG_CARBUY", presupun ca asa il ai, daca nu, modifici unde raspunde la tine dialogului de la /buycar preturile masinilor. Ar trebuii sa mearga si eu am avut poroblema. Uite tebelul "stock" pe care il folosesc eu http://www.girlshare.ro/3489765337.3 .

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.