SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 07/01/2020, 04:42 PM   #1
DomagojSellug
Huge Clucker
 
DomagojSellug's Avatar
 
Join Date: Sep 2016
Location: Croatia
Posts: 255
Reputation: 22
Default Vehicle tires aren't bulletproof for some reason

My friend and I have been trying to fix this issue for quite some time now and it simply refuses to work. What we want is to make the Stretch's (limousine) tires bulletproof.

Well, we tried taking code from the SAMP Wiki and it isn't working, so we tried using another function which still isn't, here's our code:

pawn Code:
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{  
    if(GetVehicleModel(vehicleid) == 409)
    {
        RepairVehicleTires(vehicleid);
    }
    return 1;
}
forward public RepairVehicleTires(vehicleid);
public RepairVehicleTires(vehicleid)
{
    new panels, doors, lights, tires;  
    GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
    UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, encode_tires(0, 0, 0, 0));
    return 1;
}
encode_tires(rear_right_tire, front_right_tire, rear_left_tire, front_left_tire)
{
    return rear_right_tire | (front_right_tire << 1) | (rear_left_tire << 2) | (front_left_tire << 3);
}

I'll appreciate any response and will make sure to rep+ anyone who helps me find a solution to fix this issue.
__________________

San Andreas Multiplayer server based off Counter Strike: Global Offensive.

Join us today!

DISCORD: discord.sa-go.info
WEBSITE: http://sa-go.info
SERVER IP: samp.sa-go.info
DomagojSellug is offline   Reply With Quote
Old 07/01/2020, 05:44 PM   #2
Joe Staff
High-roller
 
Join Date: Aug 2007
Posts: 2,596
Reputation: 379
Default Re: Vehicle tires aren't bulletproof for some reason

I'm curious if OnVehicleDamageStatusUpdate is only called when the vehicle actually loses health. When a vehicles tire pops, it doesn't necessarily mean that the vehicle lost health.
Try ramming the car into a wall or something to see if that fixes the tires.
Joe Staff is offline   Reply With Quote
Old 07/01/2020, 06:11 PM   #3
DomagojSellug
Huge Clucker
 
DomagojSellug's Avatar
 
Join Date: Sep 2016
Location: Croatia
Posts: 255
Reputation: 22
Default Re: Vehicle tires aren't bulletproof for some reason

Quote:
Originally Posted by Joe Staff View Post
I'm curious if OnVehicleDamageStatusUpdate is only called when the vehicle actually loses health. When a vehicles tire pops, it doesn't necessarily mean that the vehicle lost health.
Try ramming the car into a wall or something to see if that fixes the tires.
We fixed it, I don't know if it's the best solution, but here's what I did:

In OnPlayerWeaponShot I detected if the object hit is a vehicle, and if yet, is the vehicle ID Stretch, and if yes it'll set a timer to 100 milliseconds that will fix all the tires (I made sure to optimize it as best as possible, killing the timer and shit).
__________________

San Andreas Multiplayer server based off Counter Strike: Global Offensive.

Join us today!

DISCORD: discord.sa-go.info
WEBSITE: http://sa-go.info
SERVER IP: samp.sa-go.info
DomagojSellug 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
Bulletproof tires Blocker22 Scripting Help 2 20/03/2019 10:45 PM
Bulletproof vest SukMathcuck Scripting Help 0 01/09/2015 01:24 AM
Bulletproof shield. kepa333 Scripting Help 8 16/03/2015 04:59 PM
Get position of vehicle's tires Kwashiorkor Scripting Help 6 08/03/2015 07:02 PM
vehicle/playerdeath reason PawnoQ Scripting Help 5 17/02/2014 10:17 AM


All times are GMT. The time now is 06:19 AM.


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