Posts: 280
Threads: 45
Joined: Jun 2008
Reputation:
0
Is it possible to increase the damage Rustlers create when firing their guns?
Posts: 280
Threads: 45
Joined: Jun 2008
Reputation:
0
If I used OnPlayerShootPlayer and checked if they were in a rustler, would it work?
Posts: 508
Threads: 9
Joined: Dec 2010
Reputation:
0
Maybe, if the OnPlayerShootPlayer calls when you shoot with the vehicle on the player...
Posts: 4,878
Threads: 85
Joined: Jun 2007
Reputation:
0
It wont work, at least not in the way you want it to work. OnPlayerShootPlayer uses (if you are using wups' include) the cameravector. But in a rustler you are not shooting in the direction you look at, but in the direction of the rustler.
You would need to get the vehicles directional vector (with the quaternion stuff, there are functions to convert it to a vector here in the forum) and use it instead of the GetPlayerCameraFrontVector. And you would need to use GetVehiclePos instead of GetPlayerCameraPos, then it should work quite accurate.
This should just be a small modification with IsPlayerInAnyVehicle(), would be a nice suggestion for wups' include.