[Include] Vehicle Control | 0.0.1
#1

This is an outdated version. Go here for the newest version http://forum.sa-mp.com/showthread.ph...32#post2672032

Vehicle Control

Greetings SAMP Community.
I have made an include which allows to the scripter to control vehicle parts much easier & faster.

How to import the include to my filterscript/gamemode?
Add this line at the top of your gamemode
pawn Код:
#include <vehiclecontrol>
Current Functions
pawn Код:
TurnVehicleEngineOn(vehicleid); // Turns on the vehicle engine
TurnVehicleEngineOff(vehicleid); // Turns off the vehicle engine
OpenBonnet(vehicleid); // Opens your vehicle bonnet.
CloseBonnet(vehicleid); // Closes your vehicle bonnet.
OpenBoot(vehicleid); // Opens your vehicle boot.
CloseBoot(vehicleid); // Closes your vehicle boot.
LockVehicle(vehicleid); // Locks your current vehicle.
UnlockVehicle(vehicleid); // Unlocks your current vehicle
TurnOnVehicleLights(vehicleid); // Turns on your vehicle Lights
TurnOffVehicleLights(vehicleid); // Turns off your vehicle Lights
TurnOnAlarm(vehicleid); // Turns on the Alarm of the vehicle
TurnOffAlarm(vehicleid); // Turns off the Alarm of the vehicle
VehicleID(playerid); // Gets the ID of the vehicle you are currently inside
IsVehicleEngineOn // Will Check if the engine is on
IsVehicleLightsOn // Will Check if the lights is on
IsBonnetOpen // Will Check if the bonnet is open
IsBootOpen // Will Check if the boot is open
IsAlarmOn // Will check if the alarm is on
DeleteVehicle(vehicleid); // Will delete your current vehicle
SpawnVehicle(vehicleid); // Will spawn the vehicleid in your current position
Upcoming Functions on Update 0.0.3
pawn Код:
AddNitroEx(vehicleid); // Will install nitro to the car
AddHydraulicsEx(vehicleid); // Will install hydraulics to the car
RemoveNitroEx(vehicleid); // Will remove nitro from the car
RemoveHydraulicsEx(vehicleid); // Will remove hydraulics from the car
TeleportVehicleTo(playerid); // Will teleport the vehicle to the given player id
DeleteAllVehicles(); // Will delete all the vehicles from the game
EjectPlayersFromVehicle(); // Will eject other players out of your vehicle
IsPlayerNearVehicle(playerid, vehicleid) // Will check if the player is range of a vehicle
Usage Example
pawn Код:
// Version 0.0.1
CMD:engine(playerid, params[])
{
TurnOnVehicleEngine(VehicleID(playerid));
return 1;
}

// Version 0.0.2
public OnFilterScriptInit()
{
RepairAllVehicles(); // Once the Filterscript is loaded all the vehicles will get fixed
return 1;
}

CMD:engine(playerid, params[])
{
if(IsVehicleEngineOn(VehicleID(playerid)) return SendClientMessage(playerid, -1, "Your engine is already on");
else return SendClientMessage(playerid, -1, "Engine turned on!");
return 1;
}

CMD:deletemyvehicle(playerid, params[])
{
DeleteVehicle(playerid); // Deletes your current vehicle
return 1;
}

CMD:spawnturismo(playerid, params[])
{
SpawnVehicle(playerid, 451); // Spawns vehicle ID 451( Turismo ) at your position
return 1;
}
Possible Bugs
TurnOnVehicleLights might be a bit bugged.

Download
Currently I will upload it in pastebin

Version 0.0.2
Pastebin

Version 0.0.1
Pastebin

Feel free to leave a feedback & suggestions.
Reply


Messages In This Thread
Vehicle Control | 0.0.2 - by Alexis1999 - 29.07.2012, 11:32
Re: Vehicle Control | 0.0.1 - by Niko_boy - 29.07.2012, 11:43
Re: Vehicle Control | 0.0.1 - by Blunt - 29.07.2012, 11:54
Re: Vehicle Control | 0.0.1 - by Alexis1999 - 29.07.2012, 12:11
Re: Vehicle Control | 0.0.1 - by TheArcher - 29.07.2012, 12:27
Re: Vehicle Control | 0.0.2 - by Alexis1999 - 29.07.2012, 18:35
Re: Vehicle Control | 0.0.1 - by Blunt - 29.07.2012, 19:27
Re: Vehicle Control | 0.0.1 - by s0up - 29.07.2012, 20:51
Re: Vehicle Control | 0.0.1 - by FireCat - 29.07.2012, 22:40
Re: Vehicle Control | 0.0.1 - by TheArcher - 29.07.2012, 23:10

Forum Jump:


Users browsing this thread: 1 Guest(s)