AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Click in motd (https://forums.alliedmods.net/showthread.php?t=312586)

JocAnis 12-08-2018 22:05

Click in motd
 
hello guys..i found this thing: Map editor (Texture MOTD)
It has so many options, but im interested in: what is the thing/code for browsing the motd and then click on something and its executed? i would know that if i load any .php which has already integrated functions, but how to do this without it (without your host/web) ?

also this is maybe even more interesting: Entity properties MOTD
all files are here: https://github.com/jonatan1024/cs-editor

i was searching the .sma there, and came to:
Code:

format(url,32,"entities/entity=%d,%d",entity,id)
ed_motd(id,url,"Entity properties")

ed_motd(id, url[], title[]){
        new content[128], addr[64]
        //get_user_ip(0, addr, 23, 0)
        get_cvar_string("net_address", addr, 64)
        /*copy(addr,23,"xxx.xxx.xxx.xxx:27015")
        if(cl_islocal[id])
                copy(addr,23,"10.0.0.xxx:27015")*/
        format(content,128,"<meta http-equiv=^"refresh^" content=^"0; url=http://%s/%s^">",addr,url) //this line is for showing it, but  wtf ://
        show_motd(id,content,title)
}

i hope his module isnt the thing which is changing this buttons/browsing in motd...

*there is /src/ folder, with texture.cpp + .h.. and other files but i have no idea what are they for and where it should be added (i hope not on the host)...
any explanation is very welcomed! im interested in modifying these properties/buttons for something else

fysiks 12-09-2018 03:41

Re: Click in motd
 
The MOTD is a web browser and does not point to a local resource (on the game server) so you need a web server to react to the clicks and send them to the server.

klippy 12-09-2018 08:12

Re: Click in motd
 
That module actually runs a basic HTTP server.

Also Jonatan (Backup) is a wizard, that's well known.

JocAnis 12-09-2018 10:21

Re: Click in motd
 
well if this is connected with module, then im out, i cant understand nothing about it
i was thinking of sending him a pm for making a tutorial of it, but nah, who knows if he will see the message or smth

Neeeeeeeeeel.- 12-11-2018 13:21

Re: Click in motd
 
Quote:

Originally Posted by JocAnis (Post 2627881)
well if this is connected with module, then im out, i cant understand nothing about it
i was thinking of sending him a pm for making a tutorial of it, but nah, who knows if he will see the message or smth

As KliPPy said, the module itself is running its own HTTP server on port 80 which answers to some basic GET requests.


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

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