AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [REQ] Send information from the plugin (pawn) to the web (php) through mysql (https://forums.alliedmods.net/showthread.php?t=190062)

zhulo 07-14-2012 12:29

[REQ] Send information from the plugin (pawn) to the web (php) through mysql
 
Hello. I wanted to find some tutorials and informations about this but I did not find anything understandable. So I decided to ask for help. I wanna make a server status for my website, which will get informations right from the server through the mysql (or some better connection server/web if u know). I can make the pawn code but i dont know how to connect it to the web.

Here are some things which I wanna connect (pawn)

Connected players count and max players:

PHP Code:

public plugin_init()
{
    
g_maxplayers get_maxplayers()
}

getconnected()
{
    static 
iConnectedid
    iConnected 
0
    
    
for (id 1id <= g_maxplayersid++)
    {
        if (
is_user_connected(id))            
            
iConnected++
    }
    
    return 
iConnected;


Current map name:

PHP Code:

    new map[32]
    
get_mapname(map31

Of course there will be much more informations, this is just an example.

So, when I have the pawn code and the .amxx plugin, now I need to take this informations right to the web (php).

The table should look like this:

http://forums.alliedmods.net/jpg[IMG]http://img338.**************/img338/5376/statuuus.jpg[/IMG]


Can someone help me to make it?

YamiKaitou 07-14-2012 13:12

Re: [REQ] Send information from the plugin (pawn) to the web (php) through mysql
 
Better yet, query the server through the master servers, you can get all that information plus more. No need to an AMXX plugin

zhulo 07-14-2012 13:15

Re: [REQ] Send information from the plugin (pawn) to the web (php) through mysql
 
I need to get the informations right from the plugins.

YamiKaitou 07-14-2012 13:18

Re: [REQ] Send information from the plugin (pawn) to the web (php) through mysql
 
But you can get all 4 columns from just querying the master servers, no need for a plugin.

If you do require more than that, maybe set them to a public cvar and then query the server rules and pull the values that way? Or use sockets?

zhulo 07-14-2012 13:21

Re: [REQ] Send information from the plugin (pawn) to the web (php) through mysql
 
Im using it now, but it is very slow and it takes much more time to connect, so the page is loading longer...

I have a reasons for make it like I said...

lucas_7_94 07-14-2012 13:23

Re: [REQ] Send information from the plugin (pawn) to the web (php) through mysql
 
What information you need ? if its a cvar like MrYami says , you can use sockets, or a Query Source.

zhulo 07-14-2012 13:25

Re: [REQ] Send information from the plugin (pawn) to the web (php) through mysql
 
ok, I need the current map, current players count, max players, and time left.

lucas_7_94 07-14-2012 13:27

Re: [REQ] Send information from the plugin (pawn) to the web (php) through mysql
 
Use this, its better to load or store info in SQL.

zhulo 07-14-2012 13:37

Re: [REQ] Send information from the plugin (pawn) to the web (php) through mysql
 
I am using it now, but, like I said, its very slow, so, I need to get info right from the amx plugins.

lucas_7_94 07-14-2012 13:51

Re: [REQ] Send information from the plugin (pawn) to the web (php) through mysql
 
Spoiler


Well , this dont have relation with amxx i think , you should post in offtopic ..


All times are GMT -4. The time now is 14:59.

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