From 0d626bdce95e048e8c9dc788abf924943a7d9ff9 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Thu, 3 Mar 2022 01:19:14 -0600 Subject: [PATCH] Use netevent for give weapon --- scripts/server/native/connected.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/server/native/connected.js b/scripts/server/native/connected.js index 7f855eb3..576bc54c 100644 --- a/scripts/server/native/connected.js +++ b/scripts/server/native/connected.js @@ -1013,4 +1013,11 @@ function setVehicleHealth(vehicle, health) { vehicle.health = 1000; } +// =========================================================================== + +function givePlayerWeapon(client, weaponId, ammo, active = true) { + logToConsole(LOG_DEBUG, `[VRR.Client] Sending signal to ${getPlayerDisplayForConsole(client)} to give weapon (Weapon: ${weaponId}, Ammo: ${ammo})`); + sendNetworkEventToPlayer("vrr.giveWeapon", client, weaponId, ammo, active); +} + // =========================================================================== \ No newline at end of file