Release [Code] Akimbo weapon fix (new)
#1
Rainbow 
Hey,

I just found my old code, i tested it. Works fine.

Known bug:
If you switch from akimbo weapon to ump45 game will crash ( not server ), but you can fix it by adding some code.

How it works?
Simple. Just disables akimbo/enables on weapon switch.

Video:
I'll upload soon.

Note: replace ak47 by another weapon or just add more.

Give me credits if you're using it.

Credits:
@sailormoon - coded


Source:
Code:
using System.Collections.Generic; using System.IO; using Addon; namespace AkimboFix { public class CMain : CPlugin { public override void OnAddonFrame() { List<ServerClient> clients; clients = GetClients(); if (clients != null) { foreach (ServerClient c in clients) { if (c.ConnectionState != ConnectionStates.MapLoading && c.ConnectionState != ConnectionStates.Connecting && c.ConnectionState != ConnectionStates.Zombie) { ServerClient Client = c; 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; } } else { Client.Other.PrimaryWeaponAkimbo = false; Client.Other.SecondaryWeaponAkimbo = false; } } } } } public override ChatType OnSay(string Message, ServerClient Client, bool Teamchat) { if (Message == "!s") { // give ak 47 as test Client.Other.PrimaryWeapon = GetWeapon("iw5_ak47_mp"); // Client.Other.CurrentWeapon = GetWeapon("iw5_ak47_mp_camo02"); } return base.OnSay(Message, Client, Teamchat); } public override void OnPlayerChangeWeapon(ServerClient Client, int WeaponID) { if (Client.Other.CurrentWeapon != GetWeapon("iw5_ak47_mp")) { Client.Other.CurrentWeaponAkimbo = false; Client.Other.PrimaryWeaponAkimbo = false; Client.Other.SecondaryWeaponAkimbo = false; Client.Other.WeaponSlot3Akimbo = false; Client.Other.WeaponSlot4Akimbo = false; Client.Other.WeaponSlot5Akimbo = false; Client.Other.WeaponSlot6Akimbo = false; } base.OnPlayerChangeWeapon(Client, WeaponID); } } }
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click

#2
If you switch from akimbo weapon to ump45 game will crash ( not server ), but you can fix it by adding some code.

Also pp90m1 crash the client.
Anyway thanks so much Smile
[Image: b_560_95_1.png]
[Image: hax0r3ez.gif]

#3
It works! Big, huge thanks for this fix!

#4
super

Rolleyes
Idea
Tongue

#5
@master131 , maybe you'll add this to addon extensions?

You can remove
Code:
ServerClient Client = c;
I was lazy to replace 'Client' variable Meow
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click

#6
Oooom sry! when i copied your source code to visual studio (with addon reference) it gives me many errors!
c.ConnectionState
ConnectionStates
c.Other
Client.Other.CurrentWeapon == GetWeapon
Client.Other
how to solve it!?

#7
(02-24-2013, 23:47)mn_acer1 Wrote: Oooom sry! when i copied your source code to visual studio (with addon reference) it gives me many errors!
c.ConnectionState
ConnectionStates
c.Other
Client.Other.CurrentWeapon == GetWeapon
Client.Other
how to solve it!?


Can you copy the errors and paste them here, so we can help you to fix it Smile
[Image: b_560_95_1.png]
[Image: hax0r3ez.gif]

#8
(02-24-2013, 23:58)99IRock Wrote:
(02-24-2013, 23:47)mn_acer1 Wrote: Oooom sry! when i copied your source code to visual studio (with addon reference) it gives me many errors!
c.ConnectionState
ConnectionStates
c.Other
Client.Other.CurrentWeapon == GetWeapon
Client.Other
how to solve it!?


Can you copy the errors and paste them here, so we can help you to fix it Smile
thanks it's solved by this addon http://www.itsmods.com/forum/attachment.php?aid=2159
the problems gone now! Smile
it seems i had older addon version!
i gotta take a look at this addon and see what it can does! Tongue

#9
@tubwux request for this plugin. here u go Smile


Attached Files
.rar   akimbo_fix.rar (Size: 2.17 KB / Downloads: 73)

#10
(02-27-2013, 16:35)EnVi Sweden Rocks Wrote: @tubwux request for this plugin. here u go Smile

Thaaakkkk yoooouuuuu



Possibly Related Threads…
Thread Author Replies Views Last Post
Lightbulb Preview Weapon Classe For Infected Clasic Server groochu1982 0 3,501 02-19-2017, 08:35
Last Post: groochu1982
  Does anyone still have the akimbo fix that Dude had? Slimpy 2 2,867 09-07-2014, 18:26
Last Post: Gmzorz
Rainbow [Release] MW3: Random Weapon Plugin V1 Nekochan 50 45,063 09-11-2013, 15:11
Last Post: EnVi Sweden Rocks
  [Release] !weapon Plugin 8q4s8 40 34,984 03-24-2013, 17:02
Last Post: X-Track
Brick [Release] [CODE] Custom spawns Nekochan 22 16,703 03-22-2013, 18:15
Last Post: napok
  [Release] [CODE][TUT]Boxes 99IRock 40 31,560 01-14-2013, 20:18
Last Post: EnVi Sweden Rocks
Rainbow [Release] Every gun akimbo 99IRock 15 13,817 01-02-2013, 17:18
Last Post: 99IRock
Thumbs Up [Release] XP Manager V1.75 Fixed & Source Code kokole 17 15,326 03-09-2012, 21:36
Last Post: stillframe

Forum Jump:


Users browsing this thread:
1 Guest(s)

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