VCF - Vehicle Component Functions -
MBJ - 14.06.2018
Introduction
This include was made in order to facilitate the manipulation of the state of the vehicle components in the use of the
GetVehicleDamageStatus, because the function uses bits to manipulate the states and as this is not a well-known subject in Pawn, I decided to develop this include to do the "heavy" work
BUGS
The include is still in a BETA version and may contain bugs, in the tests that I did, there were none, but there may be some that I have not seen in the tests, if any, et me know as soon as possible to update.
Functions
Include now has the following functions:
PHP Code:
// Check this light is on or off
IsLightEnabled(vehicleid, light, lightSide)
// Changes the light status
ToogleLightState(vehicleid, light, lightSide)
// Get the current state of one of the vehicle doors
// Note: Hood and trunk are considered doors in SA-MP
GetDoorState(vehicleid, door)
// Changes the state of one of the vehicle doors
SetDoorState(vehicleid, door, doorState)
// Check that the tire is inflated
IsTireInflated(vehicleid, tire)
// Change tire condition
ToogleTireState(vehicleid, tire)
Download
GitHub
Re: VCF - Vehicle Component Functions -
cuber - 14.06.2018
Useful, but why did you upload an amx file in GitHub?
Re: VCF - Vehicle Component Functions -
MBJ - 14.06.2018
an FS showing the operation of include, for who wants to see it working without having to develop a system just to see what she does
/car [ modelid ] - create a vehicle
/door [ vehicleid ] - command to fix doors
/light [ vehicleid ] - command to change the state of the lights
Note: The lights only works if the game time is at night
Re: VCF - Vehicle Component Functions -
Pottus - 15.06.2018
Just going to point out it doesn't make sense to use "Alter" instead of "Set" that is rather confusing.
Re: VCF - Vehicle Component Functions -
Sasino97 - 15.06.2018
Quote:
Originally Posted by Pottus
Just going to point out it doesn't make sense to use "Alter" instead of "Set" that is rather confusing.
|
Exactly.
Re: VCF - Vehicle Component Functions -
MBJ - 29.09.2018
@Updated
- removed tags
- renamed functions
- add hook OnVehicleDamageStatusUpdate
Re: VCF - Vehicle Component Functions -
RogueDrifter - 30.09.2018
Well it’s clean code unlike most of the stuff being released nowadays so props on that, i also made a quick PR make sure u check it out, gj.
Here’s a file containing the BBcode converted by Y_Less’s forum enhancer (File is attached).
It would look like this:
VCF
Installation
Simply install to your project:
Code:
sampctl package install MrKnockout/VCF
Include in your code and begin using the library:
Usage
Code:
// Check this light is on or off
IsLightEnabled(vehicleid, light, lightSide);
// Changes the light status
ToogleLightState(vehicleid, light, lightSide);
/* Get the current state of one of the vehicle doors
Note: Hood and trunk are considered doors in SA-MP */
GetDoorState(vehicleid, door);
// Changes the state of one of the vehicle doors
SetDoorState(vehicleid, door, doorState);
// Check that the tire is inflated
IsTireInflated(vehicleid, tire);
// Change tire condition
ToogleTireState(vehicleid, tire);
Testing
To test, simply run the package:
Code:
sampctl package run
Re: VCF - Vehicle Component Functions -
NoahF - 02.10.2018
Extremely useful for RP scripts, and just about anything in between, honestly! Nice work, I've been waiting to see something like this released.