SA-MP Forums Archive
[RP]Some questions about MySQL vehicle system - 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: [RP]Some questions about MySQL vehicle system (/showthread.php?tid=363102)



[RP]Some questions about MySQL vehicle system - Soap_MacTavish - 26.07.2012

I found that many Role-Play gamemodes determine a vehicle is whether a cop car like this
Код:
public IsACopCar(carid)
{
	for(new i = 0; i < sizeof(copcar); i++)
	{
		if(carid == copcar[i])	return 1;
	}
	return 0;
}
and create a cop car like this
Код:
new copcar[37];
	copcar[1] = AddStaticVehicleEx(596,1574.4703,-1710.9795,5.6115,0.4220, -1, -1, 30000); 
	copcar[2] = AddStaticVehicleEx(596,1587.4816,-1710.3594,5.6104,358.9421,-1, -1, 30000);
......
And my problem is how to use MySQL to create some cop cars?



Re: [RP]Some questions about MySQL vehicle system - Jstylezzz - 26.07.2012

you don't use MYSQL to create them, you only use MYSQL to save the position of the car, and to load the position of the car..
you create the cars with AddStaticVehicle(EX) and then the saved coords..


Re: [RP]Some questions about MySQL vehicle system - Soap_MacTavish - 26.07.2012

Okay. got it sir