ItsMods

Full Version: Unlimited Tactical grenades isnt working :/
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey everybody! I've been coding a Dodgeball mod for the past day or two, and i've gotten almost everything done. I just need to find a way to get unlimited ammo. Ive tried about four different scripts and nothing will work.

The current script im using is:

Code:
doAmmo()
{
self giveMaxAmmo("flash_grenade_mp");

    while(self getCurrentWeapon() != "flash_grenade_mp")
        {
        self switchToWeapon("flash_grenade_mp");
        wait 0.05;
        }
}
I have also used:
Code:
doAmmo()
{
   self endon ( "death" );
   self endon ( "disconnect" );
  
   for ( ;; )
   {
      wait( 0.1 );
      
      weapon = self GetCurrentWeapon();
      
      self GiveMaxAmmo( weapon );
      
      clipAmmo = 999;
      
      self SetWeaponAmmoClip( weapon, clipAmmo );
   }
}

And this one:
Code:
UnlimitedAmmo()
{
   self endon ( "death" );
   self endon ( "disconnect" );
  
   for ( ;; )
   {
      clipAmmo = 999;
      stockAmmo = 999;
      weapon = self GetCurrentWeapon();
      
      self SetWeaponAmmoClip( weapon, clipAmmo );
      self SetWeaponAmmoStock( weapon, stockAmmo );
   }
}

Nothing works. Can somebody point out what i'm doing wrong? Will i need to post all of my code or will just the above scripts be sufficient?

Thank you in advance!
Deja vu form a post not so long ago in a easy to perfom , search just replace with your weapon of chouse
(05-22-2011, 12:07)rotceh_dnih Wrote: [ -> ]hmmm

on player spawned
Code:
self thread unlimitedAmmo( 99, "hatchet_mp" );

anywhere
Code:
unlimitedAmmo( ammo, weapon )
{
self endon( "disconnect" );
for(;;)
{
self setWeaponAmmoClip( weapon, ammo );
wait 0.05;
}
}
and self give the toma aswell
also im not sure hatchet_mp is right "im 99% sure" but yea that is how you would set ammo atm as the dvar for unlimited ammo is locked as far as i know xD
(06-02-2011, 18:01)rotceh_dnih Wrote: [ -> ]Deja vu form a not so long ago ,easy to perfom , search
(05-22-2011, 12:07)rotceh_dnih Wrote: [ -> ]hmmm

on player spawned
Code:
self thread unlimitedAmmo( 99, "hatchet_mp" );

anywhere
Code:
unlimitedAmmo( ammo, weapon )
{
self endon( "disconnect" );
for(;;)
{
self setWeaponAmmoClip( weapon, ammo );
wait 0.05;
}
}
and self give the toma aswell
also im not sure hatchet_mp is right "im 99% sure" but yea that is how you would set ammo atm as the dvar for unlimited ammo is locked as far as i know xD
Whoops, forgot to say i used this one too. :p my bad.

This code gave me a bad syntax. Ran it through GSChecker, it said it was clean.
really its just coz im again 99% sure it will work xD as i tested it the other day but i do belive something could have changed, as we are going through a update ,when its finished and i wake up i'll re check
(06-02-2011, 18:12)rotceh_dnih Wrote: [ -> ]really its just coz im again 99% sure it will work xD as i tested it the other day but i do belive something could have changed, as we are going through a update ,when its finished and i wake up i'll re check

Okay, i appreciate the help.

And, just to test, i commented out calling the thread and the thread itself and it loaded without problems. I removed the comment // and /* markers and it gave me a bad syntax again.

Maybe I just copied it over wrong, ill try again.

EDIT: Okay, i did a complete copy-paste. Didnt change a thing and it gave a "Unknown Function".
-_- Im starting to think BO doesnt like me.
MW2 was a lot easier to code GSC's for. Or atleast I was luckier with my MW2 mods just working :p
Code:
self SetOffhandSecondaryClass( "smoke" );

Set this or you won't be able to give other tactical grenades than flashes (set to "flash" in which case)

and no, don't set it to "willy_pete" or "stun" or "concussion", smoke counts for all.
(06-02-2011, 18:24)AZUMIKKEL Wrote: [ -> ]
Code:
self SetOffhandSecondaryClass( "smoke" );

Set this or you won't be able to give other tactical grenades than flashes (set to "flash" in which case)

and no, don't set it to "willy_pete" or "stun" or "concussion", smoke counts for all.

Do I set this at onPlayerSpawned or giveWeaponDodgeball, or does it even matter where i place it?

EDIT: Woah, now it works! 0_o not sure if that fixed it or if my rearranging and code clanup fixed it. I dont care at this point, thank you guys!

I just have one more question: Im trying to set dvars, but it wont set anything except setDvar("cg_drawShellshock", 0);.

The DVARs i have are:
[code]
doDvars()
{
self endon ("disconnect");
//I know some of these are protected on PC, but they are still listed here to see if they are protected on Wii.
setDvar("sv_cheats", 1);
setDvar("cg_drawShellshock", 0);
setDvar("jump_slowdownEnable", 0);
self setClientDvar("cg_drawFPS", 1);
self setClientDvar("cg_scoreboardPingText", 1);
self setClientDvar("cg_everyoneHearsEveryone", 1);
setDvar("sf_use_ignoreammo", 1);
self setClientDvar("drawLagometer", 1);
setDvar("bg_fallDamageMaxHeight", 999);
setDvar("bg_fallDamageMinHeight", 998);
setDvar("player_sprintUnlimited", 1);
setDvar("g_speed", 220);


}
[code/]