SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 25/04/2017, 09:02 AM   #21
AbyssMorgan
High-roller
 
AbyssMorgan's Avatar
 
Join Date: Apr 2015
Location: Poland
Posts: 1,212
Reputation: 351
Default Re: Vehicle Extended Functions

Update v3.0.0:

- Merged includes EVF.inc and vehicleplus.inc -> EVF.inc

- Minor code optimizations

- Added update checker

- Added support for STREAMER_ENABLE_TAGS

- Added support for FoxForeach.inc and foreach.inc

- Added support for 3DTryg.inc (some improvements)

- Added support for StreamerFunction.inc (some improvements)

- Update compatibility for YSF.inc

- Update callbacks type CallLocalFunction -> CallRemoteFunction

- Imported functions (from vehicleplus.inc)
PHP Code:
Float:EVF::GetVehicleSpeed(vehicleid,bool:kmh true,Float:velx 0.0,Float:vely 0.0,Float:velz 0.0);

GetVehicleSpawnInfo(vehicleid,&Float:x,&Float:y,&Float:z,&Float:rotation,&worldid,&interiorid);
SetVehicleSpawnInfo(vehicleid,Float:x,Float:y,Float:z,Float:rotation,worldid,interiorid);

RemoveVehiclePaintjob(vehicleid);
Float:GetVehicleSpeedCap(vehicleid);
SetVehicleSpeedCap(vehicleid,Float:maxspeed);
DisableVehicleSpeedCap(vehicleid);
IsVehicleOccupied(vehicleid);
IsVehicleFuelToggled(vehicleid);
ToggleVehicleFuel(vehicleid,bool:toggle);
IsVehicleSticky(vehicleid);
ToggleVehicleSticky(vehicleid,bool:toggle);
IsUnoccupiedDamageToggled(vehicleid);
ToggleUnoccupiedVehicleDamage(vehicleid,bool:toggle);
IsPetrolCapDestroyToggled(vehicleid);
ToggleVehiclePetrolCapDestroy(vehicleid,bool:toggle);
RestoreVehicleHorn(vehicleid);
GetVehicleHorn(vehicleid);
SetVehicleHorn(vehicleid,soundid);
GetVehicleFuel(vehicleid);
SetVehicleFuel(vehicleid,fuel);
GetVehicleBomb(vehicleid);
IsVehicleBombed(vehicleid);
RemoveVehicleBomb(vehicleid);
SetVehicleBomb(vehicleid,time 1000);
IsVehicleBombActivated(vehicleid);

IsVehicleDamageToggled(vehicleid,type);
ToggleVehicleDamageUpdate(vehicleid,type,toggle);

TeleportVehicle(vehicleid,Float:x,Float:y,Float:z,Float:angle,worldid = -1,interiorid = -1);
GetVehicleSlotAttachedObject(vehicleid,slot);
IsObjectAttachedToVehicle(objectid,vehicleid);

EVF::UpdateVehicleDamage(vehicleid,type);
EVF::UpdateVehicleDamageStatus(vehicleid,type,update);
EVF::GetVehicleDamageStatus(vehicleid,type);

EditVehicle(playerid,vehicleid);
EditVehicleObject(playerid,vehicleid,STREAMER_TAG_OBJECT objectid); 
- Imported callbacks (from vehicleplus.inc)
PHP Code:
OnVehiclePosChange(vehicleid,Float:newx,Float:newy,Float:newz,Float:newangle,Float:oldx,Float:oldy,Float:oldz,Float:oldangle);
OnVehicleVelocityChange(vehicleid,Float:newx,Float:newy,Float:newz,Float:oldx,Float:oldy,Float:oldz);
OnVehicleHealthChange(vehicleid,Float:newhealth,Float:oldhealth);
OnVehicleFuelChange(vehicleid,newfuel,oldfuel);
OnVehicleBombDeactivate(vehicleid);
OnVehicleBombExplode(vehicleid);
OnPlayerShotVehicle(playerid,vehicleid,weaponid,Float:amount,bodypart);
OnPlayerEditVehicle(playerid,vehicleid,response,Float:fX,Float:fY,Float:fZ,Float:fRotZ);
OnPlayerEditVehicleObject(playerid,vehicleid,response,Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz);
OnPlayerReachSpeedCapLimit(playerid,vehicleid,Float:speed);
OnVehicleBombActivate(vehicleid); 
- Added functions:
PHP Code:
Float:GetVehicleModelTopSpeed(modelid);

GetVehicleModelName(modelid);
GetVehicleName(vehicleid); 
- Renamed function:
PHP Code:
GetVehicleDoorAmountByModelid -> GetVehicleModelDoorAmount 
- Updated function:
Code:
CreateVehicle(modelid,Float:x,Float:y,Float:z,Float:rotation,color1 = -1,color2 = -1,respawn_delay = -1,addsiren = 0,worldid = 0,interiorid = 0,bool:unoccupied_damage = false);
AddStaticVehicle -> CreateVehicle
AddStaticVehicleEx -> CreateVehicle
- Updated callback:
Code:
OnPlayerShotVehicle(playerid,vehicleid,weaponid,Float:amount,bodypart);
- Added definitions:
PHP Code:
RESET_PAINTJOB_ID
MAX_VEHICLE_PARAMS
VEHICLE_UPDATE_INTERVAL
MAX_VEHICLE_ATTACHED_OBJECTS

VEHICLE_BODYPART_UNKNOWN
VEHICLE_BODYPART_FL_WHEEL    
//front left
VEHICLE_BODYPART_FR_WHEEL    //front right
VEHICLE_BODYPART_BL_WHEEL    //back left
VEHICLE_BODYPART_BR_WHEEL    //back right
VEHICLE_BODYPART_PETROLCAP

VEHICLE_DAMAGE_PANELS
VEHICLE_DAMAGE_DOORS
VEHICLE_DAMAGE_LIGHTS
VEHICLE_DAMAGE_TIRES 
- Added option for change vehicle names (default English):
PHP Code:
new const EVF_VehicleName[MAX_VEHICLE_MODELS][] = {
    
"Landstalker""Bravura""Buffalo", ...
}

#include <SAM/EVF> 
Notice:
- Some vehiclesplus.inc definitions has been changed, please read include head for get actual functions/definitions
- If you see any bug of this release, send report to me, or post here.


More functions next time.
AbyssMorgan is offline   Reply With Quote
Old 25/04/2017, 09:27 AM   #22
AndreiWow
High-roller
 
AndreiWow's Avatar
 
Join Date: Nov 2014
Location: Romania, Bucharest
Posts: 1,047
Reputation: 48
Default Re: Vehicle Extended Functions

This is really useful, good job.
AndreiWow is offline   Reply With Quote
Old 30/04/2017, 02:52 PM   #23
AbyssMorgan
High-roller
 
AbyssMorgan's Avatar
 
Join Date: Apr 2015
Location: Poland
Posts: 1,212
Reputation: 351
Default Re: Vehicle Extended Functions

Update v3.0.1:

- Fix Vehicle "Jumping" bug.
AbyssMorgan is offline   Reply With Quote
Old 01/05/2017, 12:02 PM   #24
Spoookymon
Little Clucker
 
Join Date: Apr 2017
Posts: 47
Reputation: 2
Default Re: Vehicle Extended Functions

Hello, really nice job bud, i was working on EVF like this, but i gunna merge em and use this instead!
I might have some suggestions, but first i have to test it.
Spoookymon is offline   Reply With Quote
Old 16/05/2017, 08:49 AM   #25
AbyssMorgan
High-roller
 
AbyssMorgan's Avatar
 
Join Date: Apr 2015
Location: Poland
Posts: 1,212
Reputation: 351
Default Re: Vehicle Extended Functions

Update EVF v3.0.2:

- Merged includes EVF.inc and SetVehicleNeonLights.inc -> EVF.inc

- Imported functions (from SetVehicleNeonLights.inc)
PHP Code:
SetVehicleNeonLights(vehicleid,bool:enable true,color RED_NEON);
VehicleSupportsNeonLights(modelid);
GetVehicleNeonLightsState(vehicleid); 
- Added definitions:
PHP Code:
RED_NEON
BLUE_NEON
GREEN_NEON
YELLOW_NEON
PINK_NEON
WHITE_NEON 
AbyssMorgan is offline   Reply With Quote
Old 19/07/2017, 09:50 PM   #26
AbyssMorgan
High-roller
 
AbyssMorgan's Avatar
 
Join Date: Apr 2015
Location: Poland
Posts: 1,212
Reputation: 351
Default Re: Vehicle Extended Functions

Update v3.0.3:

- Fix vehicle black color bug

- Removed deprecated functions (Use GetVehiclePartPos):
PHP Code:
GetVehicleOffset
GetVehicleBoot
GetVehicleHood
GetVehicleRoof 
- Added functions:
PHP Code:
IsToggledVehicleBulletproof(vehicleid);
ToggleVehicleBulletproof(vehicleid,bool:toggle); //default is 0 
AbyssMorgan is offline   Reply With Quote
Old 20/07/2017, 02:06 AM   #27
Pottus
High-roller
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 4,833
Reputation: 1296
Default Re: Vehicle Extended Functions

How about adding an object editing module next so users have some overhead already completed to accomplish editing objects on vehicles. They would need to do all their own saving, map editor etc.

I did make a generic prototype for my own purposes on 420DayZ check this out it is used for the vehicle editing system in the RP system which is unfinished. However it could be used to edit anything you want that does not have an editing feature.

Code:
#include <YSI\y_hooks>

enum EDITPOINTDATA
{
	pEditObject,
	Float:pEditX,
	Float:pEditY,
	Float:pEditZ,
	Float:pEditRX,
	Float:pEditRY,
	Float:pEditRZ,
	
	Float:pSaveX,
	Float:pSaveY,
	Float:pSaveZ,
	Float:pSaveRX,
	Float:pSaveRY,
	Float:pSaveRZ,
	
	pEditObjectSel,
	pEditCallBack[32],
}

static pEditPoint[MAX_PLAYERS][EDITPOINTDATA];

stock PlayerEditPoint(playerid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, callback[], objectid = -1)
{
	if(pEditPoint[playerid][pEditObject] > -1)
		DestroyDynamicObject(pEditPoint[playerid][pEditObject]);

	if(objectid == -1)
	{
		pEditPoint[playerid][pEditObject] = CreateDynamicObject(1974,
					x,
					y,
					z,
					rx,
					ry,
					rz,
					-1, -1, playerid, .priority = 1);
	    SetDynamicObjectMaterial(pEditPoint[playerid][pEditObject], 0, 10765, "airportgnd_sfse", "white", -256);
	    format(pEditPoint[playerid][pEditCallBack], 32, "%s", callback);

	    pEditPoint[playerid][pEditX] = x;
	    pEditPoint[playerid][pEditY] = y;
	    pEditPoint[playerid][pEditZ] = z;
	    pEditPoint[playerid][pEditRX] = rx;
	    pEditPoint[playerid][pEditRY] = ry;
	    pEditPoint[playerid][pEditRZ] = rz;

	    pEditPoint[playerid][pSaveX] = x;
	    pEditPoint[playerid][pSaveY] = y;
	    pEditPoint[playerid][pSaveZ] = z;
	    pEditPoint[playerid][pSaveRX] = rx;
	    pEditPoint[playerid][pSaveRY] = ry;
	    pEditPoint[playerid][pSaveRZ] = rz;

		Streamer_Update(playerid);

		EditDynamicObject(playerid, pEditPoint[playerid][pEditObject]);
	}
	else
	{
		pEditPoint[playerid][pEditObjectSel] = objectid;
        EditDynamicObject(playerid, pEditPoint[playerid][pEditObjectSel]);
	}
	
	return 1;
}

stock DestroyEditPoint(playerid)
{
	if(pEditPoint[playerid][pEditObject] != -1)
	{
		DestroyDynamicObject(pEditPoint[playerid][pEditObject]);
		pEditPoint[playerid][pEditObject] = -1;
	}
	return 1;
}

hook OnGameModeInit()
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
	    pEditPoint[i][pEditObject] = -1;
	    pEditPoint[i][pEditObjectSel] = -1;
	}
	return 1;
}

hook OnFilterScriptInit()
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
	    pEditPoint[i][pEditObject] = -1;
	    pEditPoint[i][pEditObjectSel] = -1;
	}
	return 1;
}

public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
	if(objectid == pEditPoint[playerid][pEditObject] || objectid == pEditPoint[playerid][pEditObjectSel])
	{
		if(response == EDIT_RESPONSE_FINAL)
		{
		    if(pEditPoint[playerid][pEditObjectSel])
		    {
			    CallLocalFunction(pEditPoint[playerid][pEditCallBack], "iiifffffffff",
			        playerid, objectid, response,
					x,
					y,
					z,
					rx,
					ry,
					rz,
					x - pEditPoint[playerid][pSaveX],
					y - pEditPoint[playerid][pSaveY],
					z - pEditPoint[playerid][pSaveZ]);
	            DestroyEditPoint(playerid);
		    }
		    else
		    {
			    CallLocalFunction(pEditPoint[playerid][pEditCallBack], "iiifffffffff",
			        playerid, objectid, response,
					pEditPoint[playerid][pEditX],
					pEditPoint[playerid][pEditY],
					pEditPoint[playerid][pEditZ],
					pEditPoint[playerid][pEditRX],
					pEditPoint[playerid][pEditRY],
					pEditPoint[playerid][pEditRZ],
					pEditPoint[playerid][pEditX] - pEditPoint[playerid][pSaveX],
					pEditPoint[playerid][pEditY] - pEditPoint[playerid][pSaveY],
					pEditPoint[playerid][pEditZ] - pEditPoint[playerid][pSaveZ]);
	            DestroyEditPoint(playerid);
			}
		}
		else if(response == EDIT_RESPONSE_UPDATE)
		{
		    pEditPoint[playerid][pEditX] = x;
		    pEditPoint[playerid][pEditY] = y;
		    pEditPoint[playerid][pEditZ] = z;
		    pEditPoint[playerid][pEditRX] = rx;
		    pEditPoint[playerid][pEditRY] = ry;
		    pEditPoint[playerid][pEditRZ] = rz;

		    CallLocalFunction(pEditPoint[playerid][pEditCallBack], "iiifffffffff",
		        playerid, objectid, response, x, y, z, rx, ry, rz,
				pEditPoint[playerid][pEditX] - pEditPoint[playerid][pSaveX],
				pEditPoint[playerid][pEditY] - pEditPoint[playerid][pSaveY],
				pEditPoint[playerid][pEditZ] - pEditPoint[playerid][pSaveZ]);
		}
		else if(response == EDIT_RESPONSE_CANCEL)
		{
		    CallLocalFunction(pEditPoint[playerid][pEditCallBack], "iiifffffffff",
		        playerid, objectid, response,
				pEditPoint[playerid][pSaveX],
				pEditPoint[playerid][pSaveY],
				pEditPoint[playerid][pSaveZ],
				pEditPoint[playerid][pSaveRX],
				pEditPoint[playerid][pSaveRY],
				pEditPoint[playerid][pSaveRZ],
				0.0, 0.0, 0.0);
            DestroyEditPoint(playerid);
		}
	}
	return 1;
}


hook OnPlayerDisconnect(playerid, reason)
{
	DestroyEditPoint(playerid);
	return 1;
}
Pottus is offline   Reply With Quote
Old 20/07/2017, 04:36 AM   #28
SmileJack
Big Clucker
 
SmileJack's Avatar
 
Join Date: Jul 2017
Posts: 81
Reputation: 0
Default Re: Vehicle Extended Functions

Holy!, nice include man +rep
SmileJack is offline   Reply With Quote
Old 11/08/2017, 06:01 PM   #29
AbyssMorgan
High-roller
 
AbyssMorgan's Avatar
 
Join Date: Apr 2015
Location: Poland
Posts: 1,212
Reputation: 351
Default Re: Vehicle Extended Functions

Update v3.1.0:

- Fixed storing information (changed setproperty, getproperty -> array)

- Fixed vehicle meta

- Added check if vehicle is correct stored in memory

- Merged OnVehicleModEx by Emmet

- Added definitions:
PHP Code:
MIN_VEHICLE_COMPONENT_ID
MAX_VEHICLE_COMPONENT_ID 
- Added functions:
PHP Code:
GetComponentName(componentid,name[],len sizeof(name));
EVF::IsPlayerInModShop(playerid);
IsValidComponentForVehicle(vehicleid,componentid);
GetVehicleComponentPrice(componentid); 
- Added callback:
PHP Code:
OnVehicleModEx(playerid,vehicleid,componentid,price,illegal); 
- Added remote functions:
PHP Code:
EVF_ImportVehicle(vehicleid,modelid,Float:x,Float:y,Float:z,Float:angle,color1,color2,worldid,interiorid,unoccupied_damage);
EVF_RemoveVehicle(vehicleid); 
AbyssMorgan is offline   Reply With Quote
Old 22/08/2017, 04:41 PM   #30
AbyssMorgan
High-roller
 
AbyssMorgan's Avatar
 
Join Date: Apr 2015
Location: Poland
Posts: 1,212
Reputation: 351
Default Re: Vehicle Extended Functions

Update v3.1.1:

- Fixed fuel system (thanks Unrea1 for Testing)

- Removed function:
PHP Code:
EVF::GetVehicleSpeed(vehicleid,bool:kmh true,Float:velx 0.0,Float:vely 0.0,Float:velz 0.0); 
- Added function:
PHP Code:
EVF::GetVehicleSpeed(vehicleid); 
- Added definition:
PHP Code:
VEHICLE_SPEED_MULTIPLIER //allow to redefine before 3DTryg.inc and EVF.inc
MULTIPLIER_FUEL_SYSTEM   //allow to redefine before EVF.inc 
- Fixed
PHP Code:
OnVehicleModEx call for all scripts 
- Added support for foreach (iter: Vehicles or Vehicle)

- Changed definition name:
PHP Code:
MAX_VEHICLE_FUEL -> DEFAULT_VEHICLE_FUEL 
AbyssMorgan is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] Extended vehicle functions Emmet_ Includes 63 21/11/2016 09:00 PM
[Include] Extended Actor Functions Admigo Includes 16 18/10/2016 05:10 PM
[Include] Extended Actor Functions Emmet_ Includes 47 09/07/2016 08:23 AM
[Include] Extended functions on Vehicles / Seats d3ll Includes 3 04/08/2014 06:25 AM
[Include] FCNPC Extended Functions Pottus Includes 3 27/05/2014 04:37 AM


All times are GMT. The time now is 11:56 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.