Код:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#define PLUGIN "Spec Switch"
#define VERSION "0.0.3"
#define AUTHOR "many"
new CsTeams:zTeam
new zDeath
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /spec", "spec")
register_clcmd("say_team /spec", "spec")
register_clcmd("say /back", "back")
register_clcmd("say_team /back", "back")
}
public spec(id) {
zDeath = cs_get_user_deaths(id)
if (cs_get_user_team(id) == CS_TEAM_SPECTATOR)
return PLUGIN_HANDLED
else
zTeam = cs_get_user_team(id)
cs_set_user_team(id, CS_TEAM_SPECTATOR)
user_kill(id, 1)
return PLUGIN_CONTINUE
}
public back(id) {
if (cs_get_user_team(id) == CS_TEAM_SPECTATOR)
cs_set_user_team(id, zTeam)
cs_set_user_deaths(id, zDeath)
set_task(1.5,"respawn",id)
}
public rule(id){
ColorChat(id, "!yЧтобы перейти в !gспектаторы!y, напишите: !t/spec")
ColorChat(id, "!yЧтобы вернутся в !gигру!y, напишите: !t/back")
ColorChat(id, "!yIP адрес !gHSDM-FFA!y, !t/193.36.35.73:27016")
}
public respawn(id){
if (is_user_alive(id)){
return PLUGIN_HANDLED
}
else{
cs_user_spawn(id)
if (cs_get_user_team(id) == CS_TEAM_T){
give_item(id,"weapon_knife")
give_item(id,"weapon_glock18")
give_item(id,"ammo_9mm")
}
if (cs_get_user_team(id) == CS_TEAM_CT){
give_item(id,"weapon_knife")
give_item(id,"weapon_usp")
give_item(id,"ammo_45acp")
give_item(id,"ammo_45acp")
}
}
return PLUGIN_CONTINUE
}
public client_putinserver(id) {
set_task(20.0,"rule",id)
}
stock ColorChat(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
format(msg, sizeof(msg), "%s", msg)
replace_all(msg, 190, "!g", "^4") // Green Color
replace_all(msg, 190, "!y", "^1") // Default Color
replace_all(msg, 190, "!t", "^3") // Team Color
if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
Когда пишешь /spec переходишь в спектры) и твой труп остается на земле)
когда пишешь /back, появляешься, на своём респе, с usp (glock) (как будто только что начался раунд на паблике) и не показывается меню guns, ну соответственно когда в чат пишешь /guns тогда оно открывается. И ещё такой баг, коннектишься, заходишь в спектры, пишешь /back и играешь за спектра вроде)))