AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Do not kick if HLTV (https://forums.alliedmods.net/showthread.php?t=332048)

jonatat 04-20-2021 09:22

Do not kick if HLTV
 
I have simple code to check if player steamid in database. Any ideas how to NOT CHECK HLTV STEAMID?

PHP Code:

public client_authorized(id

new 
auth[32]; 
get_user_authid(idauthsizeof (auth));

new 
Handle:query SQL_PrepareQuery(g_sql"SELECT `steam_id` FROM `users` WHERE (`steam_id` = '%s')"auth); 
SQL_Execute(query); 

new 
res[32]; 

if (
SQL_MoreResults(query)) 

SQL_ReadResult(query0ressizeof (res)); 
SQL_FreeHandle(query); 


if (!
strlen(res)) 

server_cmd("kick #%i %s"get_user_userid(id), restrict_msg); 
}



Shadows Adi 04-20-2021 09:53

Re: Do not kick if HLTV
 
PHP Code:

if(!is_user_hltv(id))
{
     
// execute



jonatat 04-20-2021 12:18

Re: Do not kick if HLTV
 
Quote:

Originally Posted by Shadows Adi (Post 2744618)
PHP Code:

if(!is_user_hltv(id))
{
     
// execute



added but same problem

DJEarthQuake 04-20-2021 13:30

Re: Do not kick if HLTV
 
Place the filter up higher. Show your updated complete code please, if possible.

Bugsy 04-20-2021 20:17

Re: Do not kick if HLTV
 
Like this:
PHP Code:

public client_authorized(id

    if ( !
is_user_hltvid ) )
    {
        new 
auth[32]; 
        
get_user_authid(idauthsizeof (auth));
        
        new 
Handle:query SQL_PrepareQuery(g_sql"SELECT `steam_id` FROM `users` WHERE (`steam_id` = '%s')"auth); 
        
SQL_Execute(query); 
        
        new 
res[32]; 
        
        if (
SQL_MoreResults(query)) 
        { 
            
SQL_ReadResult(query0ressizeof (res)); 
            
SQL_FreeHandle(query); 
        } 
        
        if (!
strlen(res)) 
        { 
            
server_cmd("kick #%i %s"get_user_userid(id), restrict_msg); 
        }
    }



jonatat 04-21-2021 05:48

Re: Do not kick if HLTV
 
Quote:

Originally Posted by Bugsy (Post 2744668)
Like this:
PHP Code:

public client_authorized(id

    if ( !
is_user_hltvid ) )
    {
        new 
auth[32]; 
        
get_user_authid(idauthsizeof (auth));
        
        new 
Handle:query SQL_PrepareQuery(g_sql"SELECT `steam_id` FROM `users` WHERE (`steam_id` = '%s')"auth); 
        
SQL_Execute(query); 
        
        new 
res[32]; 
        
        if (
SQL_MoreResults(query)) 
        { 
            
SQL_ReadResult(query0ressizeof (res)); 
            
SQL_FreeHandle(query); 
        } 
        
        if (!
strlen(res)) 
        { 
            
server_cmd("kick #%i %s"get_user_userid(id), restrict_msg); 
        }
    }




My bad, working! Thanks!


All times are GMT -4. The time now is 06:48.

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