[Pomoc] Postavi Tuning


Započeo Scripter Braun, Mart 09, 2014, 09:36:25 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: 4CRP
Detaljan opis problema: Zasto mi baca error kod PostaviTuning sve sam lepo uradio ima public, forward sve ?
Dio skripte: Evo /v park
else if(strcmp(x_nr,"park",true) == 0)
	        {
	            new Float:x,Float:y,Float:z;
				new Float:a;
				new carid;
				new getcarid;
				new	boja = CarInfo[carid][cPaintjob];
				if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; }
				else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; }
				else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { carid = PlayerInfo[playerid][pPcarkey3]; } // novi auto
				else { return 1; }
				getcarid = GetPlayerVehicleID(playerid);
				GetPlayerName(playerid, playername, sizeof(playername));
				GetVehiclePos(carid, x, y, z);
				GetVehicleZAngle(carid, a);
				if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)
				{
			   		if(PlayerInfo[playerid][pPcarkey] == 999  && PlayerInfo[playerid][pPcarkey2] == 999 && PlayerInfo[playerid][pPcarkey3] == 999)
					{
						SendClientMessage(playerid, COLOR_GREY, "Neposjedujes vozilo.");
						return 1;
					}
					// ********************
				    new Float:chealth;
				    new cveh;
				    cveh = GetPlayerVehicleID(playerid);
				    GetVehicleHealth(cveh, chealth);
				    if(chealth <700)
					{
						SendClientMessage(playerid,COLOR_RED,"Vozilo je suvise osteceno, morate ga popraviti prvo !!");
						return 1;
					}
					//*******************
					if(getcarid == carid)
					{
						CarInfo[carid][cLocationx] = x;
						CarInfo[carid][cLocationy] = y;
						CarInfo[carid][cLocationz] = z;
						CarInfo[carid][cAngle] = a;
						// snimanje modifikacija
						new slot[14];
						slot[0] = GetVehicleComponentInSlot(carid, 0);
						slot[1] = GetVehicleComponentInSlot(carid, 1);
						slot[2] = GetVehicleComponentInSlot(carid, 2);
						slot[3] = GetVehicleComponentInSlot(carid, 3);
						slot[4] = GetVehicleComponentInSlot(carid, 4);
						slot[5] = GetVehicleComponentInSlot(carid, 5);
						slot[6] = GetVehicleComponentInSlot(carid, 6);
						slot[7] = GetVehicleComponentInSlot(carid, 7);
						slot[8] = GetVehicleComponentInSlot(carid, 8);
						slot[9] = GetVehicleComponentInSlot(carid, 9);
						slot[10] = GetVehicleComponentInSlot(carid, 10);
						slot[11] = GetVehicleComponentInSlot(carid, 11);
						slot[12] = GetVehicleComponentInSlot(carid, 12);
						slot[13] = GetVehicleComponentInSlot(carid, 13);
						CarInfo[carid][cComponent0] = slot[0];
						CarInfo[carid][cComponent1] = slot[1];
				  		CarInfo[carid][cComponent2] = slot[2];
				  		CarInfo[carid][cComponent3] = slot[3];
				  		CarInfo[carid][cComponent4] = slot[4];
						CarInfo[carid][cComponent5] = slot[5];
						CarInfo[carid][cComponent6] = slot[6];
						CarInfo[carid][cComponent7] = slot[7];
						CarInfo[carid][cComponent8] = slot[8];
						CarInfo[carid][cComponent9] = slot[9];
						CarInfo[carid][cComponent10] = slot[10];
						CarInfo[carid][cComponent11] = slot[11];
						CarInfo[carid][cComponent12] = slot[12];
						CarInfo[carid][cComponent13] = slot[13];
						//***************
						OnPropUpdate();
						SavePlayerAccount(playerid);
						DestroyVehicle(carid);
						CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
						// -------- 	za tablice      -------
				        strmid(CarInfo[carid][cLicense], CarInfo[carid][cLicense], 0, strlen(CarInfo[carid][cLicense]), 8);
						SetVehicleNumberPlate(carid, CarInfo[carid][cLicense] );
						SetVehicleToRespawn(carid);
						PostaviTuning(carid);
		        	    ChangeVehiclePaintjob(carid, boja);
	        	    	GetVehicleParamsEx(carid, engine, lights, , doors, bonnet, boot, objective);
						SetVehicleParamsEx(carid, doors, bonnet, boot, objective);
						gEngine[playerid] = 0;
						//------------------------------------
						TogglePlayerControllable(playerid, 1);
						gEngine[playerid] = 0;
						engineOn[GetPlayerVehicleID(playerid)] = 0;
						PutPlayerInVehicle(playerid, carid, 0);
						format(string, sizeof(string), "~n~ Parkirao si vozilo na ovoj lokaciji. ~n~");
						GameTextForPlayer(playerid, "Parkirao si vozilo na ovu lokaciju. Od sad ce se spawnati ovdje.", 10000, 3);
						return 1;
   					}
				}
	        }
    ~ Member since: 09.13.2013. - 15:30 ~

koji error i koja linija nisam ja vidovit
Poslednja Izmena: Mart 09, 2014, 09:40:47 PRE PODNE od [UG]C++
69

Error sa podebljo i obojio crvenom.

else if(strcmp(x_nr,"park",true) == 0)
           {
               new Float:x,Float:y,Float:z;
            new Float:a;
            new carid;
            new getcarid;
            new   boja = CarInfo[carid][cPaintjob];
            if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; }
            else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; }
            else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { carid = PlayerInfo[playerid][pPcarkey3]; } // novi auto
            else { return 1; }
            getcarid = GetPlayerVehicleID(playerid);
            GetPlayerName(playerid, playername, sizeof(playername));
            GetVehiclePos(carid, x, y, z);
            GetVehicleZAngle(carid, a);
            if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)
            {
                  if(PlayerInfo[playerid][pPcarkey] == 999  && PlayerInfo[playerid][pPcarkey2] == 999 && PlayerInfo[playerid][pPcarkey3] == 999)
               {
                  SendClientMessage(playerid, COLOR_GREY, "Neposjedujes vozilo.");
                  return 1;
               }
               // ********************
                new Float:chealth;
                new cveh;
                cveh = GetPlayerVehicleID(playerid);
                GetVehicleHealth(cveh, chealth);
                if(chealth <700)
               {
                  SendClientMessage(playerid,COLOR_RED,"Vozilo je suvise osteceno, morate ga popraviti prvo !!");
                  return 1;
               }
               //*******************
               if(getcarid == carid)
               {
                  CarInfo[carid][cLocationx] = x;
                  CarInfo[carid][cLocationy] = y;
                  CarInfo[carid][cLocationz] = z;
                  CarInfo[carid][cAngle] = a;
                  // snimanje modifikacija
                  new slot[14];
                  slot[0] = GetVehicleComponentInSlot(carid, 0);
                  slot[1] = GetVehicleComponentInSlot(carid, 1);
                  slot[2] = GetVehicleComponentInSlot(carid, 2);
                  slot[3] = GetVehicleComponentInSlot(carid, 3);
                  slot[4] = GetVehicleComponentInSlot(carid, 4);
                  slot[5] = GetVehicleComponentInSlot(carid, 5);
                  slot[6] = GetVehicleComponentInSlot(carid, 6);
                  slot[7] = GetVehicleComponentInSlot(carid, 7);
                  slot[8] = GetVehicleComponentInSlot(carid, 8);
                  slot[9] = GetVehicleComponentInSlot(carid, 9);
                  slot[10] = GetVehicleComponentInSlot(carid, 10);
                  slot[11] = GetVehicleComponentInSlot(carid, 11);
                  slot[12] = GetVehicleComponentInSlot(carid, 12);
                  slot[13] = GetVehicleComponentInSlot(carid, 13);
                  CarInfo[carid][cComponent0] = slot[0];
                  CarInfo[carid][cComponent1] = slot[1];
                    CarInfo[carid][cComponent2] = slot[2];
                    CarInfo[carid][cComponent3] = slot[3];
                    CarInfo[carid][cComponent4] = slot[4];
                  CarInfo[carid][cComponent5] = slot[5];
                  CarInfo[carid][cComponent6] = slot[6];
                  CarInfo[carid][cComponent7] = slot[7];
                  CarInfo[carid][cComponent8] = slot[8];
                  CarInfo[carid][cComponent9] = slot[9];
                  CarInfo[carid][cComponent10] = slot[10];
                  CarInfo[carid][cComponent11] = slot[11];
                  CarInfo[carid][cComponent12] = slot[12];
                  CarInfo[carid][cComponent13] = slot[13];
                  //***************
                  OnPropUpdate();
                  SavePlayerAccount(playerid);
                  DestroyVehicle(carid);
                  CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
                  // --------    za tablice      -------
                    strmid(CarInfo[carid][cLicense], CarInfo[carid][cLicense], 0, strlen(CarInfo[carid][cLicense]), 8);
                  SetVehicleNumberPlate(carid, CarInfo[carid][cLicense] );
                  SetVehicleToRespawn(carid);
                  PostaviTuning(carid);
                     ChangeVehiclePaintjob(carid, boja);
                     GetVehicleParamsEx(carid, engine, lights, , doors, bonnet, boot, objective);
                  SetVehicleParamsEx(carid, doors, bonnet, boot, objective);
                  gEngine[playerid] = 0;
                  //------------------------------------
                  TogglePlayerControllable(playerid, 1);
                  gEngine[playerid] = 0;
                  engineOn[GetPlayerVehicleID(playerid)] = 0;
                  PutPlayerInVehicle(playerid, carid, 0);
                  format(string, sizeof(string), "~n~ Parkirao si vozilo na ovoj lokaciji. ~n~");
                  GameTextForPlayer(playerid, "Parkirao si vozilo na ovu lokaciju. Od sad ce se spawnati ovdje.", 10000, 3);
                  return 1;
                  }
            }
           }
    ~ Member since: 09.13.2013. - 15:30 ~

pa daj mi tu funkciju jer ovo je samo primjena te funkcije daj cijeli poziv..
69

Kako mislis celu funkciju public ?
    ~ Member since: 09.13.2013. - 15:30 ~

Dali zna neko potrebno mi je hitnoo  :'(
    ~ Member since: 09.13.2013. - 15:30 ~

Da nije do toga sto mi je
command:vehicle ?
    ~ Member since: 09.13.2013. - 15:30 ~

Daj celu funkciju ili ti public postavituning.

Citat: Maxwellâ,,¢ poslato Mart 09, 2014, 12:11:20 POSLE PODNE
Daj celu funkciju ili ti public postavituning.
E da svi objasnjavaju kao maxwell :D
Evo public.
public PostaviTuning(carid)
{
	if(CarInfo[carid][cComponent0] >= 0)
	{
	    AddVehicleComponent(carid, CarInfo[carid][cComponent0])
	}
	if(CarInfo[carid][cComponent1] >= 0)
	{
	    AddVehicleComponent(carid, CarInfo[carid][cComponent1])
	}
	if(CarInfo[carid][cComponent2] >= 0)
	{
	    AddVehicleComponent(carid, CarInfo[carid][cComponent2])
	}
	if(CarInfo[carid][cComponent3] >= 0)
	{
	    AddVehicleComponent(carid, CarInfo[carid][cComponent3])
	}
	if(CarInfo[carid][cComponent4] >= 0)
	{
	    AddVehicleComponent(carid, CarInfo[carid][cComponent4])
	}
	if(CarInfo[carid][cComponent5] >= 0)
	{
	    AddVehicleComponent(carid, CarInfo[carid][cComponent5])
	}
	if(CarInfo[carid][cComponent6] >= 0)
	{
	    AddVehicleComponent(carid, CarInfo[carid][cComponent6])
	}
	if(CarInfo[carid][cComponent7] >= 0)
	{
	    AddVehicleComponent(carid, CarInfo[carid][cComponent7])
	}
	if(CarInfo[carid][cComponent8] >= 0)
	{
	    AddVehicleComponent(carid, CarInfo[carid][cComponent8])
	}
	if(CarInfo[carid][cComponent9] >= 0)
	{
	    AddVehicleComponent(carid, CarInfo[carid][cComponent9])
	}
	if(CarInfo[carid][cComponent10] >= 0)
	{
  		AddVehicleComponent(carid, CarInfo[carid][cComponent10])
	}
	if(CarInfo[carid][cComponent11] >= 0)
	{
	    AddVehicleComponent(carid, CarInfo[carid][cComponent11])
	}
	if(CarInfo[carid][cComponent12] >= 0)
	{
	    AddVehicleComponent(carid, CarInfo[carid][cComponent12])
	}
	if(CarInfo[carid][cComponent13] >= 0)
	{
	    AddVehicleComponent(carid, CarInfo[carid][cComponent13])
	}
	return 1;
 }
    ~ Member since: 09.13.2013. - 15:30 ~


Blaeks

*

Madmen

new cveh;
cveh = GetPlayerVehicleID(playerid);
definisao si CVEH a koristis zamenu CARID ?

promenio sam cveh u carid al opet mi baca error.
    ~ Member since: 09.13.2013. - 15:30 ~

koji error bokte idija ti izbacuje

Evo ovaj error.
    ~ Member since: 09.13.2013. - 15:30 ~

Citat: Download poslato Mart 09, 2014, 14:01:57 POSLE PODNE
Evo ovaj error.


dodaj ovo
forward PostaviTuning(carid);
iznad
public PostaviTuning(carid)

My Bike KTM 450 SXF 2008