Do not repair a motorcycle tire
#1

Hi everyone, I need your help, I have this command that fixes the tire of the vehicle that the player is close to, but it does not work with the tires of the bikes, with other vehicles works perfectly, but with the bikes of this error "This tire no need for repairs! "

I posted on pastebin.com since it is very large.

https://pastebin.com/eupvz2WC

I thank you all <3
Reply
#2

Hi, I think that problem is in GetPlayerVehicleWeel, code ends before it reachs bike parts.
try adding model check for bikes or move bike code above.
Reply
#3

Quote:
Originally Posted by Mugala
View Post
Hi, I think that problem is in GetPlayerVehicleWeel, code ends before it reachs bike parts.
try adding model check for bikes or move bike code above.
In which part ?
Reply
#4

like this, but make sure you're using correct Model IDs.
PHP Code:
stock GetPlayerVehicleWeel(playeridvehicleid)
{
    static
        
Float:x,
        
Float:y,
        
Float:z;
 
    if(
IsABike(vehicleid))
    {
        
// Behind left
        
GetVehicleWheelPos(vehicleidWHEELSFRONT_LEFTxyz);
        if (
IsPlayerInRangeOfPoint(playerid1.2xyz)) return BIKE_TIRE_FRONT;
    
        
// Right back
        
GetVehicleWheelPos(vehicleidWHEELSREAR_LEFTxyz);
        if (
IsPlayerInRangeOfPoint(playerid1.2xyz)) return BIKE_TIRE_REAR;
    }
    else
    {
        
// Left front
        
GetVehicleWheelPos(vehicleidWHEELSFRONT_LEFTxyz);
        if (
IsPlayerInRangeOfPoint(playerid1.2xyz)) return CAR_TIRE_FRONT_LEFT;
     
        
// Right Front
        
GetVehicleWheelPos(vehicleidWHEELSREAR_LEFTxyz);
        if (
IsPlayerInRangeOfPoint(playerid1.2xyz)) return CAR_TIRE_REAR_LEFT;
     
        
// Middle left
        
GetVehicleWheelPos(vehicleidWHEELSFRONT_RIGHTxyz);
        if (
IsPlayerInRangeOfPoint(playerid1.2xyz)) return CAR_TIRE_FRONT_RIGHT;
     
        
// Middle right
        
GetVehicleWheelPos(vehicleidWHEELSREAR_RIGHTxyz);
        if (
IsPlayerInRangeOfPoint(playerid1.2xyz)) return CAR_TIRE_REAR_RIGHT;    
    }
    return -
1;
}

stock IsABike(vehicleid)
{
    
//u can make a switch or create new array for bike model ids.
    
switch(GetVehicleModel(vehicleid))
    {
        case 
WayfarerModelID: return true//change that values to the actual bike model IDs
        
case FreewayModelID: return true; ..
        default: return 
false;
    }

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)