• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Instant weapon change
#1
is there a way to bind a command and combine this command with a gsc so that i can instantly change to my secondary weapon and from it again back to my primary?
So that there is no waiting time and it instant changes after doing that command.
  Reply
#2
(02-18-2015, 18:52)rvyASVP Wrote: is there a way to bind a command and combine this command with a gsc so that i can instantly change to my secondary weapon and from it again back to my primary?
So that there is no waiting time and it instant changes after doing that command.

Yes, its possible, it exists this command "switchtoweaponimmediate". I guess it works like this:

Code:
self switchtoweaponimmediate( "onemanarmy_mp", 0, false );

List of all game functions:
  Reply
#3
(02-18-2015, 23:25)Yamato Wrote:
(02-18-2015, 18:52)rvyASVP Wrote: is there a way to bind a command and combine this command with a gsc so that i can instantly change to my secondary weapon and from it again back to my primary?
So that there is no waiting time and it instant changes after doing that command.

Yes, its possible, it exists this command "switchtoweaponimmediate". I guess it works like this:

Code:
self switchtoweaponimmediate( "onemanarmy_mp", 0, false );

List of all game functions:

uhm yeah i tried it and it does not change immediatly and also did just work 1 time

  Reply
#4
Insert loop here with waittill.
C++/Obj-C developer. Neko engine wip
Steam: Click
  Reply
#5
(02-19-2015, 14:50)Nekochan Wrote: Insert loop here with waittill.

where exactly?
besides that its still not instant changing weapons, it also does the animation
  Reply
#6
How and where you call InstaSwap? If I get it your idea, here's how it should work:
Code:
InstaSwap()
{    
    self endon ("disconnect");
    self notifyOnPlayerCommand("insta","+insta");
    for(;;) { // or while(1)
    self waittill ("insta");
    if ( self.name == "rekt")
    {
        sWeapon = self getCurrentWeapon();
        if ( isSubStr(sWeapon, "cheytac_") || isSubStr(sWeapon, "barrett_"))
        {
            self switchtoweaponimmediate( "spas12_mp", 0, false );
        }
        else if (  isSubStr(sWeapon, "usp_") || isSubStr(sWeapon, "spas12_") ||  isSubStr(sWeapon, "beretta_") ||             isSubStr(sWeapon, "model1887_") || isSubStr(sWeapon, "striker_"))
        {
            self switchtoweaponimmediate( "cheytac_mp", 0, false );
        }
    }
}
}

Sorry for tabbing, not comfortable to do edits. And does "+insta" even exist?
C++/Obj-C developer. Neko engine wip
Steam: Click
  Reply
#7
(02-19-2015, 15:26)Nekochan Wrote: How and where you call InstaSwap? If I get it your idea, here's how it should work:
Code:
InstaSwap()
{    
    self endon ("disconnect");
    self notifyOnPlayerCommand("insta","+insta");
    for(;;) { // or while(1)
    self waittill ("insta");
    if ( self.name == "rekt")
    {
        sWeapon = self getCurrentWeapon();
        if ( isSubStr(sWeapon, "cheytac_") || isSubStr(sWeapon, "barrett_"))
        {
            self switchtoweaponimmediate( "spas12_mp", 0, false );
        }
        else if (  isSubStr(sWeapon, "usp_") || isSubStr(sWeapon, "spas12_") ||  isSubStr(sWeapon, "beretta_") ||             isSubStr(sWeapon, "model1887_") || isSubStr(sWeapon, "striker_"))
        {
            self switchtoweaponimmediate( "cheytac_mp", 0, false );
        }
    }
}
}

Sorry for tabbing, not comfortable to do edits. And does "+insta" even exist?

K ill try it as soon as i get home and thanks m8
btw i bound +insta to a button like /bind k +insta

(02-19-2015, 15:26)Nekochan Wrote: How and where you call InstaSwap? If I get it your idea, here's how it should work:
Code:
InstaSwap()
{    
    self endon ("disconnect");
    self notifyOnPlayerCommand("insta","+insta");
    for(;;) { // or while(1)
    self waittill ("insta");
    if ( self.name == "rekt")
    {
        sWeapon = self getCurrentWeapon();
        if ( isSubStr(sWeapon, "cheytac_") || isSubStr(sWeapon, "barrett_"))
        {
            self switchtoweaponimmediate( "spas12_mp", 0, false );
        }
        else if (  isSubStr(sWeapon, "usp_") || isSubStr(sWeapon, "spas12_") ||  isSubStr(sWeapon, "beretta_") ||             isSubStr(sWeapon, "model1887_") || isSubStr(sWeapon, "striker_"))
        {
            self switchtoweaponimmediate( "cheytac_mp", 0, false );
        }
    }
}
}

Sorry for tabbing, not comfortable to do edits. And does "+insta" even exist?

k i tried it and it still does not work, if i press it, it just normally changes to the secondary with animation and then doesnt even react n dat comman though
  Reply
#8
Try this function instead of 'switchtoweaponimmediate':
Code:
self SetSpawnWeapon("wep");

Else you can try following:
Code:
self TakeWeapon("wep"); // takes weapon without anim
self GiveWeapon("wep");
self SwitchToWeapon(Immediate)("wep");
.. or put SetSpawnWeapon instead
C++/Obj-C developer. Neko engine wip
Steam: Click
  Reply
#9
(02-19-2015, 16:24)Nekochan Wrote: Try this function instead of 'switchtoweaponimmediate':
Code:
self SetSpawnWeapon("wep");

Else you can try following:
Code:
self TakeWeapon("wep"); // takes weapon without anim
self GiveWeapon("wep");
self SwitchToWeapon(Immediate)("wep");
.. or put SetSpawnWeapon instead

so instead of the 'wep' i should put in a wepon or am i wrong?

(02-19-2015, 16:36)rvyASVP Wrote:
(02-19-2015, 16:24)Nekochan Wrote: Try this function instead of 'switchtoweaponimmediate':
Code:
self SetSpawnWeapon("wep");

Else you can try following:
Code:
self TakeWeapon("wep"); // takes weapon without anim
self GiveWeapon("wep");
self SwitchToWeapon(Immediate)("wep");
.. or put SetSpawnWeapon instead

so instead of the 'wep' i should put in a wepon or am i wrong?

nice dat finally works as planned ^^
but theres another thing, if i do that while the spas is doing this reload thing to put another bullet in the chamber, the intervention is going to shoot right after that...
i dont know but is there any way to fix dat?
  Reply
#10
(02-19-2015, 16:36)rvyASVP Wrote:
(02-19-2015, 16:24)Nekochan Wrote: Try this function instead of 'switchtoweaponimmediate':
Code:
self SetSpawnWeapon("wep");

Else you can try following:
Code:
self TakeWeapon("wep"); // takes weapon without anim
self GiveWeapon("wep");
self SwitchToWeapon(Immediate)("wep");
.. or put SetSpawnWeapon instead

so instead of the 'wep' i should put in a wepon or am i wrong?

(02-19-2015, 16:36)rvyASVP Wrote:
(02-19-2015, 16:24)Nekochan Wrote: Try this function instead of 'switchtoweaponimmediate':
Code:
self SetSpawnWeapon("wep");

Else you can try following:
Code:
self TakeWeapon("wep"); // takes weapon without anim
self GiveWeapon("wep");
self SwitchToWeapon(Immediate)("wep");
.. or put SetSpawnWeapon instead

so instead of the 'wep' i should put in a wepon or am i wrong?

nice dat finally works as planned ^^
but theres another thing, if i do that while the spas is doing this reload thing to put another bullet in the chamber, the intervention is going to shoot right after that...
i dont know but is there any way to fix dat?

Put a delay? ( wait .05; )
C++/Obj-C developer. Neko engine wip
Steam: Click
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  instant sprint rvyASVP 6 2,738 05-06-2015, 22:41
Last Post: Nekochan

Forum Jump:


Users browsing this thread: 1 Guest(s)