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:
4)after i marked:HTML Code:#define ORIGIN_CHOICEA 80 84
5) i changed the title, for zombie weapons... and i added the button: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; }
6) i placed it:HTML Code:execKey "a" { play "mouse_click"; scriptMenuResponse "knife_mp"; }
knife is just the example but i added the other weapons tooHTML 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; } }
7)i changed the _weapons.gsc, i precached the knife and i added the other stuff:
in the function isMainWeapon(weapon): (still on _weapons)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 restrictWeaponByServerCvars(response): (still on _weapon)PHP Code:case "knife_mp":
and on getWeaponName(weapon):PHP Code:case "knife_mp":
if(!getcvarint("scr_allow_knife"))
{
//self iprintln(&"MP_SCOPED_KAR98K_IS_A_RESTRICTED");
response = "restricted";
}
break;
i tested on my local server first, results:PHP Code:case "knife_mp":
weaponname = &"Knife";
break;
-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




Reply With Quote