ItsMods

Full Version: how to run a method on press a key?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi, Is there a way to open the mod menu for example inn the game on press key F2 or another key ? For example. self waittill(button F2 pressed);

Sorry for grammar, i exploined the problem very bad. Hope you understand the problem.
Things like those need to be binded.
But then every player need to bind them to play my mod

Inviato dal mio 2206_jbla768_f utilizzando Tapatalk
You could use any of these do something like while( isAlive( self ) ) { if( self ----pressed ) { self openMenu(); } }
List to choose from [Image: xxd.png]
ButtonPressed is just self buttonPressed( "the type of bind i.e. +actionslot 1" );
Ok i tried this but it give me an error like @441968 on the console.
So here my code:

doButton()
{
self endon("death");
self endon("disconnect");

self thread doFragButton();
self thread doUseButton();
self thread doJumpButton();
self thread doSlot1Button();
for(;Wink
{
if(self ActionSlotOneButtonPressed()) self notify("up");
if(self ActionSlotTwoButtonPressed()) self notify("down");
if(self ActionSlotThreeButtonPressed()) self notify("left");
if(self ActionSlotFourButtonPressed()) self notify("right");
if(self FragButtonPressed()) self notify("rb");
if(self MeleeButtonPressed()) self notify("rs");
if(self ADSButtonPressed()) self notify ("left_trigger");
if(self AttackButtonPressed()) self notify ("right_trigger");
if(self SecondaryOffHandButtonPressed()) self notify("lb");
if(self JumpButtonPressed()) self notify("button_a");
if(self UseButtonPressed()) self notify ("button_x");
if(self ChangeSeatButtonPressed()) self notify ("button_y");
if(self ThrowButtonPressed()) self notify ("button_b");
wait(0.05);
}
}
doFragButton()
{
self waittill("rb");
self thread doSpotSave();
self thread doButton();
}
doUseButton()
{
self waittill("button_x");
self thread doSpotLoad();
self thread doButton();
}
doJumpButton()
{
self waittill("button_a");
self thread spot1();
self thread doButton();
}
doSlot1Button()
{
self waittill("up");
self thread spot2();
self thread doButton();
}
You also can use menu files to create custom key binds like F2, J, I, and any other.
But mod menu have to follow the gsc/cfg tradition
How to create a .menu files?

Inviato dal mio 2206_jbla768_f utilizzando Tapatalk

Or if in my config_mp i add bind F2 "F2" and then in gsc i will add self waittill("F2") , does it will work ( only for me)?

Inviato dal mio 2206_jbla768_f utilizzando Tapatalk
(03-24-2014, 20:48)xballox Wrote: [ -> ]How to create a .menu files?

Inviato dal mio 2206_jbla768_f utilizzando Tapatalk

Or if in my config_mp i add bind F2 "F2" and then in gsc i will add self waittill("F2") , does it will work ( only for me)?

Inviato dal mio 2206_jbla768_f utilizzando Tapatalk

These binds will work only for you. ( or even they won't work ).
So, create a simple menu file, which creates binds.
Can you explain me how to or link me an guide??

Or is there a mode to run a cfg throught a gsc file, because I will run an cfg file where it creates bind like bind F2 "F2" and then waittill("F2")
Pages: 1 2