Do not creating vehicle
#1

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 ?
Reply
#2

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

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

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.
Reply
#5

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

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
Reply
#7

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]......
Reply
#8

Thanks I will Try
Reply
#9

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


Forum Jump:


Users browsing this thread: 1 Guest(s)