Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #define KICK_MSG "your kick message"
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- register_cvar("amx_only_steam", "1")
- }
- public client_putinserver(id)
- {
- if (get_cvar_num("amx_only_steam") == 1)
- return PLUGIN_HANDLER
- if (is_user_bot(id) && is_user_hltv(id))
- return PLUGIN_HANDLED
- if (get_user_flags(id) & ADMIN_IMMUNITY)
- return PLUGIN_HANDLED
- if (get_cvar_num("amx_only_steam") == 1)
- {
- new ui[32]
- new uname[32]
- get_user_ip(id, uip, 31, 1)
- get_user_name(id, uname, 31)
- if (!isSteam(id))
- {
- log_amx("User ^"%s^" ^"%s^" kicked due to invalid IP address", uname, uip)
- server_cmd("kick #%d ^"%s^"", get_user_userid(id), KICK_MSG)
- }
- }
- return PLUGIN_CONTINUE
- }
- bool:isSteam(id)
- {
- new bool:result = false
- new pcv_dp_r_protocol = get_cvar_pointer ("dp_r_protocol")
- new pcv_dp_r_id_provider = get_cvar_pointer ("dp_r_id_provider")
- if (pcv_dp_r_protocol && pcv_dp_r_id_provider)
- {
- server_cmd("dp_clientinfo %d", id)
- server_exec()
- new authprov = get_pcvar_num(pcv_dp_r_id_provider)
- if (authprov == 2) result = true
- }
- return result
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement