Raised This Month: $ Target: $400
 0% 

Solved Scan_Say Plugin Debug Trace [Need Help For Fix]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-11-2020 , 14:29   Re: Small Plugin Debug Trace [Need Help For Fix]
Reply With Quote #1

Code:
for(new i; i < 33; i++)     if( get_user_flags(i) & ADMIN_CHAT && i != 0 )         client_print_color(i, print_team_default, "^4[PSL] A Scan From (%s)^1: '%s'", sName, sArg);

=>

Code:
new iPlayers[32], iPnum; get_players(iPlayers, iPnum); for(new i, iPlayer; i < iPnum; i++) {     iPlayer = iPlayers[i];     if( get_user_flags(iPlayer) & ADMIN_CHAT )     {         client_print_color(iPlayer, print_team_default, "^4[PSL] A Scan From (%s)^1: '%s'", sName, sArg);     } }
__________________

Last edited by OciXCrom; 05-11-2020 at 17:22.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 05-11-2020 , 16:44   Re: Small Plugin Debug Trace [Need Help For Fix]
Reply With Quote #2

Can you fix these warnings & error please?



Just to quickly Escalate to lines numbers:
https://pastebin.com/YhPNmyJA

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

#define PLUGIN "Scan_Say"
#define VERSION "12/May/2020"
#define AUTHOR "General Memer"

new Float:g_fCooldown[33];


public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say""fwSayHandle");
}


public 
client_connect(iClient)
{
    
g_fCooldown[iClient] = 0.0;
}


public 
client_disconnected(iClient)
{
    
g_fCooldown[iClient] = 0.0;
}


public 
fwSayHandle(const iClient)
{
    new 
sArg[194];
    
    
read_argssArgcharsmax(sArg) );
    
remove_quotes(sArg);
    
    new 
sCmd[32];
    
argbreaksArgsCmdcharsmax(sCmd), sArgcharsmax(sArg) );

    if( 
equali(sCmd"/scan") )
    {
        static 
Float:fGametime
        
fGametime get_gametime();
        
        if( 
g_fCooldown[iClient] > fGametime 
            return 
PLUGIN_HANDLED;
        
        if( 
sArg[0] )
        {
            new 
sName[32];
            
get_user_nameiClientsNamecharsmax(sName) );
                        
new 
iPlayers[32], iPnum;
get_players(iPlayersiPnum;

for(new 
iiPlayeriPnumi++)
{
    
iPlayer iPlayers[i];

    if( 
get_user_flags(iPlayer) & ADMIN_CHAT )
    {
        
client_print_color(iPlayerprint_team_default"^4[PSL] A Scan From (%s)^1: '%s'"sNamesArg);
    }
}            
            
client_print_color(iClientprint_team_default"^4[PSL] ^3Your message has been sent.");
        }
        
        
g_fCooldown[iClient] = fGametime 2.0;
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE;


Last edited by Alber9091; 05-11-2020 at 17:28.
Alber9091 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 00:49.


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