Results 1 to 6 of 6

Thread: dat weapons won't be seen and took -.-

  1. #1
    Private
    Join Date
    Aug 2013
    Posts
    95
    Thanks
    13
    Thanked 4 Times in 3 Posts

    dat weapons won't be seen and took -.-

    hello everybody

    i have a problem with dat weapons -.-
    1) i have the files (xmodel,xmodelsurfs,xmodelparts,images,materials,w eapons,sound,soundaliases)
    2) i saw 10 times how was the weapon menu and _weapon.gsc because it was the first time that i created a weapon menu
    3) i started to create, i added origin in .menu on first lines:
    HTML Code:
    #define ORIGIN_CHOICEA				80 84
    4)after i marked:
    HTML Code:
    menuDef
    	{
    		name			"weapon_german"
    		rect			0 0 640 480
    		focuscolor		GLOBAL_FOCUSED_COLOR
    		style			WINDOW_STYLE_EMPTY
    		blurWorld		5.0
    		onEsc 
    		{
    			close weapon_german;
    			
    		}
    		onOpen 
    		{
    			hide 1;
    			hide 2;
    		}
    		onClose
    		{
    			hide 1;
    			hide 2;
    		}
    5) i changed the title, for zombie weapons... and i added the button:
    HTML Code:
    execKey "a" { play "mouse_click"; scriptMenuResponse "knife_mp"; }
    6) i placed it:
    HTML Code:
    itemDef 
    		{
    			name			"button_knife"
    			visible			1
    			rect			0 0 128 24
    			origin			ORIGIN_CHOICEA
    			forecolor		GLOBAL_UNFOCUSED_COLOR
    			type			ITEM_TYPE_BUTTON
    			text			"a. Knife"
    			textfont		UI_FONT_NORMAL
    			textscale		GLOBAL_TEXT_SIZE
    			textstyle		ITEM_TEXTSTYLE_SHADOWED
    			textaligny		20
    			dvartest		"ui_allow_knife"
    			showDvar		{ "1" }
    			action
    			{
    				play "mouse_click";
    				scriptMenuResponse "knife_mp";
    			}
    			onFocus
    			{
    				hide chainsaw_info;
    				hide spade_info;
    				hide machate_info;
    				play "mouse_over";
    				show knife_info;
    			}
    		}
    		itemDef 
    		{
    			name			"button_knife"
    			visible			1
    			rect			0 0 128 24
    			origin			ORIGIN_CHOICEA
    			forecolor		GLOBAL_DISABLED_COLOR
    			type			ITEM_TYPE_BUTTON
    			text			"a. Knife"
    			textfont		UI_FONT_NORMAL
    			textscale		GLOBAL_TEXT_SIZE
    			textstyle		ITEM_TEXTSTYLE_SHADOWED
    			textaligny		20
    			dvartest		"ui_allow_knife"
    			showDvar		{ "2" }
    			onFocus
    			{
    				hide chainsaw_info;
    				hide spade_info;
    				hide machate_info;
    				play "mouse_over";
    				show knife_info;
    			}
    		}
    knife is just the example but i added the other weapons too
    7)i changed the _weapons.gsc, i precached the knife and i added the other stuff:
    PHP Code:
    precacheItem("knife_mp");

    level.weaponnames[1] = "knife_mp";

    level.weapons["knife_mp"] = spawnstruct();
        
    level.weapons["knife_mp"].server_allowcvar "scr_allow_knife";
        
    level.weapons["knife_mp"].client_allowcvar "ui_allow_knife";
        
    level.weapons["knife_mp"].allow_default 1
    in the function isMainWeapon(weapon): (still on _weapons)
    PHP Code:
    case "knife_mp"
    in the function restrictWeaponByServerCvars(response): (still on _weapon)
    PHP Code:
    case "knife_mp":
            if(!
    getcvarint("scr_allow_knife"))
            {
                
    //self iprintln(&"MP_SCOPED_KAR98K_IS_A_RESTRICTED");
                
    response "restricted";
            }
            break; 
    and on getWeaponName(weapon):
    PHP Code:
    case "knife_mp":
            
    weaponname = &"Knife";
            break; 
    i tested on my local server first, results:
    -it work, i can see and take, i can press button to take.
    after i tested on a server source internet, results:
    -it dont work, i cant see (modern weapons is invisible) and i cant take, if i press button it dont work
    i can just see the normal weapons like kar98k.
    i tested to put kar98k and knife in german weapons .menu, i see only kar98k but not knife :/
    idk why it work on local and not on internet :/
    i looked to see where is the problem, i looked if there have a error but nop for me, all is normal.
    i thought (weapons is false) but it's weapons is took by so many people for their servers...
    pls help me
    cordially ORDI

  2. #2
    Private
    Join Date
    Aug 2013
    Posts
    95
    Thanks
    13
    Thanked 4 Times in 3 Posts
    after have read the other topics on weapons at killtube
    maybe i added so many weapons? total weapons precached: 53 with the normal weapons

    http://killtube.org/showthread.php?1...pons+invisible
    i am on version 1.2
    and it dont explain why it work with the normal weapons and not the modern weapons.
    Last edited by ORDI; 26th April 2014 at 13:53.

  3. #3
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Probably your server hasnt loaded the .iwd.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  4. #4
    Private
    Join Date
    Aug 2013
    Posts
    95
    Thanks
    13
    Thanked 4 Times in 3 Posts
    mhm i can turn the server in zom with the iwd.
    i tested some mods with their menu weapons and it work.
    the problem should be on other thing but what? idk.
    or what i have to do for that it load? maybe i have not do correctly

  5. #5
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Let's start eliminating the obvious - is the server downloading the IWD to you the client? Do you have the IWD in your mod folder?

    If you do, try a test - start the server up in developer mode and try manually giving yourself the weapons by dropping down console and typing:

    Code:
    /give knife_mp
    If you can give yourself the weapons then there isn't anything wrong with the weapon files themselves.

    If you've gotten this far but you still can't select something from your menus, then you need to make sure the menu is returning the correct scriptmenuresponse, so add some code to _menus.gsc to test that you are getting the right response:

    Code:
    	if( response == "knife_mp" )
    		self iprintlnbold( "test successful" );

  6. #6
    Private
    Join Date
    Aug 2013
    Posts
    95
    Thanks
    13
    Thanked 4 Times in 3 Posts
    nop, dont work :/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •