Announcement

Collapse
No announcement yet.

Vehicle HUD change

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Vehicle HUD change

    What is the best method to change the HUD or display new things on the current HUD only when in a certain vehicle? (putting the code within that vehicle's class)

    #2
    Each HUD has a PawnOwner variable, which is always the pawn that the hud curently belongs to. Since Vehicles are pawns too, when you are in a vehicle, the PawnOwner is a vehicle. You can use this to change what is displayed on the hud, for example, an excerpt from HudCDeathmatch.uc:

    Code:
        		if ( Vehicle(PawnOwner) != None && Vehicle(PawnOwner).Driver != None )
        		{
        			if (Vehicle(PawnOwner).bShowChargingBar)
        				DrawVehicleChargeBar(C);
        			RealPawnOwner = PawnOwner;
        			PawnOwner = Vehicle(PawnOwner).Driver;
        		}
    The important line here is if ( Vehicle(PawnOwner) != None && Vehicle(PawnOwner).Driver != None ). That should help you out.

    Comment


      #3
      thx

      Comment

      Working...
      X