Jump to content
  • 0

alternative for cursortarget ?


StiflersM0M

Question

Hey, i trying to disallow damage from the chaingun of the suv against a metal gate/door,

 

And hell yeah its working, but you can really easy exploit it,

 

The script check if the cursortarget is a metal gate/door, and if yes its delete the bullet.

 

but you can simply view in another direction with "alt", and then the cursortarget is not a metal gate/door but the gun still facing in the direction of the metal gate/door and it will not delete the bullet if you shoot,

 

so do anyone know how i can prevent this ?

 

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Oh, sorry. I misread what what your wrote XD

I can't really think of any alternatives apart from maybe adding an event handler to the doors. Use that to trace back and find what kind of weapon fired the round. If it came from an SUV minigun, set damage back to what it was prior to being hit by the bullet. That does seem awfully like overkill though. I'll have a play around with some stuff tomorrow when I'm more than 10% awake and see if I can't find anything to help you.

Link to comment
Share on other sites

  • 0

this is my actually even handler for the vehicle:

_veh = vehicle player;
_veh addEventHandler ["Fired",{
_doors = ["Land_DZE_GarageWoodDoorLocked","Land_DZE_LargeWoodDoorLocked","Land_DZE_WoodDoorLocked","CinderWallDoorLocked_DZ","CinderWallDoorSmallLocked_DZ"];
_ct = typeof cursorTarget;
_veh = vehicle player;
_wpn = _this select 1;
if (_wpn == "M134") then {
_veh switchCamera "GUNNER";
};
if (_ct in _doors) then {
deleteVehicle (_this select 6);
};}];

and of course :D it works this way, but i dont know how i can set it to the vehicle on server startup, via server monitor it wont work because the vehicle is local to the server at this time....

Link to comment
Share on other sites

  • 0

I'd say put it clientside, and just have a small loop running. If the player gets in an Armored SUV add the event handler locally if it's not been added already. This would also cover ArmoredSUVs bought mid-session that wouldn't be covered at server start up.

Link to comment
Share on other sites

  • 0

I'd say put it clientside, and just have a small loop running. If the player gets in an Armored SUV add the event handler locally if it's not been added already. This would also cover ArmoredSUVs bought mid-session that wouldn't be covered at server start up.

Yes exact that i did :P and it works, got a sleep 30; in the loop and there is no problem or performance lost with it. ty anyway.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...