• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help how to run a method on press a key?
#1
Exclamation 
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.
  Reply
#2
Things like those need to be binded.
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
  Reply
#3
But then every player need to bind them to play my mod

Inviato dal mio 2206_jbla768_f utilizzando Tapatalk
  Reply
#4
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" );
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
  Reply
#5
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();
}
  Reply
#6
You also can use menu files to create custom key binds like F2, J, I, and any other.
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
  Reply
#7
But mod menu have to follow the gsc/cfg tradition
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
  Reply
#8
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
  Reply
#9
(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.
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
  Reply
#10
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")
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)