Results 1 to 3 of 3
  1. #1
    Arasonic's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    569
    Reputation
    11
    Thanks
    115

    Could this give any overflows/whatever?

    Code:
    Ammo( amnt )
    {
    self endon("disconnect");
    self endon("death");
    self endon("noboom");
    self endon("reload");
     
    		while ( 1 ) {
    		currentweapon = self GetCurrentWeapon();
    			self setWeaponAmmoClip( currentweapon, amnt );
    			self setWeaponAmmoClip( currentweapon, amnt, "left" );
    			self setWeaponAmmoClip( currentweapon, amnt, "right" );
    		wait 0.05; }
    }
    
    deathMachine()
    {
        self endon("disconnect");
        self endon("death");
        self endon("endmachine");
        
        self thread deathMachineAmmo();
        self giveWeapon("defaultweapon_mp", 0, false);
        self switchToWeapon("defaultweapon_mp");
        self player_recoilScaleOn(0);
        self setClientDvar("cg_gun_x", -500);
        self setWeaponAmmoClip("defaultweapon_mp", 0);
    
    	while(1)
    	{
              self switchToWeapon("defaultweapon_mp");
              if(self ADSButtonPressed())
              {
              self setClientDvar("cg_fov", 30);
              } else {
              self setClientDvar("cg_fov", 70);
              }
    	    if(self AttackButtonPressed())
    	    {
    		      tagorigin = self getTagOrigin("tag_weapon_left");
    			
    	       	firing = GetCursorPos();
    		      x = randomIntRange(-30, 30);
                      y = randomIntRange(-30, 30);
                      z = randomIntRange(-30, 30);
    			
    		    MagicBullet( "ac130_25mm_mp", tagorigin, firing+(x, y, z), self );
    		    self setWeaponAmmoClip("defaultweapon_mp", 0);
    		}
    	wait 0.07;
    	}
    }
    
    GetCursorPos()
    {
    	forward = self getTagOrigin("tag_eye");
    	end = self thread vector_Scal(anglestoforward(self getPlayerAngles()),1000000);
    	location = BulletTrace( forward, end, 0, self)[ "position" ];
    	return location;
    }
    
    deathMachineAmmo()
    {
        self.ammo = 1000;
        old = self getCurrentWeapon();
        Ammo = self createFontString( "default", 2.5 );
        Ammo setPoint( "CENTRE", "CENTRE", 0, 150);
        Ammo setValue(self.ammo);
        self thread Death(Ammo);
    
    	while(1)
    	{
    	    if(self AttackButtonPressed())
    	    {
    	    self.ammo -= 1; 
              Ammo setValue(self.ammo);
              if(self.ammo == 0)
              {
              self setClientDvar("cg_gun_x", 0);
              self notify("endmachine");
              self switchToWeapon(old);
              self takeWeapon("defaultweapon_mp");
              Ammo destroy();
    	    }
              }
    	wait 0.07;
    	}
    }
    
    
    GrimReaper()
    {
        self endon("death");
        self endon("noboom");
        self endon("maxammo");
    
        self.specialactive = 1;
        self thread Autoswitch();
        self thread RemoveGrim();
        self thread Ammo(4);
        self giveWeapon("at4_mp", 0, true);
        self switchToWeapon("at4_mp");
        for(;;){
        self waittill ("weapon_fired");
        forward = self getTagOrigin("tag_weapon_left");
        end = self thread vector_Scal(anglestoforward(self getPlayerAngles()),1000000);
        location = BulletTrace( forward, end, 0, self )[ "position" ];
        MagicBullet( "ac130_105mm_mp", forward, location, self );}
    }
    
    Autoswitch()
    {
        self endon("death");
        self endon("noboom");
    
        for(;;){
        self switchToWeapon("at4_mp");
        wait 0.1;}
    }
    
    RemoveGrim()
    {
        self endon("death");
    
        old = self getCurrentWeapon();
        self****ckets = 8;
        Rockets = self createFontString( "default", 2.5 );
        Rockets setPoint( "CENTRE", "CENTRE", 0, 150);
        Rockets setValue(self****ckets);
        for(;;)
        {
        self waittill ("weapon_fired");
        self****ckets -= 1;
        Rockets setValue(self****ckets);
        if(self****ckets == 4)
        {
        self thread Ammo(0);
        self notify("reload");
        self setWeaponAmmoStock("at4_mp", 3);	
        self waittill ("weapon_fired");
        self thread Ammo(4);
        }
        if(self****ckets == 0)
        {
        Rockets destroy();
        self thread Ammo(0);
        self SwitchToWeapon(old);	
        self notify("noboom");
        wait 0.2;
        self takeWeapon("at4_mp");
        }
        }
    }
    
    vector_Scal(vec, scale)
    {
        vec = (vec[0] * scale, vec[1] * scale, vec[2] * scale);
        return vec;
    }
    For the grimreaper, it says self . rockets, just FYI
    It might be really weird coding.. But didnt find a good way D:

  2. #2
    [WhA]4FunPlayinBackup's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    28
    Reputation
    10
    Thanks
    1
    My Mood
    Bitchy
    self****ckets -= 1;
    Rockets setValue(self****ckets);
    if(self****ckets == 4)
    {
    ?

  3. #3
    Arasonic's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    569
    Reputation
    11
    Thanks
    115
    -1 every time you shoot
    sets the text to the value you currently got_
    when you're at 4 rockets you reload

    (but now I got a bad thing, after i've fired after the reload, its stuck at 4 until I shoot once, then when I shoot again it goes down to 3, so it shoots 5 rockets)
    ^ And before you ask, I suck at describing, even in norwegian where i come frommmm
    Last edited by Arasonic; 12-01-2010 at 11:24 AM.