SA-MP Forums Archive
[Include] Vehicle Saving and loading in one line! - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Vehicle Saving and loading in one line! (/showthread.php?tid=303928)



Vehicle Saving and loading in one line [SQLite] - [HiC]TheKiller - 16.12.2011

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


Respuesta: Vehicle Saving and loading in one line! - jurgen - 16.12.2011

great job!!!!!! is amazing


Re: Vehicle Saving and loading in one line! - kizla - 16.12.2011

awesome work..


Re: Vehicle Saving and loading in one line! - Lorenc_ - 16.12.2011



enjoy


Re: Vehicle Saving and loading in one line! - fiki574 - 16.12.2011

I love you!

Nice one! +rep


Respuesta: Vehicle Saving and loading in one line! - [Nikk] - 16.12.2011

Exelent!!! this is great, very usseful


Respuesta: Vehicle Saving and loading in one line! - Adoniiz - 17.12.2011

Nice job man, thanks !!


Re: Vehicle Saving and loading in one line! - -Rebel Son- - 17.12.2011

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