Quote:
Originally Posted by dicknyson
Very simply. I have a custom function ( CreatePlayerVehicle(playerid, modelid);) to spawn vehicles for players. Included under this function is just a simple MySQL query:
Код:
"UPDATE `vehicles` SET spawns=spawns+1 WHERE model_id = [model ID of the vehicle the player spawned]"
Then, when the top vehicles dialog is loaded, it just sorts the vehicles by "spawns" descending and limits the results to 10, then it's just a case of formatting it for the dialog.
|
Why would you run a query every time a vehicle is spawned/created instead of running one query when the server starts and another one when it stops, using internal variables?