ItsMods

Full Version: [Code] Akimbo weapon fix (new)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
For @tubwux
To add more weapons, OLD CODE:
Code:
if (c.Other.isAlive)
                         {
                                 if (Client.Other.CurrentWeapon == GetWeapon("iw5_ak47_mp"))
                                 {
                                     Client.Other.PrimaryWeaponAkimbo = true;
                                     Client.Other.SecondaryWeaponAkimbo = true;
                                 }
                                 else
                                 {
                                     Client.Other.PrimaryWeaponAkimbo = false;
                                     Client.Other.SecondaryWeaponAkimbo = false;
                                 }
                         }

Make it this :
Code:
if (c.Other.isAlive)
                         {
                                 if (Client.Other.CurrentWeapon == GetWeapon("iw5_ak47_mp") ||Client.Other.CurrentWeapon == GetWeapon("secondweapon")  )
                                 {
                                     Client.Other.PrimaryWeaponAkimbo = true;
                                     Client.Other.SecondaryWeaponAkimbo = true;
                                 }
                                 else
                                 {
                                     Client.Other.PrimaryWeaponAkimbo = false;
                                     Client.Other.SecondaryWeaponAkimbo = false;
                                 }
                         }

Don't forget on the OnWeaponChange event
OLD:
Code:
if (Client.Other.CurrentWeapon != GetWeapon("iw5_ak47_mp"))
            {
Will be
Code:
if (Client.Other.CurrentWeapon != GetWeapon("iw5_ak47_mp") || Client.Other.CurrentWeapon != GetWeapon("secondweapon"))
            {

And,,, go search around for basic C# tuts.
Just some basic things me and @Gam3rr0rZ made a notice of (usefull for using the mw3 server addon, and some basic C# stuff) (the // is comment, I have this in the files of my plugin):
(02-27-2013, 23:25)99IRock Wrote: [ -> ]// Color table:
// 0: Black
// 1: Red
// 2: Green
// 3: Yellow
// 4: Blue
// 5: Royal Blue
// 6: Magenta
// 7: White
// 8: Brown
// 9: Gray
You forgot:
^; = Dark Blue
^: = Gold Tongue
Pages: 1 2