 |
|
SourceMod Donner Party
Join Date: Oct 2009
Location: Poortugal
|

07-09-2012
, 19:31
Re: What line to use in order to block only domain name ?
|
#2
|
you use restrict names only for that?
you can use this if you want
Spoiler
PHP Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta>
#define ADMIN_LEVEL ADMIN_BAN // change the admin level if you want
new Trie:domain
public plugin_init() { register_plugin("block domain name", "1.0", "guipatinador") register_forward(FM_ClientUserInfoChanged, "forward_client_userinfochanged") domain = TrieCreate() TrieSetCell(domain, ".com", 1) TrieSetCell(domain, ".ro", 1) TrieSetCell(domain, ".ru", 1) TrieSetCell(domain, ".info", 1) TrieSetCell(domain, ".eu", 1) TrieSetCell(domain, ".biznet", 1) TrieSetCell(domain, ".org", 1) // you can add more domains }
public forward_client_userinfochanged(id) { if(is_user_connected(id) || !(get_user_flags(id) & ADMIN_LEVEL)) { new name[32] get_user_name(id, name, charsmax(name)) if(TrieKeyExists(domain, name)) server_cmd("kick #%d ^"Nickname not allowed here.^"", get_user_userid(id)) } return PLUGIN_CONTINUE }
untested but should work.
edit1: dont work lol.
containi version,
PHP Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta>
#define ADMIN_LEVEL ADMIN_BAN // change the admin level if you want
public plugin_init() { register_plugin("block domain name", "1.0", "guipatinador") register_forward(FM_ClientUserInfoChanged, "forward_client_userinfochanged") }
public forward_client_userinfochanged(id) { if(is_user_connected(id) || !(get_user_flags(id) & ADMIN_LEVEL)) { new name[32] get_user_name(id, name, charsmax(name)) if((containi(name,".com") != -1) || (containi(name,".ro") != -1) || (containi(name,".ru") != -1) || (containi(name,".info") != -1) || (containi(name,".eu") != -1) || (containi(name,".biznet") != -1) || (containi(name,".org") != -1)) server_cmd("kick #%d ^"Nickname not allowed here.^"", get_user_userid(id)) } return PLUGIN_CONTINUE }
Last edited by guipatinador; 07-09-2012 at 20:06.
|
|
|
|