AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   kick if steam id doesn't match (https://forums.alliedmods.net/showthread.php?t=224408)

GhostMan 08-24-2013 05:54

kick if steam id doesn't match
 
I would like to have some steamids.ini file where i could write a list of available steam id's. If player connects to server with steam id which is not i my steamids.ini he would be kicked.

E.g. of steamids.ini:
Quote:

STEAM_0:1:111111111
STEAM_0:1:222222222
STEAM_0:1:333333333
etc...
I wrote a code which would do pretty much what i want but problem is i don't know how to integrate all that .INI file thing.

PHP Code:

#include <amxmodx>

new const PLUGIN[]  = "STEAM ID CHECKER"
new const VERSION[] = "1.0"
new const AUTHOR[]  = "me, i guess :O"

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
client_putinserver(id)
{
    new 
authid[33]
    
get_user_authid(idauthidcharsmax(authid))
    
    if(!(
equali(authid"STEAM_0:1:111111111")))
    {
        
set_task(10.0"delay_kick"id)
    }
}

public 
client_disconnect(id)
{
    if(
task_exists(id))
        
remove_task(id)
}

public 
delay_kick(id)
{
    
server_cmd("kick #%d"get_user_userid(id))


Later on i will upgrade my code by showing message to players who are going to be kick like "You are going to be kick in X sec becouse missmatch of steam id!" or something like that but that's not the priority now.

sami_spt 08-24-2013 06:06

Re: kick if steam id doesn't match
 
https://forums.alliedmods.net/showthread.php?t=222528

have a look @ this, check how he gets his idea.

Blizzard_87 08-24-2013 06:23

Re: kick if steam id doesn't match
 
Quote:

Originally Posted by sami_spt (Post 2020547)
https://forums.alliedmods.net/showthread.php?t=222528

have a look @ this, check how he gets his idea.

or simply use amxx default settings already accessible...

amxx.cfg
Code:

// Mode of logging to a server
// 0 - disable logging, players won't be checked (and access won't be set)
// 1 - normal mode which obey flags set in accounts
// 2 - kick all players not on list
//
// Default value: 1
amx_mode 2

this will auto kick anyone NOT in the users.ini file...

add the players steam ids into users.ini file like so.
Users.ini

GhostMan 08-25-2013 11:37

Re: kick if steam id doesn't match
 
delete this post.

Black Rose 08-25-2013 13:02

Re: kick if steam id doesn't match
 
Delete it yourself under edit->go advanced.

mottzi 08-26-2013 02:24

Re: kick if steam id doesn't match
 
Why would you want to delete this thread?

This is exactly the purpose of a forum, anyone who wanted to achieve the same has a reference to the solution.

Do not delete this!

GhostMan 08-26-2013 08:22

Re: kick if steam id doesn't match
 
I was asking to delete #4 post, becouse i gave a question in which i found answer while writing that question.


All times are GMT -4. The time now is 18:56.

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