OnPlayerWeaponShot when shooting a driver/passenger
#2

I don't know if this will be of much help but it may be somewhat related to this issue.

When a player is on foot, then CPlayer* points to the player itself. However, when a player is on a vehicle, CPlayer* points to the vehicle the player is driving.

I suspect that this goes on in samp too, and that's why the hittype is BULLET_HIT_TYPE_VEHICLE and the hitid = player's vehicleid.

(Guess as to what happens below)
The game checks for the CPlayer * directly to see what the player id's is (keep in mind that in samp the player pointer points to the first element, the id) to see what the player id is, and since that player is in a vehicle, then the hitid becomes that vehicle's id, and therefore the type is assigned BULLET_HIT_TYPE_VEHICLE.

(A possible fix?)
In that part of the code where the callback is evaluated, there should be some check to see if the dereferenced CPlayer* points to the actual player in question. Perhaps this can be done by checking one of the "unique" members for each "object" and to determine that way if the dereferenced object in question is either a car or a player.

I apologize for my confusing input, but this hopefully gives idea on how to go in the right direction to solve this.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)