Raised This Month: $ Target: $400
 0% 

fix small code


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Sanjay Singh
Veteran Member
Join Date: Sep 2016
Old 01-08-2020 , 12:01   fix small code
Reply With Quote #1

Error
PHP Code:
AMX Mod X Compiler 1.10.0.5388
Copyright 
(c1997-2006 ITB CompuPhase
Copyright 
(c2004-2013 AMX Mod X Team

H
:\AMX\scripting\AmxXDMT.sma(32) : error 017undefined symbol "GetFileTime"
H:\AMX\scripting\AmxXDMT.sma(36) : error 088number of arguments does not match definition
H
:\AMX\scripting\AmxXDMT.sma(56) : error 017undefined symbol "fmt" 
PHP Code:
#include <amxmodx>
#include <cromchat>

new g_szInputFileName[] = "discord_messages_i.txt";

new 
g_iInputTemp;
new 
g_iInputFileModTime;
new 
g_szInputFileLoc[64];
new 
g_szInputMessage[256];

new 
g_szOutputFileName[] = "discord_messages_o.txt";
new 
g_szOutputFileLoc[64];

public 
plugin_init()
{
    
register_plugin("AmxXDMT""1.0b""thEsp");

    
get_datadir(g_szInputFileLoccharsmax(g_szInputFileLoc));
    
format(g_szOutputFileLoccharsmax(g_szOutputFileLoc), "%s\%s"g_szInputFileLocg_szOutputFileName); // Use this first
    
format(g_szInputFileLoccharsmax(g_szInputFileLoc), "%s\%s"g_szInputFileLocg_szInputFileName);

    
register_clcmd("say""cmdMessage");

    
set_task(0.1"tskReadLine", .flags "b");
}

public 
tskReadLine()
{
    if(!
file_exists(g_szInputFileLoc))
        return;

    
g_iInputTemp GetFileTime(g_szInputFileLocFileTime_LastChange);

    if (
g_iInputFileModTime != g_iInputTemp)
    {
        
read_file(g_szInputFileLoc0g_szInputMessagecharsmax(g_szInputMessage));
        
CC_SendMessage(0g_szInputMessage);
        
g_iInputFileModTime g_iInputTemp;
    }
}

public 
cmdMessage(id)
{
    new 
szMessage[128], szTime[16], szTeam[16];
    
read_args(szMessagecharsmax(szMessage));
    
    
remove_quotes(szMessage);
    
trim(szMessage);
    
    if(
equal(szMessage""))
        return;
    
    
get_time("%H:%M:%S"szTimecharsmax(szTime));
    
get_user_team(idszTeamcharsmax(szTeam));

    
write_file(g_szOutputFileLocfmt("[%s] %s %n: %s"szTimeszTeamidszMessage), 0);
}

stock get_datadir(name[], len)
{
    return 
get_localinfo("amxx_datadir"namelen);

__________________

Last edited by Sanjay Singh; 01-08-2020 at 12:26. Reason: re edit
Sanjay Singh is offline
Send a message via AIM to Sanjay Singh
 



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 02:48.


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