AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Run PHP code inside plugin. (https://forums.alliedmods.net/showthread.php?t=307408)

4ever16 05-08-2018 18:33

Run PHP code inside plugin.
 
Im wondering if its possible to run a php code inside a plugin. Without opening motd.

For example if someone connects to the server a php code will run.

HTML code? Withou opening motd.

fvRate 05-08-2018 19:08

Re: Run PHP code inside plugin.
 
I don't know if that's possible, but it sounds suspicious.
What does the code do?

fysiks 05-08-2018 21:27

Re: Run PHP code inside plugin.
 
No. A plugin is not a web server. Explain what you are trying to do.

Airkish 05-09-2018 02:10

Re: Run PHP code inside plugin.
 
You can't run PHP code through plugin, that's for sure.
HTML code will run but you are limited to 1536 characters iirc.

Best solution is to place your .php file in your web server and in MOTD paste URL.

jimaway 05-09-2018 05:10

Re: Run PHP code inside plugin.
 
HTTP GET/POST query on the php script address should do the trick. assuming you want to run the script on your webserver and not on the HLDS

fysiks 05-09-2018 21:13

Re: Run PHP code inside plugin.
 
Quote:

Originally Posted by Airkish (Post 2591386)
HTML code will run but you are limited to 1536 characters iirc.

HTML doesn't run in the plugin. It runs in the built-in browser.

Airkish 05-10-2018 08:47

Re: Run PHP code inside plugin.
 
Quote:

Originally Posted by fysiks (Post 2591507)
HTML doesn't run in the plugin. It runs in the built-in browser.

Yeah, that's what I meant but I worded incorrectly :)

fysiks 05-10-2018 19:29

Re: Run PHP code inside plugin.
 
I would love it if it were possible to somehow internally link events in the MOTD to a plugin. I have a use case for this. But unfortunately, it can't :(.

Black Rose 05-11-2018 12:17

Re: Run PHP code inside plugin.
 
Quote:

Originally Posted by fysiks (Post 2591631)
I would love it if it were possible to somehow internally link events in the MOTD to a plugin. I have a use case for this. But unfortunately, it can't :(.

What do you mean by events? You can send commands/information to HLDS from MOTD through javascript and/or PHP and rcon.

fysiks 05-12-2018 02:36

Re: Run PHP code inside plugin.
 
Quote:

Originally Posted by Black Rose (Post 2591724)
What do you mean by events? You can send commands/information to HLDS from MOTD through javascript and/or PHP and rcon.

Clicking a link or pressing a button would be an event. I know how to do it via RCON but it would be nice to do it purely internal to the server.


All times are GMT -4. The time now is 04:41.

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