AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   if(get_user_authid(id) >= STEAM_0:1:55555555) (https://forums.alliedmods.net/showthread.php?t=243659)

pupil0888 07-08-2014 04:55

if(get_user_authid(id) >= STEAM_0:1:55555555)
 
dont work :cry:

Code:


#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>

public plugin_init() {
    register_plugin("kovalsky_plugin", "1.0", "kovalsky")
    register_cvar("koval_plugin", "1")
}

public client_connect(id) {
   
    if(get_cvar_num("koval_plugin") == 0) {
        return PLUGIN_HANDLED
    }

    if(get_user_authid(id) >= STEAM_0:1:55555555) {
       
        server_cmd("kick #%d", get_user_authid(id))
    }
    return PLUGIN_HANDLED
}


YamiKaitou 07-08-2014 05:26

Re: if(get_user_authid(id) >= STEAM_0:1:55555555)
 
http://i0.kym-cdn.com/photos/images/...44/wrong05.jpg


Please actually try reading the tutorials and guides before you start scripting. I mean, the thread that you bumped (and I deleted the bump) had the solution to your "problem"

Black Rose 07-08-2014 05:40

Re: if(get_user_authid(id) >= STEAM_0:1:55555555)
 
You have to use str_to_num() to convert the last digits to an integer that can be compared using >=.
Also, when kicking using #, you supply the userid, not authid.

What is it even for? It makes no sense to block a range of SteamIDs.

pupil0888 07-08-2014 06:55

Re: if(get_user_authid(id) >= STEAM_0:1:55555555)
 
I do not understand, plis help me.

pupil0888 07-08-2014 06:56

Re: if(get_user_authid(id) >= STEAM_0:1:55555555)
 
Quote:

Originally Posted by Black Rose (Post 2163754)
You have to use str_to_num() to convert the last digits to an integer that can be compared using >=.
Also, when kicking using #, you supply the userid, not authid.

What is it even for? It makes no sense to block a range of SteamIDs.

I do not understand, plis help me.

Kellan123 07-08-2014 10:16

Re: if(get_user_authid(id) >= STEAM_0:1:55555555)
 
PHP Code:

#include <amxmodx>

public plugin_init() 
{
      
register_plugin("kovalsky_plugin""1.0""kovalsky");
      
      
register_cvar("koval_plugin""1");
}

public 
client_connect(id)
{
      if ( 
get_cvar_num("koval_plugin") == ) return PLUGIN_HANDLED;
      
      static 
authid[32];
      
get_user_authid(idauthidcharsmax(authid));
      
      if ( 
equal(authid"STEAM_0:1:55555555") )
      {
            
server_cmd("kick #%i"get_user_userid(id));
      }
      
      return 
PLUGIN_HANDLED;



pupil0888 07-08-2014 14:52

Re: if(get_user_authid(id) >= STEAM_0:1:55555555)
 
Quote:

Originally Posted by Kellan123 (Post 2163860)
PHP Code:

#include <amxmodx>

public plugin_init() 
{
      
register_plugin("kovalsky_plugin""1.0""kovalsky");
      
      
register_cvar("koval_plugin""1");
}

public 
client_connect(id)
{
      if ( 
get_cvar_num("koval_plugin") == ) return PLUGIN_HANDLED;
      
      static 
authid[32];
      
get_user_authid(idauthidcharsmax(authid));
      
      if ( 
equal(authid"STEAM_0:1:55555555") )
      {
            
server_cmd("kick #%i"get_user_userid(id));
      }
      
      return 
PLUGIN_HANDLED;




what I want is that if someone connects to the server and authid is higher than this STEAM_0: 1:55555555 Server kicked him

YamiKaitou 07-08-2014 16:14

Re: if(get_user_authid(id) >= STEAM_0:1:55555555)
 
str_to_num(authid[10])

Backstabnoob 07-08-2014 16:32

Re: if(get_user_authid(id) >= STEAM_0:1:55555555)
 
I just don't understand why would you want that...


All times are GMT -4. The time now is 21:13.

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