SA-MP Forums Archive
Vehicles won't get damaged, any way around it? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Vehicles won't get damaged, any way around it? (/showthread.php?tid=606002)



Vehicles won't get damaged, any way around it? - AlterEGO - 28.04.2016

Hi, so I recently started using the SetPlayerTeam function to make my damage system work better, though now vehicles won't get damaged AT ALL. I've read that the EnableVehicleFriendlyFire() goes around it. So I placed in in my OnGameModeInit. But still, it won't work. I've tried removing the EnableVehicleFriendlyFire function. Still no luck, anyway around this?


Re: Vehicles won't get damaged, any way around it? - AlterEGO - 28.04.2016

No one knows?


Re: Vehicles won't get damaged, any way around it? - AlterEGO - 29.04.2016

So there's no way around it?
I'd like to know.


Re: Vehicles won't get damaged, any way around it? - BurnZ - 29.04.2016

I honestly don't know, but that's just a stupid answer.


Re: Vehicles won't get damaged, any way around it? - CROSS_Hunter - 29.04.2016

So what exactly happens, the vehicle doesn't lose any health when it crashes or takes fire shots? I don't quite get your problem over here maybe I am just dumb but, it sounds awkward to me, mind if you elaborate it a little bit more?


Re: Vehicles won't get damaged, any way around it? - CalvinC - 29.04.2016

Are you possibly returning 0 in OnPlayerWeaponShot when they're the same team or something?


Re: Vehicles won't get damaged, any way around it? - Manyula - 29.04.2016

SetPlayerTeam only prevents damage caused to the players themselves. Even with all players set to one team they should be able to damage each other's vehicles. EnableVehicleFriendlyFire() actually does the opposite of what you think it does. It prevents vehicle damage from players of the same team rather than allowing it.

If it still doesn't work, we'd have to take a closer look at how you handle damage in general.


Re: Vehicles won't get damaged, any way around it? - AlterEGO - 29.04.2016

Quote:
Originally Posted by Manyula
Посмотреть сообщение
SetPlayerTeam only prevents damage caused to the players themselves. Even with all players set to one team they should be able to damage each other's vehicles. EnableVehicleFriendlyFire() actually does the opposite of what you think it does. It prevents vehicle damage from players of the same team rather than allowing it.

If it still doesn't work, we'd have to take a closer look at how you handle damage in general.
What I did was to define damage for certain weapons and then obtain taken damage into count. If the player takes more then 70 damage then he's injured.


Re: Vehicles won't get damaged, any way around it? - CalvinC - 29.04.2016

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
Are you possibly returning 0 in OnPlayerWeaponShot when they're the same team or something?
Did you check if you're returning 0 anywhere in OnPlayerWeaponShot?
Because even with players on the same team they still should damage eachothers vehicles.


Re: Vehicles won't get damaged, any way around it? - AlterEGO - 27.05.2016

bump