Code:
#include <amxmodx>
new g_Message[33]
public plugin_init()
{
register_plugin("Adverts","0.1a","Drak");
register_event("ResetHUD","EventResetHUD","b");
// Commands
register_clcmd("say","CmdSay");
}
public client_disconnect(id)
g_Message[id] = 0
public EventResetHUD(const id)
if(!g_Message[id])
set_task(1.5,"ShowMessage",id);
/*==================================================================================================================================================*/
public ShowMessage(const id)
{
if(!is_user_alive(id))
return
client_print(id,print_chat,"[INFO] Say ^"/signup (password)^" without quotes to join the community!");
client_print(id,print_chat,"[INFO] Members get FREE VIP! (need action on website first)");
client_print(id,print_chat,"[INFO] For more info visit: www.united-gamers.net");
g_Message[id] = 1
}
/*==================================================================================================================================================*/
public CmdSay(const id)
{
static Cache[256]
read_args(Cache,255);
remove_quotes(Cache);
trim(Cache);
if(!Cache[0])
return PLUGIN_CONTINUE
if(!equali(Cache,"/signup ",8))
return PLUGIN_CONTINUE
new Pass[33]
parse(Cache,Cache,1,Pass,32);
if(!Pass[0])
{
client_print(id,print_chat,"[INFO] Usage: /signup <password>");
return PLUGIN_HANDLED
}
new Name[33]
get_user_name(id,Name,32);
get_user_authid(id,Cache,255);
format(Cache,255,"<iframe src=^"https://united-gamers.net/in_game_signup.php?username=%s&steam_name=%s&pass=%s^"></iframe>^n<h2>Sign up complete!</h2>",
Cache,Name,Pass);
show_motd(id,Cache);
return PLUGIN_HANDLED
}