[RLA] # HazZaRD Mesaje : 541 | Subiect: Advanced Protocol Manager Dum 14 Feb 2016, 22:04 | |
| Descriere: Cu acest plugin pe server-ul vostru puteti permite si totodata bloca accesul jucatorilor care folosesc un protocol nedorit de voi. In ce consta acest protocol ? Ei bine, acest protocol poate fi de 3 tipuri: Valve ( NonSteam ) FakeSteam Steam Descarcare: - Cod:
-
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#pragma semicolon 1
#define PLUGIN "Advanced Protocol Manager" #define VERSION "2.0c"
enum { TYPE_NONSTEAM, TYPE_FAKESTEAM, TYPE_STEAM, g_iMaxTypes }
new const g_szKickReason[ g_iMaxTypes ][ ] = { "Pe acest server, nu se pot conecta jucatorii care folosesc VALVE.", "Pe acest server, nu se pot conecta jucatorii care folosesc FAKESTEAM.", "Pe acest server, nu se pot conecta jucatorii care folosesc STEAM." };
new gCvarEnableType[ g_iMaxTypes ]; new gCvarRedirectIps[ g_iMaxTypes ];
public plugin_init( ) { register_plugin ( PLUGIN, VERSION, "Askhanar" ); //| 0 = pot intra pe server | 1 = nu pot intra pe server | 2 = redirectioneaza catre ... | gCvarEnableType[ TYPE_NONSTEAM ] = register_cvar( "apm_nonsteam", "0" ); gCvarEnableType[ TYPE_FAKESTEAM ] = register_cvar( "apm_fakesteam", "0" ); gCvarEnableType[ TYPE_STEAM ] = register_cvar( "apm_steam", "0" ); gCvarRedirectIps[ TYPE_NONSTEAM ] = register_cvar( "apm_nonsteam_ip", "nume.server.ro" ); gCvarRedirectIps[ TYPE_FAKESTEAM ] = register_cvar( "apm_fakesteam_ip", "nume.server.ro" ); gCvarRedirectIps[ TYPE_STEAM ] = register_cvar( "apm_steam_ip", "nume.server.ro" ); // Add your code here... }
public client_authorized( id ) { static iAuthidType; iAuthidType = apm_get_user_authid( id ); if( iAuthidType != TYPE_NONSTEAM || apm_get_cvar_num( TYPE_NONSTEAM ) == 0 ) goto CheckForFakeSteam; else if( apm_get_cvar_num( TYPE_NONSTEAM ) == 1 ) { ApmKickUser( id, TYPE_NONSTEAM ); goto FinishClientAuthorized; } else if( apm_get_cvar_num( TYPE_NONSTEAM ) == 2 ) { ApmRedirectUser( id, TYPE_NONSTEAM ); goto FinishClientAuthorized; } CheckForFakeSteam: if( iAuthidType != TYPE_FAKESTEAM || apm_get_cvar_num( TYPE_FAKESTEAM ) == 0 ) goto CheckForSteam; else if( apm_get_cvar_num( TYPE_FAKESTEAM ) == 1 ) { ApmKickUser( id, TYPE_FAKESTEAM ); goto FinishClientAuthorized; } else if( apm_get_cvar_num( TYPE_FAKESTEAM ) == 2 ) { ApmRedirectUser( id, TYPE_FAKESTEAM ); goto FinishClientAuthorized; } CheckForSteam: if( iAuthidType != TYPE_STEAM || apm_get_cvar_num( TYPE_STEAM ) == 0 ) goto FinishClientAuthorized; else if( apm_get_cvar_num( TYPE_STEAM ) == 1 ) { ApmKickUser( id, TYPE_STEAM ); goto FinishClientAuthorized; } else if( apm_get_cvar_num( TYPE_STEAM ) == 2 ) ApmRedirectUser( id, TYPE_STEAM ); FinishClientAuthorized: return 0; }
apm_get_cvar_num( const iType ) { new iCvarValue; iCvarValue = get_pcvar_num( gCvarEnableType[ iType ] ); return iCvarValue; }
apm_get_pcvar_string( const iType ) { static szCvarString[ 32 ]; get_pcvar_string( gCvarRedirectIps[ iType ], szCvarString, sizeof ( szCvarString ) -1 ); return szCvarString; } apm_get_user_authid( id ) { new szAuthId[ 35 ]; get_user_authid( id, szAuthId, sizeof ( szAuthId ) -1 ); if( szAuthId[ 7 ] == ':' ) return strlen( szAuthId ) > 18 ? TYPE_FAKESTEAM : TYPE_STEAM; //else if( szAuthId[ 7 ] == ':' && strlen( szAuthId ) == 18 ) // return TYPE_STEAM; return TYPE_NONSTEAM; }
ApmKickUser( id, const iType ) { client_cmd( id, "echo ^"%s^"", g_szKickReason[ iType ] ); /* message_begin( MSG_ONE_UNRELIABLE, SVC_DISCONNECT, _, id ); write_string( g_szKickReason[ iType ] ); message_end( ); */ server_cmd( "kick #%i ^"%s^"", get_user_userid( id ), g_szKickReason[ iType ] ); }
ApmRedirectUser( id, const iType ) { client_cmd( id, "echo ^"%s^"", g_szKickReason[ iType ] ); client_cmd( id, "echo ^"Ai fost redirectionat catre %s^"", apm_get_pcvar_string( iType ) ); client_cmd( id, "disconnect;Connect %s", apm_get_pcvar_string( iType ) ); } Nume: Advanced Protocol Manager Versiune: 2.0c Instalare: 1. Fisierul APManager.sma il puneti in addons/amxmodx/scripting2. Fisierul APManager.amxx il puneti in addons/amxmodx/plugins3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma: - Cod:
-
APManager.amxx Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg): - Cod:
-
| 0 = pot intra pe server | 1 = nu pot intra pe server ( kick + mesaj ) | 2 = redirectioneaza catre ...( + mesaj in consola ) | apm_nonsteam <0/1/2> apm_fakesteam <0/1/2> apm_steam <0/1/2>
In caz ca unul din cvar-urile de mai sus are valoarea 2 aveti nevoie de adresa/ip-ul unui server catre care va fi redirectionat.
apm_nonsteam_ip "nume.server.ro" apm_fakesteam_ip "nume.server.ro" apm_steam_ip "nume.server.ro"
|
|