Raised This Month: $62 Target: $400
 15% 

Do not kick if HLTV


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jonatat
Senior Member
Join Date: Dec 2017
Old 04-20-2021 , 09:22   Do not kick if HLTV
Reply With Quote #1

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); 
}

jonatat is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 04-20-2021 , 09:53   Re: Do not kick if HLTV
Reply With Quote #2

PHP Code:
if(!is_user_hltv(id))
{
     
// execute

__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders

CSGO REMAKE ~ CSGO MOD [STABLE]

Last edited by Shadows Adi; 04-20-2021 at 09:53.
Shadows Adi is offline
jonatat
Senior Member
Join Date: Dec 2017
Old 04-20-2021 , 12:18   Re: Do not kick if HLTV
Reply With Quote #3

Quote:
Originally Posted by Shadows Adi View Post
PHP Code:
if(!is_user_hltv(id))
{
     
// execute

added but same problem
jonatat is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 04-20-2021 , 13:30   Re: Do not kick if HLTV
Reply With Quote #4

Place the filter up higher. Show your updated complete code please, if possible.
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell
DJEarthQuake is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-20-2021 , 20:17   Re: Do not kick if HLTV
Reply With Quote #5

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); 
        }
    }

__________________
Bugsy is offline
jonatat
Senior Member
Join Date: Dec 2017
Old 04-21-2021 , 05:48   Re: Do not kick if HLTV
Reply With Quote #6

Quote:
Originally Posted by Bugsy View Post
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!

Last edited by jonatat; 04-21-2021 at 05:51.
jonatat is offline
Reply


Thread Tools
Display Modes

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 21:49.


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