Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    codGmer's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    lol
    Posts
    45
    Reputation
    10
    Thanks
    0
    My Mood
    Relaxed

    barret only in prone

    hello,

    I am making a code that disable's usage of the barret in stand and crouch position.

    Code:
    barretalleenliggend()
    {
    self endon("disconnect");
     self endon("death");
      for(;;)
       {
        currentweapon = self getCurrentWeapon();
        if(currentweapon == "barrett_mp" && self getstance() != "prone")
          {
    	  self _disableWeapon();
    	  }
     else
          {
    	  self _enableWeapon();
          }
    	  wait 0.4;
     }
      wait 0.4;
    }
    Only thing is it just keeps enable and disable the weapon not 1 time.

    i already tried with remove the ammo but resetting the ammo again is hard for me.

  2. #2
    Talamaur's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    25
    Reputation
    10
    Thanks
    10
    My Mood
    Blah
    Code:
    testBarrett()
    {
    	self endon("death");
    	self endon("disconnect");
    	
    	weapon = self getCurrentWeapon();
    	weaponDisabled = false;
    	
    	for(;;) {
    		if(isSubStr(weapon, "barrett") && !weaponDisabled) {
    			self allowADS(false);
    			self allowJump(false);
    			self allowSprint(false);
    			self disableUsability();
    			
    			weaponDisabled = true;
    			self thread monitorBarrett();
    		}
    		else if(!isSubStr(weapon, "barrett") && weaponDisabled) {
    			self allowADS(true);
    			self allowJump(true);
    			self allowSprint(true);
    			self enableUsability();
    			
    			weaponDisabled = false;
    		}
    		
    		self waittill("weapon_change", weapon);
    	}
    }
    
    monitorBarrett()
    {
    	self endon("death");
    	self endon("disconnect");
    	self endon("weapon_change");
    	
    	for(;;) {
    		self waittill("stance_changed", st);
    		if(st != "prone") {
    			self allowADS(false);
    		}
    		else {
    			self allowADS(true);
    		}
    	}
    }
    
    monitorStances()
    {
    	self endon("death");
    	self endon("disconnect");
    	
    	stance = self getStance();
    	
    	for(;;) {
    		while(self getStance() == stance) wait(0.05);
    		
    		stance = self getStance();
    		self notify("stance_changed", stance);
    	}
    }
    monitorStances() and testBarrett() should run after "spawned_player" notify. Like there:
    Code:
    actSpawn()
    {
    	self endon("disconnect");
    	
    	for(;;) {
    		self waittill("spawned_player");
    		self thread testBarrett();
    	}
    }
    Tell me if this will work.
    My english skills too bad...

  3. #3
    codGmer's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    lol
    Posts
    45
    Reputation
    10
    Thanks
    0
    My Mood
    Relaxed
    Thanks for the reply

    It works but thanks for that but the problem is that you only can't aim when you stand i am trying to disable shooting when you stand and crouch. So basicly no shooting when in stand, crouch and shooting enabled when you are prone.

  4. #4
    mathieutje12's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Close to my PC
    Posts
    578
    Reputation
    14
    Thanks
    165
    My Mood
    Angelic
    Thats easy to fix just set the ammo clip to 0 or change the iDamage to 0

  5. #5
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,675
    Reputation
    905
    Thanks
    18,544
    My Mood
    Angelic
    I am sorry, but I am a bit stupid
    What you mean?

    You want like:

    Stand = No Aming.
    Crouch = No Shoothing?

    What you mean?

    If you tell me clear what you want, I can help. But Since I am so stupid... Well, I can't

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  6. #6
    codGmer's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    lol
    Posts
    45
    Reputation
    10
    Thanks
    0
    My Mood
    Relaxed
    Quote Originally Posted by Jorndel View Post
    I am sorry, but I am a bit stupid
    What you mean?

    You want like:

    Stand = No Aming.
    Crouch = No Shoothing?

    What you mean?

    If you tell me clear what you want, I can help. But Since I am so stupid... Well, I can't
    I mean like:

    stand = aiming but no shooting.
    crouch = aiming but no shooting.
    prone = aiming and shooting.

  7. #7
    mathieutje12's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Close to my PC
    Posts
    578
    Reputation
    14
    Thanks
    165
    My Mood
    Angelic
    So basically u want if you prone u can shoot?

  8. #8
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,675
    Reputation
    905
    Thanks
    18,544
    My Mood
    Angelic
    Quote Originally Posted by codGmer View Post
    I mean like:

    stand = aiming but no shooting.
    crouch = aiming but no shooting.
    prone = aiming and shooting.
    See how easy it was to type so little and it gave so much more sence....

    Well, what you want is:
    Code:
    WepCode()
    {
    for(;;)
    {
    if ( self GetStance() == "stand" )
    {
    self notify("stance");
    cw = self getCurrentWeapon();
    self setWeaponAmmoStock(cw, 0);
    self setWeaponAmmoClip(cw, 0);
    }
    else
    {
    if ( self GetStance() == "crouch" )
    {     
    self notify("stance");
    cw = self getCurrentWeapon();
    self setWeaponAmmoStock(cw, 0);
    self setWeaponAmmoClip(cw, 0);
    }
    else
    {
    if ( self GetStance() == "prone" )
    {     
    cw = self getCurrentWeapon();
    self setWeaponAmmoStock(cw, ammocount);
    self setWeaponAmmoClip(cw, ammocount2);
    }
    self waittill("stance");
    ammocount = self getWeaponAmmoClip();
    ammocount2 =  self getWeaponAmmoStock();
    }
    wait 0.7;
    }
    }
    Well, I can't say that it will work.
    But maybe you see what I mean here....

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  9. #9
    codGmer's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    lol
    Posts
    45
    Reputation
    10
    Thanks
    0
    My Mood
    Relaxed
    Quote Originally Posted by mathieutje12 View Post
    So basically u want if you prone u can shoot?
    yes and if you stand, crouch you can't shoot.

  10. #10
    codGmer's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    lol
    Posts
    45
    Reputation
    10
    Thanks
    0
    My Mood
    Relaxed
    I made this code based on your code

    Code:
    barretalleenliggend()
    {
    self endon("disconnect");
     self endon("death");
     currentweapon = self getCurrentWeapon();
      while(currentweapon == isSubStr(currentweapon, "barrett"))
       {
    	  if(self getstance() == "prone")
    	  {
    self setWeaponAmmoStock(currentweapon, 20);
    	  }
     else
          {
    	  self setWeaponAmmoStock(currentweapon, 0);
    self setWeaponAmmoClip(currentweapon, 0);
          }
    	  wait 0.4;
     }
    }
    The only problem now is that is gives the weapon unlimited ammo when you are prone. How to get the stock ammo? This code didnt work

    Code:
    ammocount = self getWeaponAmmoClip();
    ammocount2 =  self getWeaponAmmoStock();
    
    self setWeaponAmmoStock(cw, ammocount);
    self setWeaponAmmoClip(cw, ammocount2);

  11. #11
    dsds1's Avatar
    Join Date
    Aug 2011
    Gender
    male
    Posts
    63
    Reputation
    10
    Thanks
    2
    My Mood
    Fine
    I dunno the code of disable shooting, but you could try in _damage.gsc and search for
    Code:
    Callback_PlayerDamage_internal( eInflictor, eAttacker, victim, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime )
    there is two, but you could try the first

    and add

    Code:
    if(isSubStr(sWeapon, "barrett") && self getstance() != "prone") 
    { 
     iDamage = 0; 
    }
    this doesn't disable shooting(and don't ask what the code for it cuz i dunno), but it's make bullet hits with no damage

  12. #12
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,675
    Reputation
    905
    Thanks
    18,544
    My Mood
    Angelic
    Quote Originally Posted by dsds1 View Post
    I dunno the code of disable shooting, but you could try in _damage.gsc and search for
    Code:
    Callback_PlayerDamage_internal( eInflictor, eAttacker, victim, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime )
    there is two, but you could try the first

    and add

    Code:
    if(isSubStr(sWeapon, "barrett") && self getstance() != "prone") 
    { 
     iDamage = 0; 
    }
    this doesn't disable shooting(and don't ask what the code for it cuz i dunno), but it's make bullet hits with no damage
    Then you just disable the damage, and you will still lose bullets.

    What I tryed to do is:
    It notifyes the getbullets. And save them.
    And when he lai down, the saved bullets "load" back into his chamber.

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  13. #13
    dsds1's Avatar
    Join Date
    Aug 2011
    Gender
    male
    Posts
    63
    Reputation
    10
    Thanks
    2
    My Mood
    Fine
    Quote Originally Posted by Jorndel View Post
    Then you just disable the damage, and you will still lose bullets.
    nope, let the OP try cuz I tried the same code ad it didn't lose bullets when if statement is false

  14. #14
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,675
    Reputation
    905
    Thanks
    18,544
    My Mood
    Angelic
    Quote Originally Posted by dsds1 View Post
    nope, let the OP try cuz I tried the same code ad it didn't lose bullets when if statement is false
    I don't get what you mean then.
    Do you understand his question?

    How long have you been doing GSC?

    Because for me... I don't think you have done this for a long time. Maybe 1/2 month or a bit more...

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  15. #15
    codGmer's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    lol
    Posts
    45
    Reputation
    10
    Thanks
    0
    My Mood
    Relaxed
    Quote Originally Posted by Jorndel View Post
    I don't get what you mean then.
    Do you understand his question?

    How long have you been doing GSC?

    Because for me... I don't think you have done this for a long time. Maybe 1/2 month or a bit more...
    Who are you asking that? If it is me, 6 months i think.

Page 1 of 2 12 LastLast

Similar Threads

  1. This is only possible in...
    By arunforce in forum General
    Replies: 0
    Last Post: 12-03-2006, 10:33 PM
  2. video disk only plays audio, WDF?
    By m164life in forum Hardware & Software Support
    Replies: 15
    Last Post: 10-22-2006, 01:12 PM
  3. [Theory] Only to the Smarts.....weapons
    By hakufu in forum WarRock - International Hacks
    Replies: 14
    Last Post: 09-21-2006, 02:49 PM
  4. bant stick VICTIM ONLY tag
    By -[standoff]- in forum Art & Graphic Design
    Replies: 1
    Last Post: 08-29-2006, 02:27 PM
  5. Thread entirely 1337 speak only
    By EleMentX in forum General
    Replies: 27
    Last Post: 08-14-2006, 06:08 PM