Jump to content
  • 0

Cum fac sa cumpar mai multe vehicule de acelasi TIP in GameMode Saints


PunkyRO

Question

Dupa cum spune si titlul vreau sa fac cumva sa cumpar acelasi timp de masini in gamemode-ul saints. Stiu ca este o restrictie pe undeva dar nu o gasesc. Va rog daca puteti sa ma ajutati. Multumesc!

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
Acum 23 ore, TrueCross a spus:

Pai e foarte usor, cumpara-ti o masina, apoi mai incearca sa cumperi una de acelasi tip, vezi ce mesaj iti arata si cauta-l in GM, apoi sterge restrictia.

// type 1 - car | 2 - moto/bike | 3 - heli | 4 - premium cars.
public InsertCar(playerid,model,value,namecar[],type,stockid)
{
    new string[128],sendername[25];
    new idd = Findcar();
    GetPlayerName(playerid,sendername,sizeof(sendername));
    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][pPcarkey] == 0)
			{
				PlayerInfo[playerid][pPcarkey] = idd;
		        Update(playerid,pPcarkeyx);
		        CarInfo[idd][cLocationx] = 1098.5378;
				CarInfo[idd][cLocationy] = -1769.7567;
				CarInfo[idd][cLocationz] = 13.0752;
		        CarInfo[idd][cAngle] = 89.8502;
			}
			else
			{
				if(PlayerInfo[playerid][pPremiumAccount] == 1)
				{
					if(PlayerInfo[playerid][pprcarkey] == 0)
					{
						PlayerInfo[playerid][pprcarkey] = idd;
				        Update(playerid,pprcarkeyx);
				        CarInfo[idd][cLocationx] = 1098.5378;
						CarInfo[idd][cLocationy] = -1769.7567;
						CarInfo[idd][cLocationz] = 13.0752;
				        CarInfo[idd][cAngle] = 89.8502;
					}
					else return SCM(playerid,COLOR_WHITE,"{FFB870}Already own a premium car.");
				}
				else return SCM(playerid,COLOR_WHITE,"{FFB870}You own a car and for own two cars you need Premium Account.");
			}
        }
        else if(type == 2)
        {
        	if(PlayerInfo[playerid][pmotokey] == 0)
			{
	        	PlayerInfo[playerid][pmotokey] = idd;
				Update(playerid,pmotokeyx);
		        CarInfo[idd][cLocationx] = 1098.5378;
				CarInfo[idd][cLocationy] = -1769.7567;
				CarInfo[idd][cLocationz] = 13.0752;
		        CarInfo[idd][cAngle] = 89.8502;
			}
			else return SCM(playerid,COLOR_WHITE,"{FFB870}Already own a bike.");
		}
        else if(type == 3)
        {
        	if(PlayerInfo[playerid][phelikey] == 0)
			{
	        	PlayerInfo[playerid][phelikey] = idd;
				Update(playerid,phelikeyx);
		        CarInfo[idd][cLocationx] = 1098.5378;
				CarInfo[idd][cLocationy] = -1769.7567;
				CarInfo[idd][cLocationz] = 13.0752;
		        CarInfo[idd][cAngle] = 89.8502;
			}
			else return SCM(playerid,COLOR_WHITE,"{FFB870}Already own a plane.");
	    }

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

		if(personalcar[playerid] != 0)
		{
			DestroyVehicle(personalcar[playerid]);
			OwnedVeh(personalcar[playerid]) = 0;
			personalcar[playerid] = 0;
		}

		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], sendername, 0, strlen(sendername), 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][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][cNeon] = 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, cNeonx);

        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];
        format(disp,sizeof(disp),"You bought %s.Please take your car and park it elsewhere.",CarInfo[idd][cDescription]);
		SCM(playerid,COLOR_LIGHTBLUE,disp);
		
		OwnedVeh(car) = idd;
		personalcar[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.");
        
		mysql_query(SQL,"SELECT * FROM `cars`");
		mysql_store_result();
		idd = mysql_num_rows()+1;
		mysql_free_result();

	    if(type == 1)
        {
			if(PlayerInfo[playerid][pPcarkey] == 0)
			{
				PlayerInfo[playerid][pPcarkey] = idd;
		        Update(playerid,pPcarkeyx);
		        CarInfo[idd][cLocationx] = 1098.5378;
				CarInfo[idd][cLocationy] = -1769.7567;
				CarInfo[idd][cLocationz] = 13.0752;
		        CarInfo[idd][cAngle] = 89.8502;
			}
			else
			{
				if(PlayerInfo[playerid][pPremiumAccount] == 1)
				{
					if(PlayerInfo[playerid][pprcarkey] == 0)
					{
						PlayerInfo[playerid][pprcarkey] = idd;
				        Update(playerid,pprcarkeyx);
				        CarInfo[idd][cLocationx] = 1098.5378;
						CarInfo[idd][cLocationy] = -1769.7567;
						CarInfo[idd][cLocationz] = 13.0752;
				        CarInfo[idd][cAngle] = 89.8502;
					}
					else return SCM(playerid,COLOR_WHITE,"{FFB870}Already own a premium car.");
				}
				else return SCM(playerid,COLOR_WHITE,"{FFB870}You own a car and for own two cars you need Premium Account.");
			}
        }
        else if(type == 2)
        {
        	if(PlayerInfo[playerid][pmotokey] == 0)
			{
	        	PlayerInfo[playerid][pmotokey] = idd;
				Update(playerid,pmotokeyx);
		        CarInfo[idd][cLocationx] = 1098.5378;
				CarInfo[idd][cLocationy] = -1769.7567;
				CarInfo[idd][cLocationz] = 13.0752;
		        CarInfo[idd][cAngle] = 89.8502;
			}
			else return SCM(playerid,COLOR_WHITE,"{FFB870}Already own a bike.");
		}
        else if(type == 3)
        {
        	if(PlayerInfo[playerid][phelikey] == 0)
			{
	        	PlayerInfo[playerid][phelikey] = idd;
				Update(playerid,phelikeyx);
		        CarInfo[idd][cLocationx] = 1098.5378;
				CarInfo[idd][cLocationy] = -1769.7567;
				CarInfo[idd][cLocationz] = 13.0752;
		        CarInfo[idd][cAngle] = 89.8502;
			}
			else return SCM(playerid,COLOR_WHITE,"{FFB870}Already own a plane.");
	    }

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

	    if(personalcar[playerid] != 0)
		{
			DestroyVehicle(personalcar[playerid]);
			OwnedVeh(personalcar[playerid]) = 0;
			personalcar[playerid] = 0;
		}

		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], sendername, 0, strlen(sendername), 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][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][cNeon] = 0;

        format(string, sizeof(string),"INSERT INTO cars (ID, Model) VALUES (%d, %d)",  idd, CarInfo[idd][cModel]);
        mysql_query(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, cNeonx);

        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];
        format(disp,sizeof(disp),"You bought %s.Please take your car and park it elsewhere.",CarInfo[idd][cDescription]);
		SCM(playerid,COLOR_LIGHTBLUE,disp);

		OwnedVeh(car) = idd;
		personalcar[playerid] = car;

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

 

Eu nu gasesc restrictia....

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.