SA-MP Forums Archive
parts of the vehicle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: parts of the vehicle (/showthread.php?tid=641484)



parts of the vehicle - Chipardeur - 16.09.2017

Hello

I try to find out if you can detect the parts of the vehicle (when the player is on foot)

tank, trunk, hood

++


Re: parts of the vehicle - Misiur - 16.09.2017

Check out https://sampwiki.blast.hk/wiki/GetVehicleModelInfo
You might need some trig math


Re: parts of the vehicle - SetPlayerNameTag - 16.09.2017

use evf or vehicleplus its more friendly


Re: parts of the vehicle - AbyssMorgan - 16.09.2017

Quote:
Originally Posted by SetPlayerNameTag
Посмотреть сообщение
use evf or vehicleplus its more friendly
EVF.inc only support wheel and petrolcap vehicleplus is already implemented in EVF
PHP код:
/*
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
*/
public OnPlayerShotVehicle(playerid,vehicleid,weaponid,Float:amount,bodypart){
    return 
1;

//edit
Compare for all vehicle parts is possible with 3DTryg.inc
PHP код:
GetVehiclePartPos(vehicleid,partid,&Float:tx,&Float:ty,&Float:tz,Float:offset_x=0.0,Float:offset_y=0.0,Float:offset_z=0.0); 
/*
VEHICLE_PART_RFTIRE         - Right Front tire
VEHICLE_PART_LFTIRE         - Left Front tire
VEHICLE_PART_RRTIRE         - Right Rear tire
VEHICLE_PART_LRTIRE         - Left Rear tire 
VEHICLE_PART_HOOD           - In Front
VEHICLE_PART_TRUNK          - Behind 
VEHICLE_PART_ROOF           - Roof
VEHICLE_PART_CHASSIS        - Chassis
VEHICLE_PART_PETROLCAP      - Petrolcap
*/
public OnPlayerWeaponShot(playerid,weaponid,hittype,hitid,Float:fX,Float:fY,Float:fZ){
    if(
hittype == BULLET_HIT_TYPE_VEHICLE){
        
GetWeaponShotPos(playerid,hittype,fX,fY,fZ);
        
        
//compare shot pos and part pos
        
    
}
    return 
1;