AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Mouse1 "+attack" & Enter "+attack". (https://forums.alliedmods.net/showthread.php?t=226451)

Decompiler 09-18-2013 08:58

Mouse1 "+attack" & Enter "+attack".
 
Q1: What's the difference between the +attack executed when pressing enter and when clicking mouse1?

I can close the MOTD by pressing Enter, where as I can't close the motd with my mouse unless I move it to where it says "OK. Yet both are binded to +attack?

Q2: Is there a way to trick the game into thinking the player pressed Enter? To force close the MOTD for the player.

jimaway 09-18-2013 09:23

Re: Mouse1 "+attack" & Enter "+attack".
 
the +attack bind has nothing to do with closing the motd (you can still close the motd by unbinding mouse1 and enter key), and no you cant force the client to close it

HLM 09-18-2013 19:44

Re: Mouse1 "+attack" & Enter "+attack".
 
Quote:

Originally Posted by Decompiler (Post 2036846)
Q1: What's the difference between the +attack executed when pressing enter and when clicking mouse1?

I can close the MOTD by pressing Enter, where as I can't close the motd with my mouse unless I move it to where it says "OK. Yet both are binded to +attack?

Q2: Is there a way to trick the game into thinking the player pressed Enter? To force close the MOTD for the player.

do you move your mouse to the login button, or do you press enter? I press enter, but its all preference, its just the way things are, the 'OK' button is the only 'clickable' element outside the MOTD (which loads after the MOTD window) so it gets the element focus first, so pressing enter would activate it (unless you press tab and there is a hyperlink in the MOTD)

Read more about it here:
http://en.wikipedia.org/wiki/Focus_(computing)
http://en.wikipedia.org/wiki/Tab_order

Decompiler 09-19-2013 01:47

Re: Mouse1 "+attack" & Enter "+attack".
 
Quote:

Originally Posted by HLM (Post 2037185)
do you move your mouse to the login button, or do you press enter? I press enter, but its all preference, its just the way things are, the 'OK' button is the only 'clickable' element outside the MOTD (which loads after the MOTD window) so it gets the element focus first, so pressing enter would activate it (unless you press tab and there is a hyperlink in the MOTD)

Read more about it here:
http://en.wikipedia.org/wiki/Focus_(computing)
http://en.wikipedia.org/wiki/Tab_order

But what is Enter to CS? Can't I tell the game that the player pressed enter? And so force close the MOTD?

Question 3: Can I force load another MOTD ontop of the old MOTD? So instead of closing them, I just have it load motd1, then motd2 and so on.

YamiKaitou 09-19-2013 01:49

Re: Mouse1 "+attack" & Enter "+attack".
 
Quote:

Originally Posted by Decompiler (Post 2037272)
But what is Enter to CS?

In the MOTD, the same thing as it is when you are on a Web Site.

Quote:

Can't I tell the game that the player pressed enter?
GoldSrc does not provide the ability to do so

Quote:

And so force close the MOTD?
GoldSrc does not provide the ability to do so

Quote:

Question 3: Can I force load another MOTD ontop of the old MOTD? So instead of closing them, I just have it load motd1, then motd2 and so on.
Try it?

Decompiler 09-19-2013 03:03

Re: Mouse1 "+attack" & Enter "+attack".
 
Quote:

Originally Posted by YamiKaitou (Post 2037273)
Try it?

I did and it didn't work. I was hoping there would be a method that would work.

Well thanks for helping out. I guess I'll print the results in chat instead.

jimaway 09-19-2013 09:09

Re: Mouse1 "+attack" & Enter "+attack".
 
you could use javascript functionality to change the motd content

Black Rose 09-19-2013 16:14

Re: Mouse1 "+attack" & Enter "+attack".
 
Here's what I did for my server:
Code:
#include <amxmodx> #define MOTD "Hello %s" // I edited it to make the example clear. public plugin_init() {     register_plugin("Test Plugin 6", "", "");     } public client_putinserver(id) {     new buffer[1024], name[32];     get_user_name(id, name, charsmax(name));     formatex(buffer, charsmax(buffer), MOTD, name);         new hFile = fopen("motd.txt", "w");     fputs(hFile, buffer);     fclose(hFile); }

I guess there is a small chance it could fail if two people join very close to each other depending on how far apart the client_putinserver() and the showing of default motd is in actual code. Most likely (and someone could probably look it up) is that they are both called from the same function and since the server is single-threaded it will not accept any new player until this function is done.

Do javascript really work in MOTD?


All times are GMT -4. The time now is 19:01.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.