29.07.2012, 11:32
(
Последний раз редактировалось Alexis1999; 26.08.2013 в 08:43.
Причина: Updating to version 0.0.2
)
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
Current Functions
Upcoming Functions on Update 0.0.3
Usage Example
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.
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>
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
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
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;
}
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.