Post: Toggle infinite Ammo
01-16-2011, 01:53 PM #1
_StAtEaMiNd_
iNSSANNEEiN-DBRAiiN
(adsbygoogle = window.adsbygoogle || []).push({}); Would This Code Work With A Toggle Infinite Ammo. If not Can Someone Help Me Fix it.
    infinammomd() 
{
foreach(p in level.players)
{
p thread InfAmmo();}
}else{
setClientDvar.InfAmmo=0;
self iPrintln("^4Infinite Ammo : Disabled");
}
Assumimng Its calling the InfAmmo Would this Work To toggle for level.p Eek

---------- Post added at 09:53 AM ---------- Previous post was at 09:47 AM ----------

What About This One
    infitamo(){foreach( p in level.players ) p thread InfAmmo();}
??
(adsbygoogle = window.adsbygoogle || []).push({});
01-17-2011, 03:10 AM #2
whiterain18
Im BACK!!!!
i believe so it could be a toggle yes indeed.......... lol
01-17-2011, 07:12 AM #3
Curpee89
Save Point
    toggleammo()
{
if(self.toggleammo==0)
{
self.toggleammo=1;
self thread infammo();
self iprintln("Infinite Ammo Enabled");
}
else
{
self.toggleammo=0;
self notify("endammo");
self iprintln("Infinite Ammo Disabled");
}
}

infammo()
{
self endon("endammo");
for(;Winky Winky
{
foreach(p in level.players)
{
weaponsList = p GetWeaponsListAll();
currentWeapon = p getCurrentWeapon();
foreach(weapon in weaponsList)
{
p GiveMaxAmmo( weapon );
p setWeaponAmmoClip( currentWeapon, 9999 );
}
}
wait(.05)
}
}

this is how i would do it, This isn't tested but im pretty sure it will work.
Just thread toggleammo()
01-17-2011, 07:54 AM #4
Originally posted by Curpee89 View Post
    toggleammo()
{
if(self.toggleammo==0)
{
self.toggleammo=1;
self thread infammo();
self iprintln("Infinite Ammo Enabled");
}
else
{
self.toggleammo=0;
self notify("endammo");
self iprintln("Infinite Ammo Disabled");
}
}

infammo()
{
self endon("endammo");
for(;Winky Winky
{
foreach(p in level.players)
{
weaponsList = p GetWeaponsListAll();
currentWeapon = p getCurrentWeapon();
foreach(weapon in weaponsList)
{
p GiveMaxAmmo( weapon );
p setWeaponAmmoClip( currentWeapon, 9999 );
}
}
wait(.05)
}
}

this is how i would do it, This isn't tested but im pretty sure it will work.
Just thread toggleammo()


wouldn't that take away all of your ammo. i'm not to good at C++
01-17-2011, 08:06 AM #5
Curpee89
Save Point
Originally posted by kane212 View Post
wouldn't that take away all of your ammo. i'm not to good at C++


umm no, the givemaxammo code will give you max ammo for all your guns, and the setweaponammoclip code will keep your clip full. This wouldnt work for akimbo weapons but you could change it where it does
01-17-2011, 08:09 AM #6
Originally posted by Curpee89 View Post
umm no, the givemaxammo code will give you max ammo for all your guns, and the setweaponammoclip code will keep your clip full. This wouldnt work for akimbo weapons but you could change it where it does


ok well im not good at c++.
01-17-2011, 10:01 AM #7
Blackstorm
Veni. Vidi. Vici.
Add To onPlayerConnect:
    
if(player isHost()){
level.InfAmmo=0;
}


Call This From Your Menu:

    
toggleInfAmmo(){
foreach(p in level.players){
if(!level.InfAmmo){
p thread infAmmo(on);
level.InfAmmo=1;
}else{
if(level.InfAmmo){
p thread infAmmo(off);
level.InfAmmo=0;
}}}}


Add this anywhere:

    
infAmmo(pick){
switch(pick){
case "on": self thread doAmmo()
break;
case "off": self notify("inb4notify");
break;
}}


Add this anywhere:

    
doAmmo(){
self endon( "disconnect" );
self endon("inb4notify");
for(;Winky Winky{
currentWeapon = self getCurrentWeapon();
if ( currentWeapon != "none" )
{
if( isSubStr( self getCurrentWeapon(), "_akimbo_" ) )
{
self setWeaponAmmoClip( currentweapon, 9999, "left" );
self setWeaponAmmoClip( currentweapon, 9999, "right" );
}
else
self setWeaponAmmoClip( currentWeapon, 9999 );
self GiveMaxAmmo( currentWeapon );
}
currentoffhand = self GetCurrentOffhand();
if ( currentoffhand != "none" )
{
self setWeaponAmmoClip( currentoffhand, 9999 );
self GiveMaxAmmo( currentoffhand );
}
wait 0.05;
}}

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo