Spect dla graczy/adminów na mod BF2+DM
Dereń
01.12.2012
Poszukuje jakiegoś pluginu by podczas gry był dostępny spect dla graczy adminów.
Aro
01.12.2012
Łap komendy : /spec , /back
amx_spectimes "3" // ile razy możesz użyć komendy spec
Użytkownik Aro1z edytował ten post 01.12.2012 16:42
amx_spectimes "3" // ile razy możesz użyć komendy spec
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#define PLUGIN "Spec/Back"
#define AUTHOR "kramesa"
#define VERSION "v1.1"
new bool:TerroristTeam[33];
new CountTime[33];
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_clcmd("say /spec", "Spec");
register_clcmd("say /back", "Back");
register_cvar("amx_spectimes", "3");
}
public Spec(id)
{
if(CountTime[id] >= get_cvar_num("amx_spectimes"))
{
client_print(id, print_chat, "[AMXX] Sorry, you cant use this command more of %d times.", get_cvar_num("amx_spectimes"));
return PLUGIN_HANDLED;
}
if(cs_get_user_team(id) == CS_TEAM_T)
{
TerroristTeam[id] = true;
}
else
{
TerroristTeam[id] = false;
}
if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
{
client_print(id, print_chat, "[AMXX] You already Spectator.");
return PLUGIN_HANDLED;
}
else
{
cs_set_user_team(id, CS_TEAM_SPECTATOR);
user_kill(id, 1);
client_print(id, print_chat, "[AMXX] You are now in Spectator.");
CountTime[id]++;
return PLUGIN_HANDLED;
}
return PLUGIN_HANDLED;
}
public Back(id)
{
if(cs_get_user_team(id) != CS_TEAM_SPECTATOR)
{
client_print(id, print_chat, "[AMXX] You already Non-Spectator.");
return PLUGIN_HANDLED;
}
if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
{
if(TerroristTeam[id] == true)
{
cs_set_user_team(id, CS_TEAM_T);
client_print(id, print_chat, "[AMXX] You are now in Terrorist team.");
cs_set_user_deaths(id, 0);
ExecuteHam(Ham_CS_RoundRespawn, id);
return PLUGIN_HANDLED;
}
if(TerroristTeam[id] == false)
{
cs_set_user_team(id, CS_TEAM_CT);
client_print(id, print_chat, "[AMXX] You are now in Counter-Terrorist team.");
cs_set_user_deaths(id, 0);
ExecuteHam(Ham_CS_RoundRespawn, id);
return PLUGIN_HANDLED;
}
}
return PLUGIN_HANDLED;
}
Użytkownik Aro1z edytował ten post 01.12.2012 16:42