Raised This Month: $ Target: $400
 0% 

LogToFile Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
{7~11} TROLL
Senior Member
Join Date: Oct 2008
Location: Atlanta,Georgia
Old 01-19-2009 , 20:41   LogToFile Help
Reply With Quote #1

sorry i had posted this in gereral.

but im trying to get my mod to log to a file but it want log can any one help me please


PHP Code:
/*
* SM_ALLINFO
* This Mod Was Created Base On The Amx Version.
* Credits:
* Lebson506th  - Thanks For Helping Fix Some Errors I Was Having With The Coding
*/
#include <sourcemod>
public Plugin:myinfo 
{
    
name "sm_allinfo",
    
author "{7~11} TROLL",
    
description "gets single clients steam id,name,and ip base on the amx version",
    
version "1.2.2",
    
url "www.711clan.net"
}
public 
OnPluginStart()
{
    
RegAdminCmd("sm_allinfo"Command_UsersADMFLAG_BAN"sm_allinfo - .::[Name  ::STEAM ID  ::IP  ]::.");
}
public 
Action:Command_Users(clientargs)
{
    new 
target;
    if (
args == 1)
    {
        
decl String:arg[MAX_NAME_LENGTH];
        
GetCmdArg(1argsizeof(arg));
        
target FindTarget(clientargfalsefalse);
        if (!
target)
        {
            
ReplyToCommand(client"Could not find %s"arg);
            return 
Plugin_Handled;
        }
    }
    else
    {
        
ReplyToCommand(client"Correct syntax: sm_allinfo playername");
        return 
Plugin_Handled;
    }
    
decl String:t_name[MAX_NAME_LENGTH], String:t_ip[16], String:t_steamid[16];
    
GetClientName(targett_namesizeof(t_name));
    
GetClientIP(targett_ipsizeof(t_ip));
    
GetClientAuthString(targett_steamidsizeof(t_steamid));
    
PrintToConsole(client".:[Name: %s | Steam ID: %s | IP: %s]:."t_namet_steamidt_ip);
    return 
Plugin_Handled;
}
public 
allinfo(clientargs)
{
    new 
target;
    if (
args == 1)
    {
        
decl String:arg[MAX_NAME_LENGTH];
        
GetCmdArg(1argsizeof(arg));
        
target FindTarget(clientargfalsefalse);
        if (!
target)
        {
            
ReplyToCommand(client"Could not find %s"arg);
            return 
Plugin_Handled;
        }
    }
    else
    {
        
ReplyToCommand(client"Correct syntax: sm_allinfo playername");
        return 
Plugin_Handled;
    }
    
decl String:t_name[MAX_NAME_LENGTH], String:t_ip[16], String:t_steamid[16];
    
GetClientName(targett_namesizeof(t_name));
    
GetClientIP(targett_ipsizeof(t_ip));
    
GetClientAuthString(targett_steamidsizeof(t_steamid));
    
PrintToConsole(client".:[Name: %s | Steam ID: %s | IP: %s]:."t_namet_steamidt_ip);
 
LogToFile("allinfo_players.txt",".:User Name: %s | Steam_id: %s | IP Address: %s:.",t_name,t_steamid,t_ip);
 
 return 
Plugin_Handled;

__________________
{7~11} TROLL is offline
{7~11} TROLL
Senior Member
Join Date: Oct 2008
Location: Atlanta,Georgia
Old 01-20-2009 , 15:33   Re: LogToFile Help
Reply With Quote #2

anyone?
__________________
{7~11} TROLL is offline
{7~11} TROLL
Senior Member
Join Date: Oct 2008
Location: Atlanta,Georgia
Old 01-22-2009 , 14:42   Re: LogToFile Help
Reply With Quote #3

heres the logtofile code i have but it dont log

PHP Code:
public allinfo(clientargs

    new 
target
    if (
args == 1
    { 
        
decl String:arg[MAX_NAME_LENGTH]; 
        
GetCmdArg(1argsizeof(arg)); 
        
target FindTarget(clientargfalsefalse); 
        if (!
target
        { 
            
ReplyToCommand(client"Could not find %s"arg); 
            return 
Plugin_Handled
        } 
    } 
    else 
    { 
        
ReplyToCommand(client"Correct syntax: sm_allinfo playername"); 
        return 
Plugin_Handled
    } 
    
decl String:t_name[MAX_NAME_LENGTH], String:t_ip[16], String:t_steamid[16]; 
    
GetClientName(targett_namesizeof(t_name)); 
    
GetClientIP(targett_ipsizeof(t_ip)); 
    
GetClientAuthString(targett_steamidsizeof(t_steamid)); 
    
PrintToConsole(client".:[Name: %s | Steam ID: %s | IP: %s]:."t_namet_steamidt_ip); 
    
LogToFile("allinfo_players.txt",".:User Name: %s | Steam_id: %s | IP Address: %s:.",t_name,t_steamid,t_ip); 
     
    return 
Plugin_Handled


__________________
{7~11} TROLL is offline
{7~11} TROLL
Senior Member
Join Date: Oct 2008
Location: Atlanta,Georgia
Old 01-24-2009 , 13:30   Re: LogToFile Help
Reply With Quote #4

anyone?
__________________
{7~11} TROLL is offline
BAILOPAN
Join Date: Jan 2004
Old 01-24-2009 , 23:35   Re: LogToFile Help
Reply With Quote #5

You need to describe the problem in more detail. Also please use normal fonts for text, bright small green letters are bad - as is your signature which is hugely distracting.
BAILOPAN is offline
{7~11} TROLL
Senior Member
Join Date: Oct 2008
Location: Atlanta,Georgia
Old 01-25-2009 , 14:06   Re: LogToFile Help
Reply With Quote #6

sorry it was from where i was typeing on xfire also the sig will be changed.

--the issue---
in the code in post #3 when i set it to log to a file it dont log the peoples info. what im wanting it to do is when new people join and on the new map it logs all the humans allinfo that is on the server. but i cant seem to figure out how to get it to log right.
__________________
{7~11} TROLL is offline
MikeJS
Senior Member
Join Date: Nov 2008
Old 01-25-2009 , 14:23   Re: LogToFile Help
Reply With Quote #7

You need to add something like
Code:
BuildPath(Path_SM, var, sizeof(var), "logs/allinfo_players.txt");
before the LogToFile, which should log to var
MikeJS is offline
{7~11} TROLL
Senior Member
Join Date: Oct 2008
Location: Atlanta,Georgia
Old 01-25-2009 , 14:29   Re: LogToFile Help
Reply With Quote #8

Quote:
Originally Posted by MikeJS View Post
You need to add something like
Code:
BuildPath(Path_SM, var, sizeof(var), "logs/allinfo_players.txt");
before the LogToFile, which should log to var
yeah one of members heled me with that but now it want log the allinfo it just logs [Name %s |Steam ID %s |IP %s] and thats all
__________________
{7~11} TROLL 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 20:48.


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