AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Client_print not works (https://forums.alliedmods.net/showthread.php?t=171841)

kramesa 11-11-2011 13:30

Client_print not works
 
Look the code:

PHP Code:

#include <amxmodx> 
#include <celltrie> 

new g_pReconnectTime
new 
Trie:g_tSteamID
new 
g_szSteamID33 ][ 33 ]; 

public 
plugin_init() 

    
g_pReconnectTime register_cvar"amx_noretrytime" "30" )
    
register_cvar("amx_retry""0"FCVAR_SERVER)
    
g_tSteamID TrieCreate(); 


public 
plugin_end() 

    
TrieDestroyg_tSteamID ); 


public 
client_authorized(id
{         
    new 
iTime iSysTime
    
get_user_authidid g_szSteamIDid ] , charsmaxg_szSteamID[] ) ); 
    
    if ( 
get_pcvar_numg_pReconnectTime ) && TrieGetCellg_tSteamID g_szSteamIDid ] , iTime ) ) 
    { 
        if ( 
iTime > ( iSysTime get_systime() ) ) 
        { 
            new 
szMsg64 ]; 
            
formatexszMsg charsmaxszMsg ) , "Sem Retry. Aguarde %d segundos!" , ( iTime iSysTime ) ); 
            
            
message_beginMSG_ONE SVC_DISCONNECT _id ); 
            
write_stringszMsg ); 
            
message_end(); 
        } 
        else 
        { 
            
TrieDeleteKeyg_tSteamID g_szSteamIDid ] ); 
        } 
    } 


public 
client_disconnect(id
{                   
    if(
get_cvar_num("amx_dsban") <= 0
        return
        
    new 
Sid[32], Name[32]
    
get_user_name(idName31)
    
get_user_authid(idSid31)
        
    new 
iTimeVal get_pcvar_numg_pReconnectTime ); 
    if ( 
iTimeVal && !( get_user_flagsid ) & ADMIN_IMMUNITY ) ) 
    {        
        
TrieSetCellg_tSteamID g_szSteamIDid ] , get_systime() + iTimeVal ); 
        
client_print(0print_chat"O jogador %s desconectou-se [%s]"NameSid)
    } 



Napoleon_be 11-11-2011 13:47

Re: Client_print not works
 
PHP Code:

public client_disconnect(id

If a user is disconnected, he cannot receive a message anymore. from the server because he lost contact with the server from then on.

kramesa 11-11-2011 14:05

Re: Client_print not works
 
Quote:

Originally Posted by Napoleon_be (Post 1594717)
PHP Code:

public client_disconnect(id

If a user is disconnected, he cannot receive a message anymore. from the server because he lost contact with the server from then on.

Lol, her the print_chat works:

PHP Code:

public client_disconnect(id
{
    new 
Name[32], Sid[32]
    
    if(
get_cvar_num("amx_dsban") <= 0)
        return
    
    if(
get_user_flags(id) & ADMIN_IMMUNITY)
        return
    
    
get_user_name(idName31)
    
get_user_authid(idSid31)
    
    
client_print(0print_chat"%s O jogador '%s' miou e sera banido por 2 horas"pug_headerName)
    
    
server_cmd"amx_addban ^"%s^" ^"%s^" 120 ^"Saiu em uma partida LIVE!^""NameSid)
    




All times are GMT -4. The time now is 14:17.

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