AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Problem printing GameTracker player page . (https://forums.alliedmods.net/showthread.php?t=337353)

Craxor 04-15-2022 12:56

Problem printing GameTracker player page .
 
Hello guys, long time after i ended code so i get a little rusty, and really really busy in real life, so no time for coding .

A friend asked me to help him creating an GameTracker motd plugin when he write /playedtime, i foud one on internet but wasn't working so i maded my own version, the motd is showing UP in the server .

The purpose of the plugin is clear by checking the code , when an player writes the command an motd window open redirecting on his own Gametracker page based on the server IP wich the owner has to put it manuualy .

But i encoutnered two problems .

1. The background is waaay too huge, and doesn't show enough so the player can't see his stats on gametracker .

2. Some players doesn't see nothing at all, and it gives them "error -107" or something similar, so please help, cheers guys .

PHP Code:

#include <amxmodx>
#include <amxmisc>

new const Server_Ip [] = "my server ip here";

public 
plugin_init( )
{
    
register_plugin"GameTracker PlayedTime""1.0""Craxor" );

    
register_clcmd"say /playedtime""Cmd_Ore" );
    
register_clcmd"say .playedtime""Cmd_Ore" );

    
register_clcmd"amx_playedtime""Cmd_PlayedTime" );

}

public 
Cmd_Oreid )
{
    new 
szName[32], szGameTracker[192];
    
get_user_nameidszNamecharsmax(szName) );
    
formatexszGameTrackercharsmax(szGameTracker), "https://www.gametracker.com/player/%s/%s/"szNameServer_Ip );

    new 
szBuffer[192];
    
formatex(szBuffercharsmax(szBuffer),\
        
"<html><head> <img style=^"width:100%^" /> <meta http-equiv=^"Refresh^" content=^"0;url=%s^"></head><body><p><center>LOADING...</center></p></body></html>",\
        
szGameTracker);

    
show_motdidszBuffer );
}

public 
Cmd_PlayedTimeid )
{
    new 
szArgs[32], szBuffer[192], szGameTracker[192];
    
read_argv1szArgscharsmax(szArgs) );

    if( !
szArgs] )
    {
        
client_printidprint_console"amx_playedtime <Name of the player>" );
        return 
PLUGIN_HANDLED
    }

    new 
targetid cmd_targetidszArgsCMDTARGET_NO_BOTS );

    if( !
targetid )
    {
        
client_printidprint_console"The player isn't alive or doesnt exist!" );
        return 
PLUGIN_HANDLED;
    }

    
formatexszGameTrackercharsmax(szGameTracker), "https://www.gametracker.com/player/%s/%s/"szArgsServer_Ip );

    
formatex(szBuffercharsmax(szBuffer),\
        
"<html><head> <img style=^"width:100%^" /> <meta http-equiv=^"Refresh^" content=^"0;url=%s^"></head><body><p><center>LOADING...</center></p></body></html>",\
        
szGameTracker);

    
show_motdidszBuffer );
    return 
PLUGIN_HANDLED;    


I found Fisyks code with img style = bla bla, but doesn't work or maybe i've implemnted wrongly? idk, this part:

Code:

<img style=^"width:100%^" />

Craxor 04-16-2022 11:10

Re: Problem printing GameTracker player page .
 
I've updated the code insteand of using Meta Refresh now i'm using iFrame, the webpage works scrolling, but the same problems appear .

1. The window is zoomed(means is too big) and all i can see on gametracker is the player NAME .
2. Some users not even see the gametracker they got errors , white MOTD and their output is only "-107" .

Does someone know why those thigns happening ?

PHP Code:

#include <amxmodx>
#include <amxmisc>

new const Server_Ip [] = "server-ip-here";

public 
plugin_init( )
{
    
register_plugin"GameTracker Ore""1.0""Crax0r" );

    
register_clcmd"say /playedtime""Cmd_Ore" );

    
register_clcmd"say .playedtime""Cmd_Ore" );

    
register_clcmd"amx_playedtime""Cmd_PlayedTime" );

}

public 
Cmd_Oreid )
{
    new 
szName[32], szGameTracker[192];
    
get_user_nameidszNamecharsmax(szName) );
    
formatexszGameTrackercharsmax(szGameTracker), "https://www.gametracker.com/player/%s/%s/"szNameServer_Ip );

    new 
szBuffer[192];
    
formatexszBuffercharsmax(szBuffer), \
        
"<html><head><iframe src=^"%s^" style=^"height:100%%;width:100%%^"> </iframe> </head> </html>", \
        
szGameTracker );

    
show_motdidszBuffer );
}

public 
Cmd_PlayedTimeid )
{
    new 
szArgs[32], szBuffer[192], szGameTracker[192];
    
read_argv1szArgscharsmax(szArgs) );

    if( !
szArgs] )
    {
        
client_printidprint_console"amx_playedtime <Name of the player>" );
        return 
PLUGIN_HANDLED
    }

    new 
targetid cmd_targetidszArgsCMDTARGET_NO_BOTS );

    if( !
targetid )
    {
        
client_printidprint_console"The player doesnt exist!" );
        return 
PLUGIN_HANDLED;
    }

    
formatexszGameTrackercharsmax(szGameTracker), "https://www.gametracker.com/player/%s/%s/"szArgsServer_Ip );
    
formatexszBuffercharsmax(szBuffer), \
        
"<html><head><iframe src=^"%s^" style=^"height:100%%;width:100%%^"> </iframe> </head> </html>", \
        
szGameTracker );

    
show_motdidszBuffer );
    return 
PLUGIN_HANDLED;    




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

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