parts of the vehicle
#1

Hello

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

tank, trunk, hood

++
Reply
#2

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

use evf or vehicleplus its more friendly
Reply
#4

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;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)