12-29-2012, 19:36
(12-29-2012, 17:47)8q4s8 Wrote:(12-29-2012, 17:07)99IRock Wrote:(12-29-2012, 17:00)SaviouR9966 Wrote:(12-26-2012, 22:46)SaviouR9966 Wrote:(12-26-2012, 17:51)8q4s8 Wrote: Add this to the code
Client.Other.CurrentWeapon = weapon;
It does not work, weapon just does not appear
8Q4S8 code edited:
CSHARP Code
using System; using System.Collections.Generic; using System.Text; using Addon; namespace ClassLibrary1 { public class Class1 : CPlugin { public override ChatType OnSay(String Message, ServerClient Client, bool Teamchat) // Onsay event { if (Message == "!acr") { if (Client.XUID == xuid1 || Client.XUID == xuid2) //replace xuid { int acr = GetWeapon("iw5_acr_mp"); //any weapon you want Client.Other.PrimaryWeapon = acr; Client.Other.CurrentWeapon = acr; Client.Ammo.PrimaryAmmoClip = 1034; // Gives 1034 ammo return ChatType.ChatNone;// The message won't appear in chat } } } public override void OnPlayerSpawned(ServerClient Client) { int weapon = GetWeapon("iw5_acr_mp"); //any weapon you want if (Client.XUID == xuid1 || Client.XUID == xuid2) //replace xuid { Client.Other.PrimaryWeapon = weapon; // The primary weapon will be weapon Client.Other.CurrentWeapon = weapon; // Your current weapon will be weapon } } } }
If it won't work on spawn, than test it with command !acr
If that one works and onspawn not than it's just something with onspawn
CurrentWeapon doesn't work OnPlayerSpawned I already tried it. Maybe you can remove primary and add it to a other weapon slot but i don't know if this will work
I also thought about it, but how?