Raised This Month: $ Target: $400
 0% 

Run PHP code inside plugin.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 05-11-2018 , 12:17   Re: Run PHP code inside plugin.
Reply With Quote #1

Quote:
Originally Posted by fysiks View Post
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.
__________________

Last edited by Black Rose; 05-11-2018 at 12:17.
Black Rose is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-12-2018 , 02:36   Re: Run PHP code inside plugin.
Reply With Quote #2

Quote:
Originally Posted by Black Rose View Post
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.
__________________
fysiks is offline
GoldNux
Senior Member
Join Date: Mar 2018
Old 05-12-2018 , 15:45   Re: Run PHP code inside plugin.
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
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.
Can it be done using SQL?
I don't know much about this but I'm thinking something like:
Action on MOTD webpage changes something in a database, amx plugin somehow notices that change.
I have a plugin that inserts data from the game to a database, don't know if it is possible to do the opposite..
__________________
Try my version of de_dust2, I think it's great and you should check it out!
https://gamebanana.com/mods/83731
GoldNux is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 05-12-2018 , 17:49   Re: Run PHP code inside plugin.
Reply With Quote #4

Quote:
Originally Posted by GoldNux View Post
Can it be done using SQL?
I don't know much about this but I'm thinking something like:
Action on MOTD webpage changes something in a database, amx plugin somehow notices that change.
I have a plugin that inserts data from the game to a database, don't know if it is possible to do the opposite..
SQL is just that, a database. To use that in the way you describe you have to check for updates in the database in a loop. It's very inefficient, though possible.

Through rcon you can send the server a command which is pretty much the same as someone typing a command in console. That way there's no update loop, just a public function that reacts instantly.
__________________

Last edited by Black Rose; 05-12-2018 at 17:51.
Black Rose is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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