Hello, Guest

By registering with us, you'll be able to discuss, share and private message with other members of our community.
What's new

SCRIPT Issuance of weapons

Alexalsaud

Administrative
Staff member
Admin
Joined
Aug 5, 2024
Messages
337
ICoins
1,501
Issuance of weapons

The command is implemented on the server side (ServerSide)

as it works:
in the chat we write:
/weapon SMG 100
where:
SMG -
100 - number of cartridges

C#:
[Command("weapon")]
        public void weapon(Player player, WeaponHash WeaponHash, int ammo)
        {
            NAPI.Player.GivePlayerWeapon(player, WeaponHash, ammo);
            NAPI.Chat.SendChatMessageToPlayer(player,$"Игроку: {player.Name} | Выдано: {WeaponHash} и {ammo} патрон!");
           NAPI.Chat.SendChatMessageToPlayer("https://rage-script.com/");
          
        }

JavaScript:
mp.events.addCommand('weapon', (player, fullText, weaponName, ammo) => {
    player.giveWeapon(weaponName, parseInt(ammo));
    player.outputChatBox(`Игроку: ${player.name} | Выдано: ${weaponName} и ${ammo} патрон!`);
});
 
Back
Top