Release No ammo for secondary
#1
Rainbow 
Hey,

Made by request.
No ammo for secondary weapon. ( Useful for sniper servers ).

SOURCE
Code:
using Addon; using System.Collections.Generic; namespace noammo { public class noammos : CPlugin { public override void OnAddonFrame() { // to prevent errors List<ServerClient> clients = new List<ServerClient>(); if (clients != null && clients.Count > 0) { foreach (ServerClient cl in GetClients()) { if (cl != null) { cl.Ammo.SecondaryAkimboAmmo = 0; cl.Ammo.SecondaryAmmo = 0; cl.Ammo.SecondaryAmmoClip = 0; } } } } } }

.zip   noammo.zip (Size: 1.84 KB / Downloads: 124)

Credits:
@jaydi - coded
@ALEXFDR - idea
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#2
(09-08-2012, 23:27)JayDi Wrote: Hey,

Made by request.
No ammo for secondary weapon. ( Useful for sniper servers ).
Credits:
@jaydi - coded
@ALEXFDR - idea

it didn't work, sry, btw i coped the game folder into my desktop and opened the server but it doesnt show on the server list, is it because i copied the folder or because something else.

tkx in advance.
Reply

#3
How could it not? The code is flawless.
You did put the plugin inside your addon folder? And are you using the lastest MW3 Server Addon, the one updated by @zxz0O0
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#4
Ohh my fault i compiled that in net 4.0
I will re-upload now.
Sorry.

EDIT: It's fine now.
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#5
Code:
List<ServerClient> clients = new List<ServerClient>(); if (clients != null && clients.Count > 0) { //Never executed, clients.Count is 0.
Huh
[Image: azuw.jpg]
Reply

#6
(09-08-2012, 23:27)JayDi Wrote:
Code:
List<ServerClient> clients = new List<ServerClient>(); if (clients != null && clients.Count > 0)
To prevent what error also as pointed out by @zxz0O0 it will never execute
Reply

#7
It will give error like "Object is undefined".
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#8
I will say the whole code is messed, try this
Code:
using Addon; using System.Collections.Generic; namespace nope { public class Class1:CPlugin { public override void OnPlayerSpawned(ServerClient cl) { if(cl.Other.SecondaryWeaponAkimbo == true) cl.Ammo.SecondaryAkimboAmmo = 0; cl.Ammo.SecondaryAmmo = 0; cl.Ammo.SecondaryAmmoClip = 0; } } }
If no-one has ammo on spawn, they won't have it ever
Reply

#9
(09-09-2012, 13:43)archit Wrote: I will say the whole code is messed, try this
Code:
using Addon; using System.Collections.Generic; namespace nope { public class Class1:CPlugin { public override void OnPlayerSpawned(ServerClient cl) { if(cl.Other.SecondaryWeaponAkimbo == true) cl.Ammo.SecondaryAkimboAmmo = 0; cl.Ammo.SecondaryAmmo = 0; cl.Ammo.SecondaryAmmoClip = 0; } } }
If no-one has ammo on spawn, they won't have it ever

What if player will pick ammo?
Also my code is working. I tested it.
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#10
No one ever had secondary weapon ammo,how will someone drop it so he can pick it?
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Request] no ammo for infected gamemode ExoGamer* 8 7,785 08-15-2013, 18:59
Last Post: Dr3am95
  Help Receiving a random primary & secondary DidUknowiPwn 5 6,031 07-22-2013, 09:47
Last Post: Yamato
  M320 and GP25 ammo McKinleySPB 3 4,340 07-06-2013, 12:56
Last Post: archit
Smile [Release] Unlimited ammo v2.3 & @Nukems unlammo hillbilly 40 32,469 06-26-2013, 11:33
Last Post: X-Track
Question can't find it (ammo box) DJSKilly 8 7,689 05-29-2013, 11:27
Last Post: Dr3am95
Wink Help Ammo box Dr3am95 6 6,073 03-31-2013, 15:39
Last Post: NyZzE
  Help Problem unlimited ammo plugin 4nonymous 2 4,189 03-10-2013, 20:14
Last Post: hillbilly
Smile Need Someone to Make an Ammo Replenishing Box SkATerJoN 5 5,696 01-18-2013, 17:31
Last Post: tomglazer
  Help Setting ammo for M320/Shotgun Attachment yokai134 2 4,061 12-12-2012, 07:03
Last Post: yokai134
  [Request] im looking for ammo code pap12322221112 2 3,523 10-22-2012, 08:41
Last Post: AZUMIKKEL

Forum Jump:


Users browsing this thread:
1 Guest(s)

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