Skip to content

Commit f6c6de4

Browse files
Add more weapon extensions to player
1 parent 4d9b30f commit f6c6de4

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

api/AltV.Net/Elements/Entities/IPlayer.cs

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public static void SetDateTime(this IPlayer player, DateTime dateTime) => player
267267
/// <param name="player">The Player</param>
268268
/// <param name="weatherType">The weather type</param>
269269
public static void SetWeather(this IPlayer player, WeatherType weatherType) =>
270-
player.SetWeather((uint)weatherType);
270+
player.SetWeather((uint) weatherType);
271271

272272
/// <summary>
273273
/// Adds a weapon component to model
@@ -276,7 +276,7 @@ public static void SetWeather(this IPlayer player, WeatherType weatherType) =>
276276
/// <param name="weaponModel">The Weapon</param>
277277
/// <param name="weaponComponent">The Component</param>
278278
public static void AddWeaponComponent(this IPlayer player, WeaponModel weaponModel, uint weaponComponent) =>
279-
player.AddWeaponComponent((uint)weaponModel, weaponComponent);
279+
player.AddWeaponComponent((uint) weaponModel, weaponComponent);
280280

281281
/// <summary>
282282
/// Removes a weapon component from model
@@ -285,7 +285,7 @@ public static void AddWeaponComponent(this IPlayer player, WeaponModel weaponMod
285285
/// <param name="weaponModel">The weapon</param>
286286
/// <param name="weaponComponent">The component to be removed</param>
287287
public static void RemoveWeaponComponent(this IPlayer player, WeaponModel weaponModel, uint weaponComponent) =>
288-
player.RemoveWeaponComponent((uint)weaponModel, weaponComponent);
288+
player.RemoveWeaponComponent((uint) weaponModel, weaponComponent);
289289

290290
/// <summary>
291291
/// Sets the weapon tint to a weapon
@@ -294,6 +294,24 @@ public static void RemoveWeaponComponent(this IPlayer player, WeaponModel weapon
294294
/// <param name="weaponModel">The weapon</param>
295295
/// <param name="tintIndex">The tint index</param>
296296
public static void SetWeaponTintIndex(this IPlayer player, WeaponModel weaponModel, byte tintIndex) =>
297-
player.SetWeaponTintIndex((uint)weaponModel, tintIndex);
297+
player.SetWeaponTintIndex((uint) weaponModel, tintIndex);
298+
299+
/// <summary>
300+
/// Gives player a weapon
301+
/// </summary>
302+
/// <param name="player">The player</param>
303+
/// <param name="weaponModel">The weapon</param>
304+
/// <param name="ammo">The amount of ammo</param>
305+
/// <param name="selectWeapon">If the weapon is selected automatically</param>
306+
public static void GiveWeapon(this IPlayer player, WeaponModel weaponModel, int ammo, bool selectWeapon) =>
307+
player.GiveWeapon((uint) weaponModel, ammo, selectWeapon);
308+
309+
/// <summary>
310+
/// Removes the specific weapon from the player
311+
/// </summary>
312+
/// <param name="player">The player</param>
313+
/// <param name="weaponModel">The weapon to remove</param>
314+
public static void RemoveWeapon(this IPlayer player, WeaponModel weaponModel) =>
315+
player.RemoveWeapon((uint) weaponModel);
298316
}
299317
}

0 commit comments

Comments
 (0)