SA-MP Forums Archive
Not change the Plate - 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)
+--- Thread: Not change the Plate (/showthread.php?tid=469261)



Not change the Plate - dadge9 - 12.10.2013

Код:
stock LoadCar()
{
	new Query[128];
	new vid;
	new string[62];
	format(Query, sizeof(Query), "SELECT `Id`, `Owner`,  `Ownername`,  `Model`, `PosX`, `PosY`, `PosZ` `PosFace`, `Color1`, `Color2`, `Plate` FROM `vehicle`");
	mysql_query(Query);
	mysql_store_result();
	while(mysql_fetch_row(Query, "|"))
	{
		vid = LoadedInfo[Vehicles];
		sscanf(Query, "p<|>dds[25]dffffdds[32]",VehicleInfo[vid][Id],VehicleInfo[vid][Owner],VehicleInfo[vid][Ownername],VehicleInfo[vid][Model], VehicleInfo[vid][PosX], VehicleInfo[vid][PosY], VehicleInfo[vid][PosZ], VehicleInfo[vid][PosFace], VehicleInfo[vid][Color1], VehicleInfo[vid][Color2], VehicleInfo[vid][Plate]);
		new vehd = CreateVehicle(VehicleInfo[vid][Model], VehicleInfo[vid][PosX], VehicleInfo[vid][PosY], VehicleInfo[vid][PosZ], VehicleInfo[vid][PosFace], VehicleInfo[vid][Color1], VehicleInfo[vid][Color2],-1);
		SetVehicleNumberPlate(vehd, VehicleInfo[vid][Plate]);
		LoadedInfo[Vehicles] = LoadedInfo[Vehicles] + 1;
	}
	format(string, sizeof(string), "%d kocsi betцltve!", LoadedInfo[Vehicles]);
	print(string);
}
I was trying format string but didn't work it and When Load the server The plate is simple "XYZSR998" and not what is in the database
Sorry for my bad english


Re: Not change the Plate - tyler12 - 12.10.2013

SetVehicleToRespawn(id); after setting the plate.


Re: Not change the Plate - dadge9 - 12.10.2013

Its not workin, Not may be problem in the database Plate type is "text"?