PHP Code:
#include <amxmodx>
new Simon
new bool:is_user_simon[32]
public plugin_init() {
register_plugin("asdas", "1.0", "yo")
register_clcmd("say /simon", "cmdsimon")
register_clcmd("say_team /simon", "cmdsimon")
register_clcmd("say /nosimon", "cmdnosimon")
register_clcmd("say_team /nosimon", "cmdnosimon")
}
public cmdsimon(id)
{
new team = get_user_team(id)
if(is_user_alive(id))
{
if(team == 1 || team == 2)
{
if(!is_user_simon[id])
{
new name[32]
get_user_name(id, name, 31)
if(Simon == 0)
{
is_user_simon[id] = true
Simon = 1
set_hudmessage (0, 255, 255, -1.0, 0.2, 2, 0.1, 10.0, 0.05, 1.0, 1)
show_hudmessage(0, "%s es el nuevo Simon", name)
client_print(0, print_chat, "%s es el nuevo Simon", name)
}
else
{
new Name[32]
for(new x = 1; x <= 32; x++)
{
new TeamX = get_user_team(x)
if(TeamX == 2 && is_user_simon[x] && is_user_connected(x))
get_user_name(x, Name, 31)
}
client_print(id, print_chat, "No podes ser simon porque %s ya lo es", Name)
}
}
else
{
client_print(id, print_chat, "Ya eres simon")
}
}
else if(team == 3 || team == 4)
{
client_print(id, print_chat, "Los SPEC no pueden ser Simon")
}
}
else
{
client_print(id, print_chat, "Debes estar vivo para poder ser simon")
}
}
public cmdnosimon(id)
{
if(is_user_simon[id])
{
new name[32]
get_user_name(id, name, 31)
is_user_simon[id] = false
Simon = 0
set_hudmessage (0, 255, 255, -1.0, 0.3, 2, 0.1, 10.0, 0.05, 1.0, 1)
show_hudmessage(0, "%s no es mas Simon", name)
client_print(0,print_chat, "%s no es mas Simon", name)
}
return PLUGIN_HANDLED
}