Ok i fixed that...
Now i can't slay anything
Code:
] amx_slayer T
Usage: amx_slayer <@CT @T @ALL>
] amx_slayer CT
Usage: amx_slayer <@CT @T @ALL>
] amx_slayer @ALL
Usage: amx_slayer <@CT @
Nothing happens
Here's my code:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN "Team Slayer"
#define VERSION "1.0"
#define AUTHOR "Sh!nE*"
new slayed_t, slayed_ct, slayed_all
new g_max_players
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_slayer", "slay_cmd", ADMIN_SLAY, " <@CT @T @ALL>")
g_max_players = get_maxplayers()
}
public slay_cmd(id, level, cid)
{
if( id < 1 || id > g_max_players)
return PLUGIN_CONTINUE
if (!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED
new Arg1[5]
read_argv(1, Arg1, 4)
if (Arg1[0] == '@')
{
new Team = 0
if (equali(Arg1[1], "CT"))
{
Team = 2
}
else if (equali(Arg1[1], "T"))
{
Team = 1
}
else if (equali(Arg1[1], "ALL"))
{
Team = 3
new players[32], num
get_players(players, num)
new i
for (i=0; i<num; i++)
{
if (Team == 1)
{
slayed_t = 1
check_slay(id)
}
else if(Team == 2)
{
slayed_ct = 1
check_slay(id)
}
else if(Team == 3)
{
slayed_all = 1
check_slay(id)
}
}
}
}
return PLUGIN_HANDLED
}
public check_slay(id)
{
new CsTeams:team = cs_get_user_team(id)
if(slayed_t == 1)
{
if(team == CS_TEAM_T)
{
user_slap(id, 9999, 0)
slayed_t = 0
return PLUGIN_CONTINUE
}
}
if(slayed_ct == 1)
{
if(team == CS_TEAM_CT)
{
user_slap(id, 9999, 0)
slayed_ct = 0
return PLUGIN_CONTINUE
}
}
if(slayed_all == 1)
{
user_slap(id, 9999, 0)
slayed_all = 0
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
Maybe this is stupid.. but im new.
Can you please help me?