26.08.2013, 08:41
If you would like to use my old version here https://sampforum.blast.hk/showthread.php?tid=364004
Vehicle Control
After some great response from the previous version I decided to rewrite the include making it even more functional & easier to use then before.
How to import the include to my filterscript/gamemode?
Add this line at the top of your gamemode
How to use vehicle control?
The new vehicle control comes with some new functions easy & tidy to use.
Usage
Now you may be wondering, how the heck do I use those functions? Well I'm here to explain .
VehicleControl
Vehicle Control comes with some command actions which you must give. The command actions are not case sensitive meaning either you use CAPS either not it will still work the same.
Now before learning all the available commands you might want to know the syntax of the whole line and that would be.
And a more in depth example
Current Available Commands ( VehicleControl )
Since the names of the actions are pretty much obvious I dont need to sit explaining one by one and instead I will make a list.
The Function includes a syntax scan method meaning if you type incorrect a command to your script it will return an error message letting you know that the command you wrote does not exist.
VCBool
With VCBool we can get vehicle parts status as for example if the engine is turned on or off. Pretty easy to use aswell.
Correct Usage Example:
Available Statements for VCBool
VCCreate
This function creates vehicles to target playerid given either by name or by vehicle ID.
Syntax:
Example Usage:
VCCreateEx
This is a more advanced version of VCCreate which allows you to specify the input vehicleid.
Syntax:
Example:
Using ZCMD
or if you would like it to work only with numbers
And that should be a very simple vehicle spawner with almost no effort at all!
Hope you like this. Cheers!
Download
http://pastebin.com/DHPxRmd5
Feel free to leave any suggestions you would like to see on future version.
After some great response from the previous version I decided to rewrite the include making it even more functional & easier to use then before.
How to import the include to my filterscript/gamemode?
Add this line at the top of your gamemode
pawn Код:
#include <vehiclecontrol>
The new vehicle control comes with some new functions easy & tidy to use.
Код:
VehicleControl VCBool VCCreate VCCreateEx
Now you may be wondering, how the heck do I use those functions? Well I'm here to explain .
VehicleControl
Vehicle Control comes with some command actions which you must give. The command actions are not case sensitive meaning either you use CAPS either not it will still work the same.
Now before learning all the available commands you might want to know the syntax of the whole line and that would be.
pawn Код:
VehicleControl(playerid, COMMAND[]);
pawn Код:
VehicleControl(playerid, "ActivateEngine");
Current Available Commands ( VehicleControl )
Since the names of the actions are pretty much obvious I dont need to sit explaining one by one and instead I will make a list.
Код:
ActivateEngine, DeactivateEngine, ActivateLights, DeactivateLights, EnableAlarm, DisableAlarm, UnlockVehicle, LockVehicle, OpenBonnet, CloseBonnet, OpenBoot, CloseBoot DeleteVehicle
VCBool
With VCBool we can get vehicle parts status as for example if the engine is turned on or off. Pretty easy to use aswell.
Correct Usage Example:
pawn Код:
if(VCBool(playerid, "IsVehicleEngineOn")) {
SendClientMessage(playerid, -1, "Your vehicle engine is ON!");
} else {
SendClientMessage(playerid, -1, "Your vehicle engine is OFF!");
}
Код:
IsVehicleEngineOn, IsVehicleLightsOn, IsVehicleBonnetOpen, IsVehicleBootOpen, IsVehicleAlarmOn,
This function creates vehicles to target playerid given either by name or by vehicle ID.
Syntax:
pawn Код:
VCCreate(playerid, VehicleName[], ColorA, ColorB);
pawn Код:
VCCreate(playerid, "Infernus", 0, 0);
This is a more advanced version of VCCreate which allows you to specify the input vehicleid.
Syntax:
pawn Код:
VCCreateEx(playerid, Format[], Vehicle[], ColorA, ColorB);
Using ZCMD
pawn Код:
CMD:v(playerid, params) {
VCCreateEx(playerid, "%s", params, 0, 0);
}
pawn Код:
CMD:v(playerid, params) {
VCCreateEx(playerid, "%i", params, 0, 0);
}
Hope you like this. Cheers!
Download
http://pastebin.com/DHPxRmd5
Feel free to leave any suggestions you would like to see on future version.