Skip to content

Commit

Permalink
-added getseatindex for ease of access
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaiwoknats committed Dec 5, 2023
1 parent 42bfa7e commit 272bbd1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions AltV/Entities/AtlasVehicleBase.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using AltV.Atlas.Vehicles.Server.AltV.Interfaces;
using AltV.Net;
using AltV.Net.Async.Elements.Entities;
using AltV.Net.Data;
using AltV.Net.Elements.Entities;

namespace AltV.Atlas.Vehicles.Server.AltV.Entities;
Expand Down Expand Up @@ -35,4 +36,16 @@ public void WarpOutOfVehicle( IPlayer player )

player.Position = Position;
}

/// <summary>
/// Gets the seat index of the given player
/// </summary>
/// <param name="player">Player to get the seat for</param>
/// <returns>Returns the seat index when found and 0 if not</returns>
public byte GetSeatIndex( IPlayer player )
{
PlayerSeat? playerSeat = Passengers.FirstOrDefault( p => p.Player == player );

return playerSeat is not null ? player.Seat : ( byte ) 0;
}
}

0 comments on commit 272bbd1

Please sign in to comment.