04-18-2014, 19:18
I have changed the code now.
SailorMoon can you please explain better how to change the buttons. Im a bit noobie on modding
I have uploaded a screnshot from ingame http://imgur.com/lvTemKj look in left lower corner it says Menu->Opens but the menu dosent open.
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->Opens");
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" );
}
}
}
I have uploaded a screnshot from ingame http://imgur.com/lvTemKj look in left lower corner it says Menu->Opens but the menu dosent open.