Vehicle spawning with MySQL
#1

I've created a vehicle spawning command. You type /v with no parameters, and a dialog opens that shows the top 10 vehicles that are spawned the most:
Or, you can type /v with a vehicle model ID or (part of) a vehicle name and it will spawn it. Fairly simple like most vehicle spawning systems, apart from that it just uses MySQL.

I have a table called "vehicles" with 4 fields: model_id, name, prefix, and spawns. It looks like this:

and so on for each vehicle.

The prefix field obviously makes correct grammar a lot easier in the client messages. I usually see "You have spawned a Infernus" and it drives me crazy.

Also, the amounts of spawns are automatically incremented when a vehicle is spawned so it shows accurate data about which vehicles players are driving the most and makes it easier for players to find their favourite vehicles.

It looks neater not having that huge array of vehicle names in my gamemode too.

What do you guys think about the idea of systems relying almost entirely on a database? I'm not sure (haven't tested) if it makes it slower or not, but I don't think it's noticeable if it does.
Reply


Messages In This Thread
Vehicle spawning with MySQL - by dicknyson - 31.05.2016, 15:40
Re: Vehicle spawning with MySQL - by Luis- - 31.05.2016, 15:50
Re: Vehicle spawning with MySQL - by iKevin - 31.05.2016, 16:08
Re: Vehicle spawning with MySQL - by Luis- - 31.05.2016, 16:17
Re: Vehicle spawning with MySQL - by Ritzy2K - 31.05.2016, 16:31
Re: Vehicle spawning with MySQL - by dicknyson - 31.05.2016, 16:32
Re: Vehicle spawning with MySQL - by Lordzy - 31.05.2016, 16:33
Re: Vehicle spawning with MySQL - by dicknyson - 31.05.2016, 16:43
Re: Vehicle spawning with MySQL - by Boar - 04.06.2016, 16:31
Re: Vehicle spawning with MySQL - by SickAttack - 04.06.2016, 17:02

Forum Jump:


Users browsing this thread: 1 Guest(s)