16.12.2011, 04:50
(
Last edited by [HiC]TheKiller; 16/12/2011 at 08:47 AM.
)
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>
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
List of uses here.
Download
Pastebin
Datafilehost