12-28-2012, 23:11
(12-28-2012, 13:17)99IRock Wrote: [ -> ](12-28-2012, 04:34)yokai134 Wrote: [ -> ]Modified CodeSpoiler (Click to View)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