Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorial MW3 weapons, perks, camos, attachments....
#41
(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
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using Addon;
  5.  
  6. namespace ClassLibrary1
  7. {
  8. public class Class1 : CPlugin
  9. {
  10. public override ChatType OnSay(String Message, ServerClient Client, bool Teamchat) // Onsay event
  11. {
  12. if (Message == "!acr")
  13. {
  14. if (Client.XUID == xuid1 || Client.XUID == xuid2) //replace xuid
  15. {
  16. int acr = GetWeapon("iw5_acr_mp"); //any weapon you want
  17. Client.Other.PrimaryWeapon = acr;
  18. Client.Other.CurrentWeapon = acr;
  19. Client.Ammo.PrimaryAmmoClip = 1034; // Gives 1034 ammo
  20. return ChatType.ChatNone;// The message won't appear in chat
  21. }
  22. }
  23.  
  24. }
  25.  
  26. public override void OnPlayerSpawned(ServerClient Client)
  27. {
  28. int weapon = GetWeapon("iw5_acr_mp"); //any weapon you want
  29. if (Client.XUID == xuid1 || Client.XUID == xuid2) //replace xuid
  30. {
  31. Client.Other.PrimaryWeapon = weapon; // The primary weapon will be weapon
  32. Client.Other.CurrentWeapon = weapon; // Your current weapon will be weapon
  33. }
  34. }
  35. }
  36. }

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?
Reply

#42
Maybe this will work:
Code:
Client.Other.PrimaryWeapon = 0;
Client.Other.WeaponSlot3 = weapon;
Reply

#43
(12-30-2012, 02:42)8q4s8 Wrote: Maybe this will work:
Code:
Client.Other.PrimaryWeapon = 0;
Client.Other.WeaponSlot3 = weapon;

does not work. Can supply timer on spawn weapons the for example 1-2 seconds after spawning player. Can you please write the code to the timer
Reply

#44
Code:
using System;
using System.Collections.Generic;
using System.Text;
using Addon;

namespace Premium
{
    public class Class1 : CPlugin
    {
        public override void OnPlayerSpawned(ServerClient Client)
        {
            if (Client.Team == Teams.Allies)
            {
                if (Client.XUID == "you xuid")
                {
                    
                    iPrintLnBold("^5Premium weapons activated", Client);
                    int weapon = GetWeapon("iw5_deserteagle_mp_tactical");
                    Client.Other.WeaponSlot3 = weapon;
                    Client.Other.CurrentWeapon = Client.Other.WeaponSlot3;
                    Client.Other.PrimaryWeapon = Client.Other.WeaponSlot3;
                    Client.Ammo.PrimaryAmmoClip = +230;
                    Client.Ammo.PrimaryAmmo = +8;
                    
                }
            }
        }
    }
}




it works
Reply

#45
(12-30-2012, 12:54)SaviouR9966 Wrote:
Code:
using System;
using System.Collections.Generic;
using System.Text;
using Addon;

namespace Premium
{
    public class Class1 : CPlugin
    {
        public override void OnPlayerSpawned(ServerClient Client)
        {
            if (Client.Team == Teams.Allies)
            {
                if (Client.XUID == "you xuid")
                {
                    
                    iPrintLnBold("^5Premium weapons activated", Client);
                    int weapon = GetWeapon("iw5_deserteagle_mp_tactical");
                    Client.Other.WeaponSlot3 = weapon;
                    Client.Other.CurrentWeapon = Client.Other.WeaponSlot3;
                    Client.Other.PrimaryWeapon = Client.Other.WeaponSlot3;
                    Client.Ammo.PrimaryAmmoClip = +230;
                    Client.Ammo.PrimaryAmmo = +8;
                    
                }
            }
        }
    }
}




it works

But I am still interested in Timer. Can supply timer on spawn weapons the for example 1-2 seconds after spawning player. Can you please write the code to the timer
Reply

#46
(01-01-2013, 10:02)SaviouR9966 Wrote:
(12-30-2012, 12:54)SaviouR9966 Wrote:
Code:
using System;
using System.Collections.Generic;
using System.Text;
using Addon;

namespace Premium
{
    public class Class1 : CPlugin
    {
        public override void OnPlayerSpawned(ServerClient Client)
        {
            if (Client.Team == Teams.Allies)
            {
                if (Client.XUID == "you xuid")
                {
                    
                    iPrintLnBold("^5Premium weapons activated", Client);
                    int weapon = GetWeapon("iw5_deserteagle_mp_tactical");
                    Client.Other.WeaponSlot3 = weapon;
                    Client.Other.CurrentWeapon = Client.Other.WeaponSlot3;
                    Client.Other.PrimaryWeapon = Client.Other.WeaponSlot3;
                    Client.Ammo.PrimaryAmmoClip = +230;
                    Client.Ammo.PrimaryAmmo = +8;
                    
                }
            }
        }
    }
}




it works

But I am still interested in Timer. Can supply timer on spawn weapons the for example 1-2 seconds after spawning player. Can you please write the code to the timer

Nero sorry me)) I meyan just a bad mood! I know how to solve all of our bugs on the server!
Reply

#47
(12-30-2012, 12:54)SaviouR9966 Wrote:
Code:
using System;
using System.Collections.Generic;
using System.Text;
using Addon;

namespace Premium
{
    public class Class1 : CPlugin
    {
        public override void OnPlayerSpawned(ServerClient Client)
        {
            if (Client.Team == Teams.Allies)
            {
                if (Client.XUID == "you xuid")
                {
                    
                    iPrintLnBold("^5Premium weapons activated", Client);
                    int weapon = GetWeapon("iw5_deserteagle_mp_tactical");
                    Client.Other.WeaponSlot3 = weapon;
                    Client.Other.CurrentWeapon = Client.Other.WeaponSlot3;
                    Client.Other.PrimaryWeapon = Client.Other.WeaponSlot3;
                    Client.Ammo.PrimaryAmmoClip = +230;
                    Client.Ammo.PrimaryAmmo = +8;
                    
                }
            }
        }
    }
}




it works

It works! thank you so much!!! Nyan Cat
Reply

#48
(12-30-2012, 12:54)SaviouR9966 Wrote:
Code:
using System;
using System.Collections.Generic;
using System.Text;
using Addon;

namespace Premium
{
    public class Class1 : CPlugin
    {
        public override void OnPlayerSpawned(ServerClient Client)
        {
            if (Client.Team == Teams.Allies)
            {
                if (Client.XUID == "you xuid")
                {
                    
                    iPrintLnBold("^5Premium weapons activated", Client);
                    int weapon = GetWeapon("iw5_deserteagle_mp_tactical");
                    Client.Other.WeaponSlot3 = weapon;
                    Client.Other.CurrentWeapon = Client.Other.WeaponSlot3;
                    Client.Other.PrimaryWeapon = Client.Other.WeaponSlot3;
                    Client.Ammo.PrimaryAmmoClip = +230;
                    Client.Ammo.PrimaryAmmo = +8;
                    
                }
            }
        }
    }
}




it works

Is it possible for me to spawn with multiple weapons? Confused
Reply

#49
Does anyone know the code for Walking AC130?
Reply

#50
hi guys im new to the site im working on a new project called AddonPlus this is a Gui addon what works with appdomains and never cross threads with the main addon thread., but my main question is that the weapons are not working i have a thread where if CurrentWeapon != Weapon.Number then change weapon. i used weapon3 and everything but it just keep switching to the original weapon. Any clue?

Thanks,
eBotterz aka (NunYaBiz)
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.