Kod:
#include <amxmodx>
#include <cstrike>
#include <fun>
new bool:T_keeper
new bool:CT_keeper
new bool:user_is_keeper[33]
#define PLUGIN "Keeper plugin"
#define VERSION "1.0"
#define AUTHOR "Imanoobie + stupok69"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /gk","cmdKeeper")
register_clcmd("say /kaleciol","cmdKeeper")
register_clcmd("say /nogk","cmdUnKeeper")
register_clcmd("say /kaleciiptal","cmdUnKeeper")
}
public plugin_precache()
{
precache_model("models/player/guerilla/guerilla.mdl")
precache_model("models/player/gign/gign.mdl")
}
public cmdKeeper(id)
{
new CsTeams:userteam = cs_get_user_team(id)
if(user_is_keeper[id])
{
client_print(id, print_chat, "KALECI ZATEN SENSIN /oyuncu YAZARAK CIKABILIRSIN ")
return PLUGIN_HANDLED
}
new name[32]
get_user_name(id, name, 31)
if(userteam == CS_TEAM_CT)
{
if(!CT_keeper)
{
CT_keeper = true
user_is_keeper[id] = true
set_hudmessage(0, 0, 255, -1.0, 0.2, 0, 6.0, 12.0, 0.0, 0.0, -1)
show_hudmessage(0, "%s CT NIN KALECISI OLDU!", name)
cs_set_user_model(id, "keeper1")
}
else
{
client_print(id, print_chat, "TAKIMDA ZATEN KALECI VAR!")
}
}
else
{
if(!T_keeper)
{
T_keeper = true
user_is_keeper[id] = true
set_hudmessage(255, 0, 0, -1.0, 0.2, 0, 6.0, 12.0, 0.0, 0.0, -1)
show_hudmessage(0, "%s T NIN KALECISI OLDU!", name)
cs_set_user_model(id, "keeper28")
}
else
{
client_print(id, print_chat, "TAKIMDA ZATEN KALECI VAR!")
}
}
return PLUGIN_CONTINUE
}
public cmdUnKeeper(id)
{
new CsTeams:userteam = cs_get_user_team(id)
if(!user_is_keeper[id])
{
client_print(id, print_chat, "ZATEN KALECI DEGILSIN!")
return PLUGIN_CONTINUE
}
new name[33]
get_user_name(id, name, 32)
if(userteam == CS_TEAM_CT)
{
CT_keeper = false
user_is_keeper[id] = false
set_hudmessage(0, 0, 255, -1.0, 0.2, 0, 6.0, 12.0, 0.0, 0.0, -1)
show_hudmessage(0, "%s ARTIK CT NIN KALECISI DEGIL!", name)
cs_set_user_model(id, "gign")
}
else
{
T_keeper = false
user_is_keeper[id] = false
set_hudmessage(255, 0, 0, -1.0, 0.2, 0, 6.0, 12.0, 0.0, 0.0, -1)
show_hudmessage(0, "%s ARTIK T NIN KALECISI DEGIL!", name)
cs_set_user_model(id, "guerilla")
}
return PLUGIN_CONTINUE
}