After you hit the perk button, press shift+0, find something similar to "Response: "+response+"/nWarn: "+warn" and paste here what the game printed. Maybe you can put another iprintln before the "if" to make sure the script is runs.
Oh, and comment or delete these two lines:
I think there is no man in the world who can read the warn message in half second.PHP Code:
wait 0.5;
self setClientCvar("perk_warn","");
When I open the menu for the first time and select perk1, I see the warn message inside the menu and as iprintln
Then I select perk1 again, so it must deselect. I see the warning in the menu again and as iprintln.Code:WARNING: Non-localized Game Message string is not allowed to have letters in it. Must be changed over to a localized string: "Response: perk1/nWarn: Select perk1: 1 , Selected: 1"
I close the menu and reopen it. I select perk1 again, but no warn message inside the menu is showed. Only iprintlnCode:WARNING: Non-localized Game Message string is not allowed to have letters in it. Must be changed over to a localized string: "Response: perk1/nWarn: Deselect perk1: 0 , Selected: 0"
I click on perk1 again to deselect it. Again no warn message inside the menu, but the iprintln is working correctlyCode:WARNING: Non-localized Game Message string is not allowed to have letters in it. Must be changed over to a localized string: "Response: perk1/nWarn: Select perk1: 1 , Selected: 1"
Tested with developer 1Code:WARNING: Non-localized Game Message string is not allowed to have letters in it. Must be changed over to a localized string: "Response: perk1/nWarn: Deselect perk1: 0 , Selected: 0"
LOL this is painful to watch. Everyone knows you get those localized string errors, and you just ignore them. You should be beyond the noob stage by now Nils. You've been modding long enough.
Is this code still there:
Are you waiting a frame, then clearing the warning message to ""? Perhaps that is why it isn't working - if you clear the message, it wont be there, will it?Code:self setClientCvar("perk_warn",warn); wait 0.5; self setClientCvar("perk_warn","");
If the above code is not relevant, you need to post your most up-to-date code. No one can help with outdated code.
Called fromCode:handleperk(response) { self setClientCvar("perk_warn",""); //showdvars of perks ["0" is for locked perk, "1" is for unlocked perk, "2" is for unlocked + selected perk] warn=""; if(response == "perk1") { if(self.rank <0) { warn=level.rankwarn[int(self.lang)]; } else if(self.perkselect == 0 && self.perk1 == 0) { self.perk1=1; self.perkselect =1; self setClientCvar("dvar_perk_1","2"); warn="Select perk1: "+self.perk1+ " , Selected: "+self.perkselect; } else if(self.perk1 == 1) { self.perk1=0; self.perkselect =0; self setClientCvar("dvar_perk_1","1"); warn="Deselect perk1: "+self.perk1+ " , Selected: "+self.perkselect; } else if(self.perkselect == 1) { warn="Deselect first , Selected: "+self.perkselect; } iprintln("Response: "+response+"\nWarn: "+warn); self setClientCvar("perk_warn",warn); } }
Here is the complete perkmenu.menuCode:else if(menu == "perkmenu") { self setupperk(); // loads the menu self handleperk(response); }
To load it, use /language "1"
http://pastebin.com/4gtg42gf
Can somebody try it and see if they can fix the error?
You have over 220 itemdef's in your menu. I guess it just bugs out..
You should handle your language stuff in a different way, by using only ONE menu and use localized strings.
Try remove these and see if it works.
Also you set the client-var on top of your script and also at the bottom (in the same frame) maybe this is also a thing..
You can remove the first setClientCvar() then.
And: you dont need to hide your itemdefs on close
Last edited by serthy; 25th August 2015 at 21:11.
Ni3ls (26th August 2015)