Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <fun>
new PLUGIN[]="Team Change"
new AUTHOR[]="st0ka"
new VERSION[]="1.00"
public plugin_init()
{
register_plugin(PLUGIN,VERSION,AUTHOR)
register_concmd("say /ct","team_ct")
register_concmd("say_team /ct","team_ct")
register_concmd("say /spec","team_spec")
register_concmd("say_team /spec","team_spec")
register_concmd("say /respawn","player_respawn")
register_concmd("say_team /respawn","player_respawn")
set_msg_block(get_user_msgid("ClCorpse"), BLOCK_SET)
}
public team_ct(id)
{
new CsTeams:team = cs_get_user_team(id)
if (team == CS_TEAM_CT)
{
return PLUGIN_HANDLED
}
else
{
cs_set_user_team(id,CS_TEAM_CT,CS_DONTCHANGE)
cs_user_spawn(id)
give_item(id,"weapon_knife")
give_item(id,"weapon_usp")
give_item(id,"weapon_usp")
give_item(id,"weapon_usp")
}
return PLUGIN_HANDLED
}
public team_spec(id)
{
new CsTeams:team = cs_get_user_team(id)
if (team == CS_TEAM_SPECTATOR)
{
return PLUGIN_HANDLED
}
else
{
entity_set_int(id,EV_INT_deadflag,DEAD_DISCARDBODY)
cs_set_user_team(id,CS_TEAM_SPECTATOR,CS_DONTCHANGE)
}
return PLUGIN_HANDLED
}
public player_respawn(id)
{
new CsTeams:team = cs_get_user_team(id)
if (team == CS_TEAM_SPECTATOR)
{
return PLUGIN_HANDLED
}
else if (!is_user_alive(id))
{
cs_user_spawn(id)
give_item(id,"weapon_knife")
give_item(id,"weapon_usp")
give_item(id,"weapon_usp")
give_item(id,"weapon_usp")
}
return PLUGIN_HANDLED
}
What do that function team_ct, team_spec was executed when striking the button "M"? Like looks simply, but beside me brain came short
thanks
__________________