drivenvehicle references even to weapon pawns and it can detects player properties in driving seat or weapon pawn turrets, however youre showing onsweaponpawn(instigator) as reference to player, thats not bad, but it still fails to get the information of the actual vehicle itself.Azarael wrote:Is "DrivenVehicle" actually intended to be a reference to the player's current mode of transport? Looking through the code I would have suggested that the purpose of it is to give kill credit when a player exits a vehicle and that vehicle later somehow kills a player. Note the past tense of "Driven".
If you're checking for a player in a weapon turret, cast ONSWeaponPawn(Instigator). If you're looking for a player in a driving seat, cast (Vehicle(Instigator) != None && ONSWeaponPawn(Instigator) == None).
Im going to check its class and see if i can find something that references to owner vehicle
EDIT: ive seen a vehiclebase property of the onsweaponpawn, but the vehiclebase itself is set in unreliable if (role==Role_authority) -_- that means that it will fail to do the check on packet loss, right?
REEDIT: ONSVehicle or Vehicle(Instigator) returns false even when in driver seat, how is so?