Raised This Month: $ Target: $400
 0% 

console_print


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 09-24-2011 , 07:24   console_print
Reply With Quote #1

Why does it works sometimes and sometimes it does not ?

It works when I'm baning player. in Say hook. But it doesn't work when client connects, then I get all info from SQL and set task with 2 seconds, nothing happens, the code in both situation are exactly same.
reinert is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 09-24-2011 , 07:29   Re: console_print
Reply With Quote #2

in client connect, you should use
client_cmd(id, "echo ^"somthing^"")
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 09-24-2011 , 07:34   Re: console_print
Reply With Quote #3

Well it doesn't work either.
>>PART OF CODE
PHP Code:
    if(equali(szCmd"!ban"))
    {
        
strbreak(szArgszTargetcharsmax(szTarget), szArgcharsmax(szArg))
        
strbreak(szArgszTimecharsmax(szTime), szReasoncharsmax(szReason))
        
        if(!
szTarget[0] || !szTime[0] || !szReason[0])
        {
            return 
PLUGIN_HANDLED_MAIN;
        }
        
        new 
szAdminName[33];
        
get_user_name(idszAdminName32)
        
        new 
player cmd_target(idszTargetCMDTARGET_OBEY_IMMUNITY);
        
        if(!
player)
            return 
PLUGIN_HANDLED;
            
        new 
bantime;
                
        if(
bantime 604800)
        {
            return 
PLUGIN_HANDLED_MAIN;
        }
        
        new 
szTargetName[33];
        
get_user_name(playerszTargetName32)
        
        new 
szTargetIp[33];
        
get_user_ip(playerszTargetIp321)
        
        
console_print(player"****B*A*N*N*E*D****"// This does work
        
server_cmd("kick #%d ^"You are bannedcheck your console^""get_user_userid(player) )
        
        new 
szTemp[512]
        
format(szTemp,charsmax(szTemp),"UPDATE `players`\
        SET `ban_time` = '%d',\
        `ban_reason` = '%s',\
        `ban_admin` = '%s'\
        WHERE `players`.`player_ip` = '%s';"
GetCurrentTime() + bantimeszReasonszAdminNameszTargetIp)
        
SQL_ThreadQuery(g_SqlTuple,"IgnoreHandle",szTemp)
        
        return 
PLUGIN_HANDLED_MAIN;
    }
    
    public 
client_putinserver(id)
    {
        
Load_MySql(id);
        
set_task(5.0"CheckBan"id)
    }
    
    public 
CheckBan(id)
    {
        if(
ban_time[id] > GetCurrentTime())
        {
            
console_print(player"****B*A*N*N*E*D****"// And only this does not work.
            
server_cmd("kick #%d ^"You are bannedcheck your console^""get_user_userid(player) )
        }
    } 
Everything works perfect except console printing.
reinert is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 09-24-2011 , 07:40   Re: console_print
Reply With Quote #4

or, try this
public client_connect(id)
{
engfunc(EngFunc_ClientPrintf, id, 0, "bla#############")
}
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 09-24-2011 , 07:41   Re: console_print
Reply With Quote #5

This should print message to console or chat ?
reinert is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-24-2011 , 16:01   Re: console_print
Reply With Quote #6

Client is not in the server to receive commands on client_connect(). This is the way that I understand it. Try client_putinserver().
__________________
fysiks is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 09-24-2011 , 17:38   Re: console_print
Reply With Quote #7

I used this:
PHP Code:
public client_putinserver(id)
    {
        
Load_MySql(id);
        
set_task(5.0"CheckBan"id)
    } 
...
Does not work.
reinert 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 19:38.


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