[Pomoc] /v park


Započeo Ivann, Jun 12, 2013, 17:28:34 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: Noobot
Detaljan opis problema: kad vozilo kupim i kucam /v park i restartujem server vozilo se pretvori u bmx
Dio skripte:
CMD:park(playerid, params[])
{
	if(IsPlayerConnected(playerid))
	{
		new Float:x,Float:y,Float:z;
		new Float:a,string[128];
		new carid = GetPlayerVehicleID(playerid);
		GetVehiclePos(carid, x, y, z);
		GetVehicleZAngle(carid, a);
		if(PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17)
		{
			if(IsPlayerInRangeOfPoint(playerid, 70,1251.7888,-1818.8201,13.4089))
			{
				if(IsAnOwnableCar(carid))
				{
					CarInfo[carid][cLocationx] = x;
					CarInfo[carid][cLocationy] = y;
					CarInfo[carid][cLocationz] = z;
					CarInfo[carid][cAngle] = a;
					CarInfo[carid][cKazna] = 1;
					engineOn[carid] = 0;
					gEngine[playerid] = 0;
					format(string, sizeof(string), "~n~ Parkirali ste vozilo na ovoj poziciji. ~n~");
					GameTextForPlayer(playerid, "Parkirali ste ova kola na ovoj poziciji. Ovde ce se respawnovati.", 10000, 3);
					OnPropUpdate(4,carid);
					OnPlayerUpdateEx(playerid);
					DestroyVehicle(carid);
					ownedcar[carid] = AddStaticVehicleEx(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
					if(CarInfo[carid][cPaintjob] != 999)
					{
						ChangeVehiclePaintjob(carid, CarInfo[carid][cPaintjob]);
					}
					SetVehicleVirtualWorld(carid, CarInfo[carid][cVirWorld]);
					SetVehicleModifications(carid);
					return 1;
				}
				else
				{
					SCM(playerid, COLOR_GREY, "* Ovo mozete uraditi samo sa kolima koja su na /v!");
					return 1;
				}
			}
			else
			{
				SCM(playerid, COLOR_GREY, "* Niste u parking servis bazi!");
				return 1;
			}
		}
		else
		{
			SCM(playerid, COLOR_GREY, "* Niste ovlasceni da koristite ovu komandu!");
			return 1;
		}
	}
	return 1;
}

Daj mi Gde ucitava vozilo i sacuvava.
Skriptam za pare

Citat: Memorex poslato Jun 12, 2013, 17:30:01 POSLE PODNE
Daj mi Gde ucitava vozilo i sacuvava.
public LoadCar()
{
	new file[26];
	for(new idx = 1; idx < sizeof(CarInfo) ; idx++)
	{
	    format(file, sizeof(file),"ShowTimeRP/Vehicles/%d.ini", idx)
		if(dini_Exists(file))
		{
		 	CarInfo[idx][cModel] = dini_Int(file,"Model");
			CarInfo[idx][cLocationx] = dini_Float(file,"Location_X");
			CarInfo[idx][cLocationy] = dini_Float(file,"Location_Y");
			CarInfo[idx][cLocationz] = dini_Float(file,"Location_Z");
			CarInfo[idx][cAngle] = dini_Float(file,"Angle");
			CarInfo[idx][cColorOne] = dini_Int(file,"Color_1");
			CarInfo[idx][cColorTwo] = dini_Int(file,"Color_2");
			strmid(CarInfo[idx][cOwner], dini_Get(file,"Owner"), 0, strlen(dini_Get(file,"Owner")), 255);
			CarInfo[idx][cOwned] = dini_Int(file,"Owned");
			CarInfo[idx][cLock] = dini_Int(file,"Locked");
			CarInfo[idx][cPaintjob] = dini_Int(file,"Paintjob");
			CarInfo[idx][cVirWorld] = dini_Int(file,"VirtualWorld");
		   	CarInfo[idx][cComponent0] = dini_Int(file,"Component0");
		   	CarInfo[idx][cComponent1] = dini_Int(file,"Component1");
			CarInfo[idx][cComponent2] = dini_Int(file,"Component2");
			CarInfo[idx][cComponent3] = dini_Int(file,"Component3");
			CarInfo[idx][cComponent4] = dini_Int(file,"Component4");
			CarInfo[idx][cComponent5] = dini_Int(file,"Component5");
			CarInfo[idx][cComponent6] = dini_Int(file,"Component6");
			CarInfo[idx][cComponent7] = dini_Int(file,"Component7");
			CarInfo[idx][cComponent8] = dini_Int(file,"Component8");
			CarInfo[idx][cComponent9] = dini_Int(file,"Component9");
			CarInfo[idx][cComponent10] = dini_Int(file,"Component10");
			CarInfo[idx][cComponent11] = dini_Int(file,"Component11");
			CarInfo[idx][cComponent12] = dini_Int(file,"Component12");
			CarInfo[idx][cComponent13] = dini_Int(file,"Component13");
			CarInfo[idx][cCode] = dini_Int(file,"SecurityCode");
			CarInfo[idx][cReg] = dini_Int(file,"Registracija");
			CarInfo[idx][cKazna] = dini_Int(file,"Kazna");
			CarInfo[idx][CarAudio] = dini_Int(file,"Radio");
		}
	}
	print("[SCRIPT]: Ucitani Automobili");
	return 1;
}

public OnGameModeInit() // Do not add vehicles Above the next lines. - CuervO
{
	SetNameTagDrawDistance(8.5);
	LoadCar();
	new string2[64];
	for(new h = 1; h < sizeof(CarInfo); h++)
	{
		format(string2, sizeof(string2), "ShowTimeRP/Vehicles/%d.ini",h);
		if(dini_Exists(string2))
		{
			if(CarInfo[h][cOwned] == 0 || CarInfo[h][cModel] == 0)
		    {
				ownedcar[h] = CreateVehicle(510,-804.5384,3791.8506,39.4313+h,CarInfo[h][cAngle],CarInfo[h][cColorOne],CarInfo[h][cColorTwo],60000);
			}
		    else
			{
				ownedcar[h] = CreateVehicle(CarInfo[h][cModel],CarInfo[h][cLocationx],CarInfo[h][cLocationy],CarInfo[h][cLocationz]+1.0,CarInfo[h][cAngle],CarInfo[h][cColorOne],CarInfo[h][cColorTwo],60000);
			}
			if(dini_Exists("ShowTimeRP/Users/Petar_Gladic.ini")) { return 1; }
			if(CarInfo[h][cPaintjob] != 999)
			{
				ChangeVehiclePaintjob(h, CarInfo[h][cPaintjob]);
			}
			SetVehicleVirtualWorld(h, CarInfo[h][cVirWorld]);
			SetVehicleModifications(h);
		}
	}

public SaveVehicleComponents(car)
{
	new slot[14];
	slot[0] = GetVehicleComponentInSlot(car, 0);
	slot[1] = GetVehicleComponentInSlot(car, 1);
	slot[2] = GetVehicleComponentInSlot(car, 2);
	slot[3] = GetVehicleComponentInSlot(car, 3);
	slot[4] = GetVehicleComponentInSlot(car, 4);
	slot[5] = GetVehicleComponentInSlot(car, 5);
	slot[6] = GetVehicleComponentInSlot(car, 6);
	slot[7] = GetVehicleComponentInSlot(car, 7);
	slot[8] = GetVehicleComponentInSlot(car, 8);
	slot[9] = GetVehicleComponentInSlot(car, 9);
	slot[10] = GetVehicleComponentInSlot(car, 10);
	slot[11] = GetVehicleComponentInSlot(car, 11);
	slot[12] = GetVehicleComponentInSlot(car, 12);
	slot[13] = GetVehicleComponentInSlot(car, 13);
	if(slot[0] != 0)
	{
		CarInfo[car][cComponent0] = slot[0];
	}
	if(slot[1] != 0)
	{
		CarInfo[car][cComponent1] = slot[1];
	}
	if(slot[2] != 0)
 	{
  		CarInfo[car][cComponent2] = slot[2];
	}
	if(slot[3] != 0)
 	{
  		CarInfo[car][cComponent3] = slot[3];
	}
	if(slot[4] != 0)
 	{
  		CarInfo[car][cComponent4] = slot[4];
	}
	if(slot[5] != 0)
	{
		CarInfo[car][cComponent5] = slot[5];
	}
	if(slot[6] != 0)
	{
		CarInfo[car][cComponent6] = slot[6];
	}
	if(slot[7] != 0)
 	{
		CarInfo[car][cComponent7] = slot[7];
	}
	if(slot[8] != 0)
	{
		CarInfo[car][cComponent8] = slot[8];
	}
	if(slot[9] != 0)
	{
		CarInfo[car][cComponent9] = slot[9];
	}
	if(slot[10] != 0)
	{
		CarInfo[car][cComponent10] = slot[10];
	}
	if(slot[11] != 0)
	{
		CarInfo[car][cComponent11] = slot[11];
	}
	if(slot[12] != 0)
	{
		CarInfo[car][cComponent12] = slot[12];
	}
	if(slot[13] != 0)
	{
		CarInfo[car][cComponent13] = slot[13];
	}
	OnPropUpdate(4,car);
}

kad bi gledo kodove ne bit ti bilo cudno zasto stavra bicikl


ownedcar[h] = CreateVehicle(510,-804.5384,3791.8506,39.4313+h,CarInfo[h][cAngle],CarInfo[h][cColorOne],CarInfo[h][cColorTwo],60000);

probaj ovako


ownedcar[h] = CreateVehicle(CarInfo[h][cModel],-804.5384,3791.8506,39.4313+h,CarInfo[h][cAngle],CarInfo[h][cColorOne],CarInfo[h][cColorTwo],60000);


i uvijek ce ti stavra na tim kordinatama a ne di parkiras..
Other Dimension RolePlay | Uskoro
Ukoliko zelite pomoci u razvoju servera, mozete se meni javit na PP/PM!

Citat: Crazyn3ss poslato Jun 12, 2013, 17:55:50 POSLE PODNE
kad bi gledo kodove ne bit ti bilo cudno zasto stavra bicikl


ownedcar[h] = CreateVehicle(510,-804.5384,3791.8506,39.4313+h,CarInfo[h][cAngle],CarInfo[h][cColorOne],CarInfo[h][cColorTwo],60000);

probaj ovako


ownedcar[h] = CreateVehicle(CarInfo[h][cModel],-804.5384,3791.8506,39.4313+h,CarInfo[h][cAngle],CarInfo[h][cColorOne],CarInfo[h][cColorTwo],60000);


i uvijek ce ti stavra na tim kordinatama a ne di parkiras..
nista i dalje se pretvara u bmx