ItsMods

Full Version: Instant weapon change
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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.
(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:
(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

Insert loop here with waittill.
(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
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?
(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
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
(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?
(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; )
Pages: 1 2