Raised This Month: $ Target: $400
 0% 

Not working get_systime


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
monolit
Junior Member
Join Date: May 2011
Old 05-14-2011 , 15:44   Re: Not working get_systime
Reply With Quote #7

Ok I've got this working, the problem was in say event, it checked if is user admin, and if not it returned PLUGIN_CONTINUE; only after that I checked mutetime > systime. so it didn't reach that check.

Also I've got one more problem, when I reconnect, mute dissapears, and I again can talk, even if the mute time is still in sql, I think the problem is in loading.

PHP Code:
public client_putinserver(id)
{
    
Load_MySql(id)

PHP Code:
public Load_MySql(id)
{
    new 
szAuthID[33], szTemp[512]
    
get_user_authid(idszAuthID32)
    
    new 
Data[1]
    
Data[0] = id
    
    format
(szTemp,charsmax(szTemp),"SELECT * FROM `bans` WHERE (`bans`.`auth` = '%s')"szAuthID)
    
SQL_ThreadQuery(g_SqlTuple,"register_client",szTemp,Data,1)
}

public 
register_client(FailState,Handle:Query,Error[],Errcode,Data[],DataSize)
{
    if(
FailState == TQUERY_CONNECT_FAILED)
    {
        
log_amx("Load - Could not connect to SQL database.  [%d] %s"ErrcodeError)
    }
    else if(
FailState == TQUERY_QUERY_FAILED)
    {
        
log_amx("Load Query failed. [%d] %s"ErrcodeError)
    }

    new 
id
    id 
Data[0]
    
    if(
SQL_NumResults(Query) >= 1
    {
        
iMute[id]    = SQL_ReadResult(Query1)
        
SQL_ReadResultQuery2iMuteReason[id], charsmaxiMuteReason[ ] ) )
        
SQL_ReadResultQuery3iMuteAdmin[id], charsmaxiMuteAdmin[ ] ) )
        
        
iBan[id]    = SQL_ReadResult(Query4)
        
SQL_ReadResultQuery5iBanReason[id], charsmaxiBanReason[ ] ) )
        
SQL_ReadResultQuery6iBanAdmin[id], charsmaxiBanAdmin[ ] ) )
    }
    
    if( 
iBan[id] > get_systime() )
    {
        
client_print(idprint_console"*------* *------------* *------*")
        
client_print(idprint_console"*------* You are banned *------*")
        
client_print(idprint_console"*** by: %s"iBanAdmin[id])
        
client_print(idprint_console"*** for: %s"iBanReason[id])
        
client_print(idprint_console"*------* You are banned *------*")
        
client_print(idprint_console"*------* *------------* *------*")
        
client_cmd(id"disconnect")
    }
    return 
PLUGIN_HANDLED
}

public 
client_disconnect(id)
{
    
iMute[id] = 0;
    
iMuteReason[id][0] = '^0'
    
iMuteAdmin[id][0] = '^0'
    
iBan[id] = 0;
    
iBanReason[id][0] = '^0'
    
iBanAdmin[id][0] = '^0'


Last edited by monolit; 05-14-2011 at 16:15.
monolit is offline
 



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 04:17.


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