Code:
/* AMX Mod X script.
*
* (c) 2004, Strake
* This file is provided as is (no warranties).
*/
#include <amxmodx>
new plrid
public plugin_init(){
register_plugin("ClanTagProtect","1.0","Strake")
register_clcmd("amx_tagpass", "tagpass")
}
public client_putinserver(id) {
new stClanTag[11]
new iCurrentLine = 1
new iTextLen
new stfileName[30]
stfileName = "addons/amxx/ClanTags.ini"
while ( read_file(stfileName, iCurrentLine, stClanTag, 50, iTextLen) >0 )
{
new stTag[11]
new stPassword[21]
parse(stClanTag, stTag, 10, stPassword, 20)
client_print(id, print_console, "Enter your Clan Tag's Password Now")
client_print(id, print_console, "Clan Tag: %s", stTag)
iCurrentLine++
}
}
public tagpass(id) {
plrid = id
new fileName[30]
new ClanTag[11]
new iCurrentLine = 1
new iTextLen
fileName = "addons/amxx/ClanTags.ini"
while ( read_file(fileName, iCurrentLine, ClanTag, 50, iTextLen) >0) {
new Tag[11]
new Pass[21]
parse(ClanTag, Tag, 10, Pass, 20)
new ArgTag[11]
new ArgPass[21]
read_argv(1, ArgTag, 10)
read_argv(2, ArgPass, 20)
if (equal(ArgTag, Tag))
{
if (equal(ArgPass, Pass))
{
client_print(plrid, print_chat, "Welcome Clan Member.")
}
else {
server_cmd("amx_kick %s", plrid)
}
}
iCurrentLine++
}
}