Posts: 138
Threads: 21
Joined: Jun 2011
Reputation:
0
(12-28-2012, 13:17)99IRock Wrote: (12-28-2012, 04:34)yokai134 Wrote: Modified Code Code: // AKIMBO COMMANDS
public override ChatType OnSay(String Message, ServerClient Client, bool Teamchat)
{
// -----------------------------------------------------------------
// Help commands
// -----------------------------------------------------------------
if (Message.StartsWith("!akimbo") && !Message.Contains("help"))
{
char[] split = new char[] { ' ' };
string[] command = Message.Split(split);
try
{
int newWeapon = GetWeapon("iw5_" + command[1] + "_mp");
Client.Other.PrimaryWeapon = newWeapon;
Client.Other.CurrentWeapon = Client.Other.PrimaryWeapon;
Client.Other.PrimaryWeaponAkimbo = true;
Client.Ammo.PrimaryAmmoClip = 1023;
Client.Ammo.PrimaryAkimboAmmo = 1023;
Client.Ammo.PrimaryAmmo = 1023;
}
catch (Exception e)
{
TellClient(Client.ClientNum, "[^1AP^7] Please use the correct name of the weapon you wish to use!", true);
TellClient(Client.ClientNum, "[^1AP^7] Use !akimbohelp for further help!", true);
}
}
else{
switch (Message)
{
case "!akimbohelp":
iPrintLnBold("[^1AkimboPlugin^7]: !smgs | !lmgs | !assault | !snipers | !shotguns | !pistols | !machpistols", Client);
TellClient(Client.ClientNum,"[^1AkimboPlugin^7]: Usage !akimbo <weaponName>", true);
break;
case "!smgs":
iPrintLnBold("[^1AkimboPlugin^7]: mp5 | mp7 | pm9 | p90 | pp90m1 | ump45", Client);
break;
case "!rifles":
iPrintLnBold("[^1AkimboPlugin^7]: m4a1 | ak47 | m16 | fad | acr | mk14 | scar | g36c | cm901", Client);
break;
case "!lmgs":
iPrintLnBold("[^1AkimboPlugin^7]: m60 | mk46 | pecheneg | sa80 | mg36", Client);
break;
case "!shotguns":
iPrintLnBold("[^1AkimboPlugin^7]: barrett | rsass | dragunov | msr | l96a1 | as50", Client);
break;
case "!snipers":
iPrintLnBold("[^1AkimboPlugin^7]: 1887 | striker | aa12 | usas12 | spas12", Client);
break;
case "!pistols":
iPrintLnBold("[^1AkimboPlugin^7]: usp45 | p99 | fnfiveseven | 44magnum | mp412", Client);
break;
case "!machpistols":
iPrintLnBold("[^1AkimboPlugin^7]: g18 | skorpion | fmg9 | mp9 ", Client);
break;
}
}
return ChatType.ChatContinue;
}
I didnt re-add explosives and if you want to add attachments go to the:
int newWeapon = GetWeapon("iw5_"+ command[1] + "_mp") and add the attachments you want all guns to use in the _mp part.
EX: _mp_xmags_silencer = Extended Mags and Silencer.
HOWEVER Since not all guns use the same attachments this will not always work!
Can't test it as my laptop is running Linux and not on Windows to run a LAN server from.
I believe I have all correct gun names in there, if not this is source code so fix it if it needs to fixed.
Cool but you better should not use secondary guns as akimbo, it's much more power, but still, we just have the attachment akimbo for that
Well looks nice, but I think the safest way is the long code.
But thanks for the good idea, and nice coding
(12-28-2012, 03:57)choobie Wrote: (12-28-2012, 02:48)99IRock Wrote: (12-28-2012, 02:42)8q4s8 Wrote: Nice release but it wouldn't it be much easier to make a command like !akimbo then split the message and add the weapon name or create a array for them?
Yep but I didn't try it, but it could be easy if I use something like this:
!akimbo iw5_ + clientsmessage(somethinglikethat) + _mp
... I still need to take a good look on splitting and arrays
Thanks anyway
great Job!!
so far what I tested
mp7a not working
pp90m1a crashes and kicks you out (server still running though.
would it be possible to keep the messages on screen longer?
+rep
I will remove the pp90m1a than from the code.
The mp7 should work, but you just have 2 ammo bars right?
Otherwise I will take a look in the code again
Right. I see 2 ammo bars for the mp7 but just one gun.
BTW Thanks again for keeping MW3 alive with your plugins. You definitely ROCK!
I really would hate to see all this work everyone has done just fade away.
One more question / request off topic
Our clan has a good sniper server running now and I really like playing it.
But I would like to have the sniper rifles full screen with no sway and less recoil.
Is that possible for a plugin and am I asking for too much.
peace and Happy New Year
Posts: 520
Threads: 29
Joined: Nov 2012
Reputation:
11
12-28-2012, 23:14
(This post was last modified: 12-28-2012, 23:38 by 99IRock.)
(12-28-2012, 23:11)choobie Wrote: Right. I see 2 ammo bars for the mp7 but just one gun.
BTW Thanks again for keeping MW3 alive with your plugins. You definitely ROCK!
I really would hate to see all this work everyone has done just fade away.
One more question / request off topic
Our clan has a good sniper server running now and I really like playing it.
But I would like to have the sniper rifles full screen with no sway and less recoil.
Is that possible for a plugin and am I asking for too much.
peace and Happy New Year
I don'think that's possible, that would modify game files something I don't know it
EDIT:
The full screen, will be a texture hack, the less recoil, I think also a hack.
happy new year
Posts: 3,598
Threads: 265
Joined: Oct 2010
Reputation:
76
12-29-2012, 15:34
(This post was last modified: 12-29-2012, 15:39 by SuperNovaAO.)
I saw the code and I
So I made it somewhat shorter.
CSHARP Code
using System; using System.Collections.Generic; using System.Text; using Addon; namespace AkimboPlugin { public class AkimboMagic : CPlugin { private const String PLUGINNAME = "AkimboPlugin"; private void PrintHelp(String Message, ServerClient Client) { iPrintLnBold("[^1"+ PLUGINNAME +"^7]: "+ Message, Client); } // AKIMBO COMMANDS public override ChatType OnSay(String Message, ServerClient Client, bool Teamchat) { bool help = false; // ----------------------------------------------------------------- // Help commands // ----------------------------------------------------------------- switch (Message) { case: "!helpa": PrintHelp("!smga | !lmga | !assaulta | !snipersa | !shotgunsa | !expla", Client); help = true; break; case: "!smga": PrintHelp("!mp5a | !mp7a | !pm9a | !p90a | !pp90m1a | !ump45a", Client); help = true; break; case: "!lmga": PrintHelp("!m60a | !mk46a | !pecha | !lswa | !mg36a", Client); help = true; break; case: "!assaulta": PrintHelp("!m4a | !ak47a | !m16a | !fada | !acra | !mk14a | !scara | !g36ca | !cm901a", Client); help = true; break; case: "!snipersa": PrintHelp("!barreta | !rsassa | !dragunova | !msra | !l96a1a | !as50a", Client); help = true; break; case: "!shotgunsa": PrintHelp("!1887a | !strikera | !aa12a | !usas12a | !spas12a", Client); help = true; break; case: "!expla": PrintHelp("!xm25a | !rpga", Client); help = true; break; } if (!help) { String weapon = Message.Substring(1, Message.Length - 2); int weaponID = GetWeapon("iw5_"+ weapon +"_mp"); if (weaponID != 0) { Client.Other.PrimaryWeaponAkimbo = true; Client.Other.SecondaryWeaponAkimbo = true; Client.Other.PrimaryWeapon = weaponID; Client.Other.SecondaryWeapon = weaponID; Client.Other.CurrentWeapon = weaponID; Client.Ammo.PrimaryAmmoClip = 1034; Client.Ammo.SecondaryAmmoClip = 1034; return ChatType.ChatNone; } } return ChatType.ChatContinue; } } }
In the meantime I also fixed the error with !snipersa not working.
if (Message == "snipersa")
Also this works on the assumption that GetWeapon returns 0 on an invalid weapon. The documentation for the addon just plainly sucks because information about return values are not listed (and way more is missing).
Posts: 520
Threads: 29
Joined: Nov 2012
Reputation:
11
Nice, but one thing.
xm25_mp
rpg_mp
They don't use iw5_
Maybe make an function for that?
Posts: 65
Threads: 15
Joined: Aug 2011
Reputation:
1
akimbo xm25 and akimbo rpg :o
Posts: 520
Threads: 29
Joined: Nov 2012
Reputation:
11
(12-30-2012, 20:18)koro35 Wrote: akimbo xm25 and akimbo rpg :o
It works I tested it in server :p
|