SA-MP Forums Archive
Do not creating vehicle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Do not creating vehicle (/showthread.php?tid=151942)



Do not creating vehicle - epranka - 01.06.2010

Hi, It is work:
Код:
new pname[32];
		GetPlayerName(playerid, pname, 32);
		new string[128];
		format(string, sizeof(string), "%s car", pname);
		new File:ftw=fopen(string, io_read);
		new clas[128];
		new i=0;
		new array[7];
		while(fread(ftw, clas)){
 			new n = floatstr(clas);
			array[i] = n;
		  i=i+1;
		}
		//vehicle model generate
		new temp_vmodel[16];
		format(temp_vmodel, sizeof(temp_vmodel), "%f", array[0]);
		new vmodel = strval(temp_vmodel);
		//Coordinates and Angle
		new cooX = array[1];
		new cooY = array[2];
		new cooZ = array[3];
		new Angle = array[4];
		//Color1 and Color2
		new temp_color1[16];
		new temp_color2[16];
		format(temp_color1, sizeof(temp_color1), "%f", array[5]);
		format(temp_color2, sizeof(temp_color2), "%f", array[6]);
		new color1 = strval(temp_color1);
		new color2 = strval(temp_color2);
But:
Код:
//Creating Vehicle
		AddStaticVehicle(vmodel,cooX ,cooY ,cooZ ,Angle ,color1 ,color2);
		fclose(ftw);
		return 1;
Is not working.
File:
Код:
410
-2148.5969
-935.1008
31.6786
269.9992
9
1
Why, do not create vehicle by coordinates from file ?


Re: Do not creating vehicle - RatHack - 01.06.2010

what u want? spawn a vehicle? or put it in map


Re: Do not creating vehicle - DJDhan - 01.06.2010

Try using
Код:
 CreateVehicle(modelid,x,y,z,rotation,color1,color2,respawndelay);



Re: Do not creating vehicle - epranka - 02.06.2010

Quote:

what u want? spawn a vehicle? or put it in map

I want put vehicle in to map.

Quote:
Originally Posted by DJDhan
Try using
Код:
 CreateVehicle(modelid,x,y,z,rotation,color1,color2,respawndelay);
I tried, but it is not working too.


Re: Do not creating vehicle - Antonio [G-RP] - 02.06.2010

If it's from file , I suggest you create enums, and have a loading function in ongamemodeinit


Re: Do not creating vehicle - epranka - 02.06.2010

Quote:
Originally Posted by Antonio (eternalrp.webatu.com)
If it's from file , I suggest you create enums, and have a loading function in ongamemodeinit
But I want to create vehicle with command


Re: Do not creating vehicle - Antonio [G-RP] - 02.06.2010

Then you STILL need enums and you load from file when you create vehicle in ongamemodeinir.. Example: if the enum for modelid was vmod, then you do something like CreateVehicle(VehicleInfo[v][vmod]......


Re: Do not creating vehicle - epranka - 02.06.2010

Thanks I will Try


Re: Do not creating vehicle - Steven82 - 02.06.2010

you won't need Enum's? WTF!.......find a car spawner and learn from that