PDA

View Full Version : dat weapons won't be seen and took -.-



ORDI
26th April 2014, 13:31
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:

#define ORIGIN_CHOICEA 80 84
4)after i marked:

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:

execKey "a" { play "mouse_click"; scriptMenuResponse "knife_mp"; }
6) i placed it:

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:

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)

case "knife_mp":
in the function restrictWeaponByServerCvars(response): (still on _weapon)

case "knife_mp":
if(!getcvarint("scr_allow_knife"))
{
//self iprintln(&"MP_SCOPED_KAR98K_IS_A_RESTRICTED");
response = "restricted";
}
break;
and on getWeaponName(weapon):

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

ORDI
26th April 2014, 13:51
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?1418-weapon-invisible&highlight=weapons+invisible
i am on version 1.2
and it dont explain why it work with the normal weapons and not the modern weapons.

IzNoGoD
26th April 2014, 16:09
Probably your server hasnt loaded the .iwd.

ORDI
26th April 2014, 22:31
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

Tally
27th April 2014, 11:38
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:


/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:


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

ORDI
29th April 2014, 14:59
nop, dont work :/