SA-MP Forums Archive
Code LAG problem! - 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: Code LAG problem! (/showthread.php?tid=261041)



Code LAG problem! - Fab10 - 11.06.2011

This code can cause lag with 20 players in vehicle in one time?

Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
	if(Car[vehicleid][vKm] > Car[vehicleid][vOldKm])
	{
	  	mysql_Query("UPDATE `fr_car` SET `Km` = '%f' WHERE `fr_car`.`ID` = %d LIMIT 1", Car[vehicleid][vKm], Car[vehicleid][vID]);
	   	Car[vehicleid][vOldKm] = Car[vehicleid][vKm];
	}
	return 1;
}
Use strickenkid mysql plugin


Re: Code LAG problem! - Fab10 - 11.06.2011

UP!!!!!!!!!!


Re: Code LAG problem! - WackoX - 11.06.2011

No.

The message you have entered is too short. Please lengthen your message to at least 4 characters.


Re: Code LAG problem! - linuxthefish - 11.06.2011

Even if the script did connect 20 times to your database, it wouldn't cause any lag. It's unlikely that 20 players will exit there vehicle at the same time!


Re : Re: Code LAG problem! - Naruto_Emilio - 11.06.2011

Quote:
Originally Posted by linuxthefish
Посмотреть сообщение
Even if the script did connect 20 times to your database, it wouldn't cause any lag. It's unlikely that 20 players will exit there vehicle at the same time!
As he said