Guys i want a plugin, when a player will enter/join the server if his steamid is not registered he will kick and we will decide their teams by their steam id, here you can check a code which i got from a friend but it is not working anyone plz help.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <reapi>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "Author"
new n_steamid[ MAX_PLAYERS + 1 ];
new n_connectid[ MAX_PLAYERS + 1 ];
new filename[ 256 ];
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
get_configsdir(filename,255);
format(filename,255,"%s/matchplayers.ini",filename);
}
public client_authorized( id )
{
get_user_authid(id, n_connectid, charsmax( n_connectid ));
}
public client_putinserver(id)
{
new line, len, Data[ 128 ];
new team[ 8 ];
while((line = read_file( filename , line , Data , 127 , len) ) != 0 )
{
parse(Data, team,7, n_steamid,7);
if( n_connectid[id] != n_steamid[id] )
{
server_cmd("amx_kick #%s You Have No Entry To The Server^n", n_steamid);
}
if( equal( team, "CT") )
{
rg_set_user_team(id, TEAM_CT, MODEL_AUTO, true);
}
if( equal( team, "TT") )
{
rg_set_user_team(id, TEAM_TERRORIST, MODEL_AUTO, true);
}
}
}