Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    Arasonic's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    569
    Reputation
    11
    Thanks
    115

    Ammo box / Equpment Box

    I got this ammo box from the AIZombies mod, but I'm trying to make it give ammo when you press F.
    Code:
    giveAmmo()
    {
    level endon("disconnect");
    
    for(;;)
    {
    	foreach( player in level.players )
    	{
    		if(!isDefined(player.ammoing))
    		player.ammoing = false;
    
    		if(distancesquared(self.origin, player.origin) <= 9732 && !player.ammoing)
    		{
    		if(player.sessionstate != "playing")
    		continue;
    
    		player thread ammoWaitThread();
    		
    		player playlocalsound("weap_pickup");
    
    		player giveMaxAmmo(player getCurrentWeapon());
                
                player giveMaxAmmo(player getCurrentOffhand());
    		}
    	}
    
    wait 0.05;
    }
    }
    
    ammoWaitThread()
    {
    self endon("death");
    self endon("disconnect");
    
    self.ammoing = true;
    wait 1;
    self.ammoing = false;
    }
    I've tried quite alot, but when I seem to do it it SPAMS me with ammo when I havent even clicked F.
    So either a solution for that, or a code that would spawn a box that gives ammo at <coordinates>. Though I'd like it to be a thread that I can do into a create block, like i did here:
    Code:
    CreateAmmoBlock(pos, angle)
    {
    	block = spawn("script_model", pos );
    	block setModel("com_bomb_objective");
    	block.angles = angle;
    	block Solid();
          block thread giveAmmo();
    	block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
    	wait 0.01;
    }
    Second one is a box that gives a semtex/frag/c4/stun or whatever. I havent gotten this already, and I'd either like a thread for <coordinates> or something I could add into a block as stated above.

    EDIT: Oh yeah, and make the ammo sign over the ammo box would be pwnage (:
    Tried to copypaste that too from the AIZombies but it kind of went.. bad

    Thanks (:
    Last edited by Arasonic; 10-04-2010 at 06:45 AM.

  2. #2
    alistair4322's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    229
    Reputation
    14
    Thanks
    31
    My Mood
    Goofy
    Because the use function is not here...
    Search for something like "actionslot1"
    EDIT: ammoWaitThread();

  3. #3
    Arasonic's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    569
    Reputation
    11
    Thanks
    115
    Heres what I tried shitloads of, but as I wrote it just spams me with ammo instead when I havent pressed F

    Code:
    ammoWaitThread()
    {
    self endon("death");
    self endon("disconnect");
    
    self notifyOnPlayerCommand( "F", "+activate" );
    
    self waittill("F"); 
    self.ammoing = true;
    wait 3;
    self.ammoing = false;
    }

  4. #4
    alistair4322's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    229
    Reputation
    14
    Thanks
    31
    My Mood
    Goofy
    Quote Originally Posted by Arasonic View Post
    Heres what I tried shitloads of, but as I wrote it just spams me with ammo instead when I havent pressed F

    Code:
    ammoWaitThread()
    {
    self endon("death");
    self endon("disconnect");
    
    self notifyOnPlayerCommand( "F", "+activate" );
    
    self waittill("F"); 
    self.ammoing = true;
    wait 3;
    self.ammoing = false;
    }
    Um...If i were u i will not use that code

    EDIT: Because it spams u with ammo in AIZombies too

  5. #5
    Arasonic's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    569
    Reputation
    11
    Thanks
    115
    Quote Originally Posted by alistair4322 View Post
    Um...If i were u i will not use that code

    EDIT: Because it spams u with ammo in AIZombies too
    x)
    All I want basicly is either a solution for that or a whole new code >.<
    & Still looking for a box with semtex etc

  6. #6
    alistair4322's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    229
    Reputation
    14
    Thanks
    31
    My Mood
    Goofy
    Quote Originally Posted by Arasonic View Post
    x)
    All I want basicly is either a solution for that or a whole new code >.<
    & Still looking for a box with semtex etc
    I am nearly done...And for semtex...just some simple code is ok...

  7. #7
    alistair4322's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    229
    Reputation
    14
    Thanks
    31
    My Mood
    Goofy
    It is diffcult...Still can't get it right

    Quote Originally Posted by Arasonic View Post
    x)
    All I want basicly is either a solution for that or a whole new code >.<
    & Still looking for a box with semtex etc
    May be this will help

    Code:
    giveAmmo()
    {
    level endon("disconnect");
    
    for(;;)
    {
    	foreach( player in level.players )
    	{
    		if(!isDefined(player.ammoing))
    		player.ammoing = false;
    
    		if(distancesquared(self.origin, player.origin) <= 9732 && !player.ammoing) //CHANGE 9732 TO 50
    		{
    		if(player.sessionstate != "playing")
    		continue;
    
    		player thread ammoWaitThread();
    		
    		player playlocalsound("weap_pickup");
    
    		player giveMaxAmmo(player getCurrentWeapon());
                
                player giveMaxAmmo(player getCurrentOffhand());
    		}
    	}
    
    wait 0.05;
    }
    }
    
    ammoWaitThread()
    {
    self endon("death");
    self endon("disconnect");
    
    self.ammoing = true;
    wait 1;
    self.ammoing = false;
    }
    Last edited by alistair4322; 10-04-2010 at 09:43 AM.

  8. #8
    Arasonic's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    569
    Reputation
    11
    Thanks
    115
    Uhm, what did you do?

  9. #9
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,802
    Reputation
    3165
    Thanks
    73,322
    My Mood
    Breezy
    Code:
    giveAmmo()
    {
    level endon("disconnect");
    
    for(;;)
    {
        foreach( player in level.players )
        {
            if(!isDefined(player.ammoing))
            player.ammoing = false;
    
            if(distancesquared(self.origin, player.origin) <= 9732 && !player.ammoing)
            {
            if(player.sessionstate != "playing")
            continue;
    
            player thread ammoWaitThread();
            
            player playlocalsound("weap_pickup");
    
            player giveMaxAmmo(player getCurrentWeapon());
                
                player giveMaxAmmo(player getCurrentOffhand());
            }
        }
    
    wait 0.05;
    }
    }
    
    ammoWaitThread()
    {
    self endon("death");
    self endon("disconnect");
    
    for(;;)
    {
       if(player UseButtonPressed())
       {
            self.ammoing = true;
       }
        wait 1;
        self.ammoing = false;
    }
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.6.1 *NEW* Windows 10 compatible!
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  10. #10
    Arasonic's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    569
    Reputation
    11
    Thanks
    115
    That just gets me a bad syntax 0o

  11. #11
    alistair4322's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    229
    Reputation
    14
    Thanks
    31
    My Mood
    Goofy
    Quote Originally Posted by Arasonic View Post
    That just gets me a bad syntax 0o
    He miss a } at last

  12. #12
    Arasonic's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    569
    Reputation
    11
    Thanks
    115
    Ehhhhhh... It worked fine before I changed it again and added another }, but now when I added it, I got uninitialised variable 'player'

  13. #13
    alistair4322's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    229
    Reputation
    14
    Thanks
    31
    My Mood
    Goofy
    Quote Originally Posted by Arasonic View Post
    Ehhhhhh... It worked fine before I changed it again and added another }, but now when I added it, I got uninitialised variable 'player'
    Me too...The code is not working again...

  14. #14
    Arasonic's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    569
    Reputation
    11
    Thanks
    115
    Another thing, this:
    Code:
    SpawnWeapon(weapName, coords, angles)
    {
    point = spawn("script_origin", coords);
    weap = SpawnWeap(weapName, point.origin);
    
    if(isDefined(angles))
    weap.angles = angles;
    
    weap linkto( point );
    
    return point;
    }
    Is there any way I could make it come with text as the last one, 'Press F to swap for <weapon>'?

  15. #15
    alistair4322's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    229
    Reputation
    14
    Thanks
    31
    My Mood
    Goofy
    Quote Originally Posted by Arasonic View Post
    Another thing, this:
    Code:
    SpawnWeapon(weapName, coords, angles)
    {
    point = spawn("script_origin", coords);
    weap = SpawnWeap(weapName, point.origin);
    
    if(isDefined(angles))
    weap.angles = angles;
    
    weap linkto( point );
    
    return point;
    }
    Is there any way I could make it come with text as the last one, 'Press F to swap for <weapon>'?
    Your original code make that already, don't u?

Page 1 of 2 12 LastLast

Similar Threads

  1. [Solved]Problem with ammo box...
    By alistair4322 in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 3
    Last Post: 10-08-2010, 03:21 PM
  2. The *new* badge, new weapons?, AMMO BOX!?
    By wouter11 in forum WarRock - International Hacks
    Replies: 3
    Last Post: 04-21-2009, 07:41 AM
  3. OldSchool Like ammo&life boxes
    By _gamer21_ in forum WarRock - International Hacks
    Replies: 9
    Last Post: 10-30-2008, 02:13 AM
  4. Ammo/Damage Box Values?
    By wooden_amulet in forum WarRock - International Hacks
    Replies: 4
    Last Post: 06-02-2006, 03:55 AM
  5. Advanced Box Cut
    By Chronologix in forum Tutorials
    Replies: 11
    Last Post: 01-23-2006, 10:00 PM