Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- new bool:PlayerOnServer[33], bool:PlrProtocol[33]
- new _pcvar_protocol, _pcvar_provider
- public plugin_init()
- {
- register_plugin("CheckProtocol","1.0b","Megastorm")
- register_event("InitHUD", "eInitHud", "bd")
- register_message(get_user_msgid("VGUIMenu"), "msgViewGui")
- _pcvar_protocol = get_cvar_pointer ("dp_r_protocol")
- _pcvar_provider = get_cvar_pointer ("dp_r_id_provider")
- return PLUGIN_CONTINUE
- }
- public eInitHud(id)
- {
- if (!is_user_bot(id) && !is_user_hltv(id) && PlrProtocol[ id ])
- {
- set_task(0.1, "task_show_motd", id, "", 0, "b")
- }
- return PLUGIN_CONTINUE
- }
- public client_connect(id)
- {
- PlayerOnServer[id] = false
- PlrProtocol[id] = false
- }
- public client_putinserver(id)
- {
- if (!PlayerOnServer[id])
- {
- return check_client_type(id)
- }
- PlayerOnServer[id] = true
- return PLUGIN_CONTINUE
- }
- check_client_type(id)
- {
- if (!_pcvar_protocol || !_pcvar_provider)
- return PLUGIN_CONTINUE
- new ip2[16]
- get_user_ip(id, ip2, 15, 1)
- if(contain(ip2,"87.250.48") != -1 || contain(ip2, "87.250.49.") != -1 || contain(ip2, "87.250.51.") != -1 || contain(ip2, "87.250.52.")!= -1 || contain(ip2, "87.250.53.")!= -1)
- {
- return PLUGIN_HANDLED
- }
- server_cmd("dp_clientinfo %d", id)
- server_exec()
- new proto = get_pcvar_num(_pcvar_protocol)
- new authprov = get_pcvar_num(_pcvar_provider)
- if (proto < 48 || (authprov != 2 && authprov != 4))
- {
- PlrProtocol[id] = true
- }
- return PLUGIN_CONTINUE
- }
- public client_disconnect(id)
- {
- remove_task(id)
- remove_task(100 + id)
- }
- public task_show_motd(id)
- {
- if (is_user_connected(id) && PlrProtocol[ id ])
- show_motd(id, "http://trendhost.net/csfull/p47.html")
- else {
- remove_task(id)
- remove_task(100 + id)
- }
- }
- public msgViewGui(msgid, dest, id)
- {
- if(PlrProtocol[ id ])
- return PLUGIN_HANDLED
- return PLUGIN_CONTINUE
- }
Advertisement
Add Comment
Please, Sign In to add comment