Raised This Month: $51 Target: $400
 12% 

MOTD Problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nunuxer
Junior Member
Join Date: Jan 2021
Old 01-15-2021 , 02:36   MOTD Problem
Reply With Quote #1

Hello ! I have this plugin for playedtime (it just select the playername and opens a motd with gametracker search), but I get an error in motd, it shous me only: -107. What would be the problem ?

PHP Code:
#include < amxmodx >
#include < amxmisc >

#define PLUGIN "GT Played Time"
#define VERSION "1.1.5"

new const g_szGameTracker[ ] = "http://www.gametracker.com/player";

new 
g_szServerIp32 ];
new 
g_szCustomUrl128 ];

public 
plugin_init( )
{
    
//--|Credits to Laurr for his idea. ( https://forums.alliedmods.net/showthread.php?t=220727 ).
    
register_pluginPLUGINVERSION"Askhanar" );
    
    
register_clcmd"say""HookClCmdSayOrSayTeam" );
    
register_clcmd"say_team""HookClCmdSayOrSayTeam" );
    
    
register_clcmd"gt_playedtime""ClCmdPlayedTime" );
    
//register_clcmd( "say /playedtime", "ClCmdSayPlayedTime" );
    
    
get_user_ip0g_szServerIpsizeof g_szServerIp ) -1); //--| Ii luam ip la sv cu tot cu port!
    // Add your code here...
}

public 
HookClCmdSayOrSayTeamid )
{
    static 
szArgs192 ], szCommand192 ];
    
read_argsszArgssizeof szArgs ) -);
    
    if( !
szArgs] )
        return 
PLUGIN_CONTINUE;
    
    
remove_quotesszArgs );
    
    if( 
equalszArgs,  "/playedtime"strlen(  "playetime" ) ) )
    {
        
replaceszArgssizeof szArgs ) -1"/"""  );
        
formatexszCommandsizeof szCommand ) -1"gt_%s"szArgs );
        
client_cmdidszCommand );
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
ClCmdPlayedTimeid )  
{
    
    new 
szFirstArg32 ];
        
read_argv1szFirstArgsizeof szFirstArg ) -);

    if( 
equaliszFirstArg"" ) ) 
        
DisplayPlayedTimeidid );
    
    else
    {
        
    
        new 
iPlayer cmd_targetidszFirstArg);
        if(!
iPlayer || iPlayer == id )
            return 
PLUGIN_CONTINUE;
    
        
DisplayPlayedTimeidiPlayer );
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
DisplayPlayedTimeidiPlayer )
{
    new 
szName32 ];
    
get_user_nameiPlayerszNamesizeof szName ) -);
    
MakeNameSafeszNamesizeofszName ) -);
    
    
formatexg_szCustomUrlsizeof g_szCustomUrl ) -1"%s/%s/%s/",
        
g_szGameTrackerszNameg_szServerIp );
        
    
show_motdidg_szCustomUrl );
    
}

MakeNameSafeszName[ ], iLen )
{
    
replace_allszNameiLen"#""%23" );
    
replace_allszNameiLen"?""%3F" );
    
replace_allszNameiLen":""%3A" );
    
replace_allszNameiLen";""%3B" );
    
replace_allszNameiLen"/""%2F" );
    
replace_allszNameiLen",""%2C" );
    
replace_allszNameiLen"$""%24" );
    
replace_allszNameiLen"@""%40" );
    
replace_allszNameiLen"+""%2B" );
    
replace_allszNameiLen"=""%3D" );
    
replace_allszNameiLen"®""®" );
    

nunuxer 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 06:45.


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