[Include] Vehicle Saving and loading in one line!
#1

Vehicle Saving and loading in one line


Introduction
I was just bored yesterday, so I decided to make a little script that could save and load vehicles into different 'slots' in the database. This means that you can save unlimited vehicles for a certain player and load them later on. I haven't released anything in a while, so I thought I might as well just release this because I don't have a use for it .

Scripting
This is an include, so you include it into your gamemode or filterscript. You can do this by downloading the vehiclesave.inc and then placing it in your sa-mp server directory -> PAWNO -> Include. Then just chuck the functions in your gamemode / filterscript wherever. Lastly, put the following at the top of your script:
pawn Code:
#include <vehiclesave>
I do have parts of Ryder's GetVehicleColor include but I needed to add extra to it / edit it slightly, so it was included into the include. It uses SQLite and won't need to set anything up, just run it really. It may not be amazingly efficient, but I'll make it better later on if anyone actually wants to use this .

Functions
pawn Code:
native SaveVehicle(playerid, slotid = 1) //Saves the vehicle a player is in in a specific slot
native LoadVehicle(playerid, slotid = 1, type = TYPE_CREATE_VEHICLE, respawntime = 999999999999) //loads a player vehicle for the player
native DoesPlayerHaveVehicleInSlot(playerid, slotid) //This just checks if there is any vehicle in the chosen slot for a certain player
native GetVehicleModelInSlot(playerid, slotid) //Gets the model of the vehicle in a certain slot.
native DeleteVehicleInSlot(playerid, slotid) //Deletes a vehicle in a certain slot
native CountPlayerVehicles(playerid) //Gives a count of how many vehicles a player has
native ReturnPlayerVehicleSlots(playerid, arraydest[]) //This will put all slots that a player is currently using into an array
native GetTotalVehiclesSaved() //Gets the total vehicles saved for the server
Usage
List of uses here.

Download
Pastebin
Datafilehost
Reply
#2

great job!!!!!! is amazing
Reply
#3

awesome work..
Reply
#4



enjoy
Reply
#5

I love you!

Nice one! +rep
Reply
#6

Exelent!!! this is great, very usseful
Reply
#7

Nice job man, thanks !!
Reply
#8

Great Release, Definantly will be using this, Again another good one from Killer, rep+!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)