Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
~class menu please help~
#1
ok so what i have right now is a menu that opens up when you connect to the server to list my weapons the only problem i notice is that the weapons menu does not open on a ffa match but it will on a team match here is the code

Code:
/*
===================================================
// scripted by: Virus
// steam: assassin5469
// takbolts
===================================================
*/

#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;

init()
{    
    game["menu_class_takbolts"] = "class_takbolts";
    precacheMenu(game["menu_class_takbolts"]);
    
    setDvar( "scr_disable_cac", 1 );
    
    self.pers["primary_wep"] = undefined;
    self.pers["menuallow"] = undefined;
    
    self setclientDvar( "scr_disable_cac", 1 );
    
    level thread onPlayerConnect();
}

onPlayerConnect()
{
    while( true )
    {
        level waittill( "connected", player );    
        player thread onPlayerSpawned();
    }
}

onPlayerSpawned()
{
    self setclientDvar( "scr_disable_cac", 1 );
    self thread teamWait();
    self endon( "disconnect" );
    
    while( true )
    {
        self waittill( "spawned_player" );
        
        //on first spawn give
        self takeAllWeapons();
        self giveWeapon("mosin_sp");
        self giveWeapon("knife_zm");
        wait 0.05;
        
        self thread giveStoredWep();
        self.pers["menuallow"] = true;

        self thread onMenuResponse();
        self setclientDvar( "scr_disable_cac", 0 );
        self thread cacDisable();    
    }
}

onMenuResponse()
{
    self endon( "death" );
    self endon( "disconnect" );
    
    while( true )
    {
        self waittill( "menuresponse", menu, response );
        
        if( response == "open_class_takbolts_menu" )
        {
            self thread getMyMenu();    
        }
        
        if (response == "giveMosin" )
        {
            self closeMenu();
            self closeInGameMenu();

            if( self.pers["menuallow"] != false )
            {
                self thread takePrimary();
                self giveWeapon("mosin_sp");
                self switchToWeapon("mosin_sp");
                self.pers["primary_wep"] = "mosin_sp";
            }
            else
            {
                self.pers["primary_wep"] = "mosin_sp";
            }
        }
        
        if (response == "giveKar" )
        {
            self closeMenu();
            self closeInGameMenu();
            
            if( self.pers["menuallow"] != false )
            {
                self thread takePrimary();
                self giveWeapon("kar98k_mp");
                self switchToWeapon("kar98k_mp");
                self.pers["primary_wep"] = "kar98k_mp";
            }
            else
            {
                self.pers["primary_wep"] = "kar98k_mp";
            }
        }
        
        if (response == "giveArisaka" )
        {
            self closeMenu();
            self closeInGameMenu();
            
            if( self.pers["menuallow"] != false )
            {
                self thread takePrimary();
                self giveWeapon("arisaka_mp");
                self switchToWeapon("arisaka_mp");
                self.pers["primary_wep"] = "arisaka_mp";
            }
            else
            {
                self.pers["primary_wep"] = "arisaka_mp";
            }
        }
    }
}

//other functions


getMyMenu()
{
    self closeMenu();
    self closeInGameMenu();
    self openMenu("class_takbolts");
}

teamWait()
{
    while(1)
    {
        self waittill("joined_team");
        self setclientDvar( "scr_disable_cac", 1 );
        wait 0.1;
        self thread getMyMenu();
        self setclientDvar( "scr_disable_cac", 0 );
    }
}

takePrimary()
{
        self takeweapon( "mosin_sp" );
        self takeweapon( "kar98k_mp" );
        self takeweapon( "arisaka_mp" );
        
}

giveStoredWep()
{
    if( self.pers["primary_wep"] != undefined)
    {
        self thread takePrimary();
        self giveWeapon ( self.pers["primary_wep"] );
        self switchtoweapon( self.pers["primary_wep"] );
        wait 1;
    }
}

cacDisable()
{
       self setclientDvar( "scr_disable_cac", 0 );
       wait 8;
       self setclientDvar( "scr_disable_cac", 1 );
        
}

basicly i want it to do the same thing it does in team deathmatch whenyou connect and the came type is a team type game my class menu loads but in ffa you just spawn with a gun any help would be great
Reply

#2
Where are you calling the code from?
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] TeamCounter class 8q4s8 3 5,256 10-15-2013, 18:14
Last Post: [HARD] Tony.
Question Help Admin menu koren30 4 5,117 10-07-2013, 20:17
Last Post: Yamato
  [Tutorial] How-To, Mod menu picture-REVISED/no iwifix needed rotceh_dnih 52 32,248 09-28-2013, 02:08
Last Post: Monkey Arms
  Help How do I open the admin menu for GeKKos QS Mod? conorr 1 3,084 08-15-2013, 13:52
Last Post: Yamato
  Trying to compile a modified menu DidUknowiPwn 7 5,705 07-05-2013, 21:55
Last Post: DidUknowiPwn
  Preview Admin / Mod Menu Hologramm 5 6,943 05-29-2013, 00:35
Last Post: sleepunknot
  Map Menu in Black Ops 1 EliTeEishiii 2 3,049 04-21-2013, 18:54
Last Post: Nekochan
  Menu base EliTeEishiii 1 2,875 04-17-2013, 16:10
Last Post: Nekochan
Rainbow [Release] [Contest] Scroll Menu iAegle 49 36,841 03-21-2013, 07:30
Last Post: jermC
  [Release] Mouse operated menu met94 18 13,695 03-06-2013, 10:27
Last Post: BHF98

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.