Nice one Sokso hope some help
_load is gone and it's for(;
not while.
what do you mean by that can i add you on steam or something Im a bit noobie is the _load.gsc gone?
what do you Mean
.
Dude but _load is not our problem our problem is where to put self self openMenu( game["SCRIPT NAME HERE"] );
(04-18-2014, 08:58)hajhaka Wrote: [ -> ]what do you mean by that can i add you on steam or something Im a bit noobie is the _load.gsc gone?
what do you Mean .
Dude but _load is not our problem our problem is where to put self self openMenu( game["SCRIPT NAME HERE"] );
game["menuname"] is a custom stuff. ( Look into the _menus.gsc, you will see something like 'game["menu_team"] = "menuname";' )
Firstly, precache the menu by using PrecacheMenu("menu name");
Then, for example, this code will open your menu on F (Activate) key press: -
put 'self thread button1();' to 'OnPlayerSpawned' after 'self waittill("spawned_player");'
Code:
button1()
{
self endon("death");
self endon("disconnect");
for(;;)
{
if(self UseButtonPressed() )
{
self iprintln("menu opened");
self openmenu("menu name");
}
wait .2;
}
}
The code its working but its standing in menu opend in chat and the menu isnt showing up and we want it to be opend on 4 not F.
Here is the updated code
Code:
#include common_scripts\utility;
#include maps\mp\_utility;
init()
{
game[ "tax" ] = "tutorial_example_menu";
precacheMenu( game[ "taxtax" ] );
level thread onPlayerConnect();
}
onPlayerConnect()
{
while( true )
{
level waittill( "connected", player );
player thread onPlayerSpawned();
}
}
onPlayerSpawned()
{
self endon( "disconnect" );
while( true )
{
self waittill( "spawned_player" );
self openMenu( game["tutorial_example_menu"] );
self thread button1();
self thread onMenuResponse();
}
}
button1()
{
self endon("death");
self endon("disconnect");
for(;;)
{
if(self UseButtonPressed() )
{
self iprintln("menu opened");
self openmenu("tutorial_example_menu");
}
wait .2;
}
}
onMenuResponse()
{
self endon( "death" );
self endon( "disconnect" );
while( true )
{
self waittill( "menuresponse", menu, response );
if( response == "give_l96a1_mod" )
{
self giveWeapon( "l96a1_mp" );
self switchToWeapon( "l96a1_mp" );
}
}
You can make custom key handling. ( F1, h, j, v... every character/number ).
but SailorMoon That one problem but when he get in game we click f but the menu dosent show up it just says menu opened Plz help
I'm not sure what you're saying but
Code:
game[ "tax" ] = "tutorial_example_menu";
precacheMenu( game[ "taxtax" ] );
you precache game["taxtax"] when your menu is called game["tax"].