PDA

View Full Version : Do not repair a motorcycle tire


Corin
07/07/2019, 07:11 PM
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

Mugala
08/07/2019, 08:01 AM
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.

Corin
11/07/2019, 02:26 AM
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 ?

Mugala
11/07/2019, 06:48 AM
like this, but make sure you're using correct Model IDs.stock GetPlayerVehicleWeel(playerid, vehicleid)
{
static
Float:x,
Float:y,
Float:z;

if(IsABike(vehicleid))
{
// Behind left
GetVehicleWheelPos(vehicleid, WHEELSFRONT_LEFT, x, y, z);
if (IsPlayerInRangeOfPoint(playerid, 1.2, x, y, z)) return BIKE_TIRE_FRONT;

// Right back
GetVehicleWheelPos(vehicleid, WHEELSREAR_LEFT, x, y, z);
if (IsPlayerInRangeOfPoint(playerid, 1.2, x, y, z)) return BIKE_TIRE_REAR;
}
else
{
// Left front
GetVehicleWheelPos(vehicleid, WHEELSFRONT_LEFT, x, y, z);
if (IsPlayerInRangeOfPoint(playerid, 1.2, x, y, z)) return CAR_TIRE_FRONT_LEFT;

// Right Front
GetVehicleWheelPos(vehicleid, WHEELSREAR_LEFT, x, y, z);
if (IsPlayerInRangeOfPoint(playerid, 1.2, x, y, z)) return CAR_TIRE_REAR_LEFT;

// Middle left
GetVehicleWheelPos(vehicleid, WHEELSFRONT_RIGHT, x, y, z);
if (IsPlayerInRangeOfPoint(playerid, 1.2, x, y, z)) return CAR_TIRE_FRONT_RIGHT;

// Middle right
GetVehicleWheelPos(vehicleid, WHEELSREAR_RIGHT, x, y, z);
if (IsPlayerInRangeOfPoint(playerid, 1.2, x, y, z)) 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;
}
}