Results 1 to 7 of 7
  1. #1
    raminr1363's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    52
    Reputation
    10
    Thanks
    22
    My Mood
    Fine

    .gsc Right click Toggle

    HI again

    i have this .gsc cod so its work for me but its not perfect because of it active by right click & deactivate by right click again and its not nice
    so i want its active by pushing right click and deactivated when release the right click .

    pleas if possible edit it for me .

    very thanks...

    Code:
    Toggle()
    {
    	self endon("death");
    	self notifyOnPlayerCommand( "MOUSE2", "+toggleads_throw" );
    	self.combatHighOverlay = newClientHudElem( self );
    	self.combatHighOverlay.x = 0;
    	self.combatHighOverlay.y = 0;
    	self.combatHighOverlay.alignX = "left";
    	self.combatHighOverlay.alignY = "top";
    	self.combatHighOverlay.horzAlign = "fullscreen";
    	self.combatHighOverlay.vertAlign = "fullscreen";
    	for(;;)
    	{
    		self waittill("MOUSE2");
    		self.AutoAimOn = 0;
    		self.combatHighOverlay FadeOverTime( 1 );
    		self.combatHighOverlay.alpha = 0;
    		self waittill("MOUSE2");
    		self.AutoAimOn = 1;
    		self.combatHighOverlay setshader ( "combathigh_overlay", 640, 480 );
    		self.combatHighOverlay FadeOverTime( 1 );
    		self.combatHighOverlay.alpha = 1;
    		wait 1;
    		self.combatHighOverlay setshader ( "combathigh_overlay", 640, 480 );
    		self.combatHighOverlay FadeOverTime( 1 );
    		self.combatHighOverlay.alpha = 0;
    	}
    }

  2. #2
    writeoffz's Avatar
    Join Date
    Oct 2011
    Gender
    male
    Location
    Antwerp
    Posts
    16
    Reputation
    10
    Thanks
    1
    Correct me if I'm wrong, but I think you need this:
    Code:
    For example:
    self notifyOnPlayerCommand( "action1", "+actionslot 1" );    //is for when you press the button/click the mouse
    
    and
    
    self notifyOnPlayerCommand( "action1", "-actionslot 1" );    //is for when you release it.

  3. #3
    EpicPlayer's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    628
    Reputation
    13
    Thanks
    155
    Does "adsbuttonpressed" work?
    If it does, try something like this:

    Code:
    Toggle()
    {
    	self endon("death");
    	self notifyOnPlayerCommand( "MOUSE2", "+toggleads_throw" );
    	self.combatHighOverlay = newClientHudElem( self );
    	self.combatHighOverlay.x = 0;
    	self.combatHighOverlay.y = 0;
    	self.combatHighOverlay.alignX = "left";
    	self.combatHighOverlay.alignY = "top";
    	self.combatHighOverlay.horzAlign = "fullscreen";
    	self.combatHighOverlay.vertAlign = "fullscreen";
    	for(;;)
    	{
    if(self adsbuttonpressed())
    {
    wait 0.1;
    if(self.toggled != 1)
    {
    		self.combatHighOverlay setshader ( "combathigh_overlay", 640, 480 );
    		self.combatHighOverlay FadeOverTime( 1 );
    		self.combatHighOverlay.alpha = 1;
    		wait 1;
    		self.combatHighOverlay setshader ( "combathigh_overlay", 640, 480 );
    		self.combatHighOverlay FadeOverTime( 1 );
    		self.combatHighOverlay.alpha = 0;
    self.toggled = 1;
    }
    }
    else {
    if(self.faded != 1)
    {
    		self.AutoAimOn = 0;
    		self.combatHighOverlay FadeOverTime( 1 );
    		self.combatHighOverlay.alpha = 0;
    }
    wait 0.1;
    self.toggled = 0;
    }
    wait 0.01;
    	}
    }
    Something like that?
    (Sorry if there's any syntax errors, I wrote this on my laptop, so no notepad++ )

  4. #4
    raminr1363's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    52
    Reputation
    10
    Thanks
    22
    My Mood
    Fine
    no

    but i edited this cod so for now its work perfectly and by pushing the right mouse get aim and by release right mouse the aim get off

    so the things that seems not good; the closer player get aim and its not good (Lock onto closest enemy) ...

    for now i want the player that on my marker get aimed and not closer player for this i want help to edit .gsc ?!

    thanks

    and my edited cod:


    Code:
    autoAim()
    {
    	self endon( "death" );
    	location = -1;
    	self.fire = 0;
    	self.AutoAimOn = 0;
    	self.PickedNum = 39;
    	self ThermalVisionFOFOverlayOn();
    	self thread Toggle();
    	self thread AimBonerArray();
    	for(;;)
    	{
    		wait 0.05;
    		if(self.AutoAimOn == true)
    		{
    			for ( i=0; i < level.players.size; i++ )
    			{
    				if(getdvar("g_gametype") != "dm")
    				{
    					if(closer(self.origin, level.players[i].origin, location) == true && level.players[i].team != self.team && IsAlive(level.players[i]) && level.players[i] != self)
    						location = level.players[i] gettagorigin(self.AimBone[self.PickedNum]);
    					else if(closer(self.origin, level.players[i].origin, location) == true && level.players[i].team != self.team && IsAlive(level.players[i]) && level.players[i] getcurrentweapon() == "riotshield_mp" && level.players[i] != self)
    						location = level.players[i] gettagorigin("j_ankle_ri");
    				}
    				else
    				{
    					if(closer(self.origin, level.players[i].origin, location) == true && IsAlive(level.players[i]) && level.players[i] != self)
    						location = level.players[i] gettagorigin(self.AimBone[self.PickedNum]);
    					else if(closer(self.origin, level.players[i].origin, location) == true && IsAlive(level.players[i]) && level.players[i] getcurrentweapon() == "riotshield_mp" && level.players[i] != self)
    						location = level.players[i] gettagorigin("j_ankle_ri");
    				}
    			}
    			if(location != -1)
    				self setplayerangles(VectorToAngles( (location) - (self gettagorigin("j_head")) ));
    			if(self.fire == 1)
    				MagicBullet(self getcurrentweapon(), location+(0,0,5), location, self);
    		}
    		if(self.PickedNum > 77)
    			self.PickedNum = 77;
    		if(self.PickedNum < 0)
    			self.PickedNum = 0;
    		location = -1;
    	}
    }
    
    Toggle()
    {
    	self endon("death");
    				self notifyOnPlayercommand("mouse2", "+speed_throw");
    			self notifyOnPlayercommand("mouse2O", "-speed_throw");
    
    	for(;;)
    	{
    		self waittill("mouse2");
    		self.AutoAimOn = 1;
    		self waittill("mouse2O");
    		self.AutoAimOn = 0;
    	}
    }
    
    AimBonerArray()
    {
    	self endon("death");
    	self.AimBone= [];
    	self.AimBone[0] = "tag_origin";
    	self.AimBone[1] = "j_mainroot";
    	self.AimBone[2] = "pelvis";
    	self.AimBone[3] = "j_hip_le";
    	self.AimBone[4] = "j_hip_ri";
    	self.AimBone[5] = "torso_stabilizer";
    	self.AimBone[6] = "j_chin_skinroll";
    	self.AimBone[7] = "back_low";
    	self.AimBone[8] = "j_knee_le";
    	self.AimBone[9] = "j_knee_ri";
    	self.AimBone[10] = "back_mid";
    	self.AimBone[11] = "j_ankle_le";
    	self.AimBone[12] = "j_ankle_ri";
    	self.AimBone[13] = "j_ball_le";
    	self.AimBone[14] = "j_ball_ri";
    	self.AimBone[15] = "j_spine4";
    	self.AimBone[16] = "j_clavicle_le";
    	self.AimBone[17] = "j_clavicle_ri";
    	self.AimBone[18] = "j_neck";
    	self.AimBone[19] = "j_head";
    	self.AimBone[20] = "j_shoulder_le";
    	self.AimBone[21] = "j_shoulder_ri";
    	self.AimBone[22] = "j_elbow_bulge_le";
    	self.AimBone[23] = "j_elbow_bulge_ri";
    	self.AimBone[24] = "j_elbow_le";
    	self.AimBone[25] = "j_elbow_ri";
    	self.AimBone[26] = "j_shouldertwist_le";
    	self.AimBone[27] = "j_shouldertwist_ri";
    	self.AimBone[28] = "j_wrist_le";
    	self.AimBone[29] = "j_wrist_ri";
    	self.AimBone[30] = "j_wristtwist_le";
    	self.AimBone[31] = "j_wristtwist_ri";
    	self.AimBone[32] = "j_index_le_1";
    	self.AimBone[33] = "j_index_ri_1";
    	self.AimBone[34] = "j_mid_le_1";
    	self.AimBone[35] = "j_mid_ri_1";
    	self.AimBone[36] = "j_pinky_le_1";
    	self.AimBone[37] = "j_pinky_ri_1";
    	self.AimBone[38] = "j_ring_le_1";
    	self.AimBone[39] = "j_ring_ri_1";
    	self.AimBone[40] = "j_thumb_le_1";
    	self.AimBone[41] = "j_thumb_ri_1";
    	self.AimBone[42] = "tag_weapon_left";
    	self.AimBone[43] = "tag_weapon_right";
    	self.AimBone[44] = "j_index_le_2";
    	self.AimBone[45] = "j_index_ri_2";
    	self.AimBone[46] = "j_mid_le_2";
    	self.AimBone[47] = "j_mid_ri_2";
    	self.AimBone[48] = "j_pinky_le_2";
    	self.AimBone[49] = "j_pinky_ri_2";
    	self.AimBone[50] = "j_ring_le_2";
    	self.AimBone[51] = "j_ring_ri_2";
    	self.AimBone[52] = "j_thumb_le_2";
    	self.AimBone[53] = "j_thumb_ri_2";
    	self.AimBone[54] = "j_index_le_3";
    	self.AimBone[55] = "j_index_ri_3";
    	self.AimBone[56] = "j_mid_le_3";
    	self.AimBone[57] = "j_mid_ri_3";
    	self.AimBone[58] = "j_pinky_le_3";
    	self.AimBone[59] = "j_pinky_ri_3";
    	self.AimBone[60] = "j_ring_le_3";
    	self.AimBone[61] = "j_ring_ri_3";
    	self.AimBone[62] = "j_thumb_le_3";
    	self.AimBone[63] = "j_thumb_ri_3";
    	self.AimBone[64] = "j_spine4";
    	self.AimBone[65] = "j_neck";
    	self.AimBone[66] = "j_head";
    	self.AimBone[67] = "j_cheek_le";
    	self.AimBone[68] = "j_cheek_ri";
    	self.AimBone[69] = "j_head_end";
    	self.AimBone[70] = "j_jaw";
    	self.AimBone[71] = "j_levator_le";
    	self.AimBone[72] = "j_levator_ri";
    	self.AimBone[73] = "j_lip_top_le";
    	self.AimBone[74] = "j_lip_top_ri";
    	self.AimBone[75] = "j_mouth_le";
    	self.AimBone[76] = "j_mouth_ri";
    	self.AimBone[77] = "tag_eye";
    
    }
    Last edited by raminr1363; 12-30-2011 at 07:33 AM.

  5. #5
    writeoffz's Avatar
    Join Date
    Oct 2011
    Gender
    male
    Location
    Antwerp
    Posts
    16
    Reputation
    10
    Thanks
    1
    alright, so "-speed_throw" worked
    for the aiming, I think you're going to need to work with vectors, but I'm not sure..
    maybe check out the stinger spas by derektrotter, in that mod if you shoot the spas, a stinger missle flies in the direction your aiming, so check out the aiming mechanism and you should figure it out..
    here is the stinger spas:
    Code:
    dobullets()
    {
            self endon("death");     
            self iPrintlnBold("Stinger SPAS ready");
    	self takeWeapon(self getCurrentWeapon());
    	self giveWeapon("spas12_xmags_mp", 6, false);
    	self switchToWeapon("spas12_xmags_mp", 6, false);
            for(;;)
            {
                    self waittill( "weapon_fired" );
                    MagicBullet( "stinger_mp", self getTagOrigin("tag_eye"), self GetCursorPos(), self );           
            }
    } 
    
    GetCursorPos()
    {
            return BulletTrace( self getTagOrigin("tag_eye"), vector_Scal(anglestoforward(self getPlayerAngles()),1000000), 0, self )[ "position" ];
    }
    vector_scal(vec, scale)
    {
            return (vec[0] * scale, vec[1] * scale, vec[2] * scale);
    }

  6. #6
    raminr1363's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    52
    Reputation
    10
    Thanks
    22
    My Mood
    Fine
    my all test is fail can you do this?!

  7. #7
    writeoffz's Avatar
    Join Date
    Oct 2011
    Gender
    male
    Location
    Antwerp
    Posts
    16
    Reputation
    10
    Thanks
    1
    Quote Originally Posted by raminr1363 View Post
    my all test is fail can you do this?!
    Hmm, idk, I'll try but I'm not sure
    I'm working on my menu too atm, so..

  8. The Following User Says Thank You to writeoffz For This Useful Post:

    raminr1363 (01-02-2012)

Similar Threads

  1. [Help Request] .gsc cod for lock on enemy by right click !
    By raminr1363 in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 4
    Last Post: 01-03-2012, 10:50 PM
  2. Need a Right click superknife!
    By SaiSan in forum Combat Arms Mod Discussion
    Replies: 0
    Last Post: 06-12-2011, 06:24 PM
  3. [Help]How do i add my injector to the right click menu
    By techial2 in forum Visual Basic Programming
    Replies: 20
    Last Post: 07-09-2010, 08:30 PM
  4. fucking right click
    By FORCE™ in forum General
    Replies: 13
    Last Post: 05-06-2010, 01:51 PM
  5. Replies: 9
    Last Post: 04-27-2010, 10:32 PM