popping up a window

Discussions about Coding and Scripting
Post Reply
User avatar
Rakiayn
Masterful
Posts: 550
Joined: Fri Aug 28, 2009 3:33 pm

popping up a window

Post by Rakiayn »

I would like to make a window pop up when you hit a certain key.
but I dont know how.
this is what i got so far, a mutator with this code:

Code: Select all

function Mutate(string MutateString, PlayerPawn Sender) 
    {


	Super.Mutate(MutateString,Sender);

	if(MutateString ~= "change") 
   {


        sender.health += 1;
		return;

   }
}
if you press a certain key, you get +1 health. I only did this to test if it worked.
I want to make a window pop up when you press that key (I also know how to make the window.)
Does anyone know how?
User avatar
zacman
Adept
Posts: 412
Joined: Wed Apr 15, 2009 5:36 am
Personal rank: M-M-M-MONSTER KILL

Re: popping up a window

Post by zacman »

Try looking at some examples. I know Monster Vendor (Download it at PMH-www.planetmonsterhunt.com) has a good one, maybe have a look at it to get an idea of how?
Image[url=steam://friends/add/76561198048595886]Image[/url]
User avatar
Rakiayn
Masterful
Posts: 550
Joined: Fri Aug 28, 2009 3:33 pm

Re: popping up a window

Post by Rakiayn »

thanks, i just downloaded it,. hope i can figure it out
User avatar
TheDane
Masterful
Posts: 660
Joined: Tue Feb 12, 2008 2:47 pm
Personal rank: Happy fool :-)

Re: popping up a window

Post by TheDane »

if you want it to act like a keybind you need to force a keybind to the client, because the keybinds are stored in the user.ini file. Messing with clients keybinds can lead to frustrations if you assign a key that the client is already using, then you will delete the client settings and force a new keybind.

the example code you posted is for function mutate in the console, to open a window from the console can also be done by simply have the server call the players functions to open the console and type in the desired concolo command.

But to do with the client pressing a specific key you need to force the keybind to the client, which imo is very bad.
Retired.
User avatar
zacman
Adept
Posts: 412
Joined: Wed Apr 15, 2009 5:36 am
Personal rank: M-M-M-MONSTER KILL

Re: popping up a window

Post by zacman »

That's why I recommended Monster Vendor. They have a system where you can set the keys via a mod menu window.
Image[url=steam://friends/add/76561198048595886]Image[/url]
User avatar
Rakiayn
Masterful
Posts: 550
Joined: Fri Aug 28, 2009 3:33 pm

Re: popping up a window

Post by Rakiayn »

actually the string 'change''can be linked to a keybinding.
you can also change the string to something else. as long as this string is something different from other keybindings, it wont efeect other key bindings.
Post Reply