22.12.2011, 18:00
(
Last edited by Tee; 02/06/2012 at 06:19 PM.
)
Dynamic Vehicle System - by Tee
- Introduction
Hey, it's me again, with my first include. Well today I'm releasing a Dynamic Vehicle System which would sort of eliminate the use of the AddStaticVehicle and AddStaticVehicleEx functions used to add vehicles to a gamemode. With this users can add vehicles to their MySQL database with one command, and have total control over the vehicle (mods, plate and color). I decided to make this filterscript while updating my server because I wanted to change the vehicles and I didn't want to have to go in each one and use the /save command then add it to my gamemode.
- Question?
Q: What will happen to vehicles I already have?
A: There is a function located at the bottom of the script (d_AddVehiclesToDatabase())
Copy it to your gamemode, uncomment it, and add d_AddVehiclesToDatabase(); under OnGameModeInit then load your script
NOTE: RUN IT ONLY 1 time! *
- Features
- Add vehicle to database.
- Remove vehicle from database.
- Change vehicle color.
- Change vehicle plate.
- Add modifications to vehicle.
- Features listed above are all done in-game.
- Installation & Equipment
For this to your you must have a server that is MySQL and 0.3d compatible.
All other includes are provided in the file.
To install:
1. Copy the file from "pawno/include" located in this file, to your "pawno/include" folder (on your computer)
2. Copy the files from "include" located in this file, to your "include" folder (this folder is located in the same directory as the server.cfg)
3. Go to your database and import the sql table located in this file ("dvehicles.sql")
4. Go to your server, log into RCON and type /dvcmds.
- Commands
- /setdveh - Spawns and saves the vehicle in the database (you'll need to be in a vehicle to use this)
- /setdcol - Changes the vehicle's color.
- /setdplate - Changes the vehicle's numberplate.
- /deletedveh - Deletes the vehicle.
- /dmodstart - Start the modification process (optional). Whenever you type this, you can go to a tune shop and add the modifications to the vehicle
- /dmodcomplete - Stops the modification process.
- /removedmods
I couldn't bother to make a video so here's a picture:
![](http://i40.tinypic.com/xd8tgk.png)
- Downloads
SA-MP Color Picker - GTAGarage
Version 1.0 (0.3d) - solidfiles
Version 1.5 (0.3d) - solidfiles (Mod reset bug fixed in this version, thanks to Kar for discovering it)
- Credits
Credits:
SA-MP Team
ZCMD - Zeex
MySQL plugin - Blue-G
GetVehicleColor - Credits to whoever made this.
sscanf 2.0 - ******
zone - Credits to whoever made this (I compiled it into an include).
dveh - Tee
SA-MP Color picker - UZI-I (I used it to pick the colors, you can download it here)
*If you run the "d_AddVehiclesToDatabase" function more than one time, then you'll have vehicle duplicates, so when you've ran it the first time, just remove it from your script.