SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 07/07/2019, 07:11 PM   #1
Corin
Little Clucker
 
Corin's Avatar
 
Join Date: Jan 2017
Posts: 15
Reputation: 0
Default Do not repair a motorcycle tire

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
Corin is offline   Reply With Quote
Old 08/07/2019, 08:01 AM   #2
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,177
Reputation: 73
Default Re: Do not repair a motorcycle tire

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.
__________________
Coding in 8 languages including Pawn, C#, C++ and SQL.
Available for hiring.

If you have a coding question or need an assistance in a code, just PM me.
If you want me to create something for you, here is a Discord Mugala#5651

Currently helping Community members in a coding.
Mugala is offline   Reply With Quote
Old 11/07/2019, 02:26 AM   #3
Corin
Little Clucker
 
Corin's Avatar
 
Join Date: Jan 2017
Posts: 15
Reputation: 0
Default Re: Do not repair a motorcycle tire

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 ?
Corin is offline   Reply With Quote
Old 11/07/2019, 06:48 AM   #4
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,177
Reputation: 73
Default Re: Do not repair a motorcycle tire

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;
    }

__________________
Coding in 8 languages including Pawn, C#, C++ and SQL.
Available for hiring.

If you have a coding question or need an assistance in a code, just PM me.
If you want me to create something for you, here is a Discord Mugala#5651

Currently helping Community members in a coding.
Mugala 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
[Off] [MAP]Motorcycle club bar BarbaNegra Português/Portuguese 17 16/02/2018 01:17 AM
[Projeto] Motorcycle Club - SA:MP Caiton Português/Portuguese 31 10/06/2017 04:41 PM
[FilterScript] [FS] Helmet on motorcycle. whando Filterscripts 10 20/11/2013 12:07 PM
[Map] [INT]Motorcycle Clup Cebo Maps 6 02/08/2012 11:33 AM
Motorcycle sign? Haydn Everything and Nothing 7 24/10/2011 06:02 AM


All times are GMT. The time now is 08:11 AM.


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