Kod:
public cmdKeeper(id)
{
if(get_pcvar_num(CVAR_ARQUEROS))
{
if(is_user_alive(id) && soy_spec[id] == false)
{
new userteam = get_user_team(id)
if(!user_is_keeper[id])
{
new name[MAX_PLAYER + 1]
get_user_name(id, name, MAX_PLAYER)
if(userteam == 2)
{
if(arqueroct == 0)
{
new KeeperMdl[128]
copy(KeeperMdl, sizeof KeeperMdl - 1, SModel[1])
CT_keeper[id] = true
user_is_keeper[id] = true
arqueroct = 1
set_hudmessage (0, 255, 255, -1.0, 0.2, 2, 0.1, 10.0, 0.05, 1.0, 1)
show_hudmessage(0, "%s %L!", name, LANG_PLAYER, "NEWGKCT")
ColorChat(0, GREY, "^x04 %s %L", name, LANG_PLAYER, "NEWGKCT")
cs_set_user_model(id, KeeperMdl)
set_user_rendering(id,kRenderFxGlowShell,0,255,0,kRenderNormal,255)
CurWeapon(id)
// play_wav(id, KEEPER);
play_wav(id, SoundDirect[24])
}
else
{
new NameKeeper[MAX_PLAYER + 1]
for(new x = 1; x <= MAX_PLAYER; x++)
{
new TeamX = get_user_team(x)
if(TeamX == 2 && user_is_keeper[x] && is_user_connected(x))
get_user_name(x, NameKeeper, MAX_PLAYER)
}
if(equali(NameKeeper,""))
{
arqueroct = 0
cmdKeeper(id)
return PLUGIN_HANDLED
}
ColorChat(id, GREY, "^x04 You can't be a goal keeper because %s already is.", NameKeeper)
}
}
else if(userteam == 1)
{
if(arquerot == 0)
{
new KeeperMdl[128]
copy(KeeperMdl, sizeof KeeperMdl - 1, SModel[2])
T_keeper[id] = true
user_is_keeper[id] = true
arquerot = 1
set_hudmessage (255, 255, 0, -1.0, 0.25, 2, 0.1, 10.0, 0.05, 1.0, 1)
show_hudmessage(0, "%s %L", name, LANG_PLAYER, "NEWGKT")
ColorChat(0, GREY, "^x04 %s %L", name, LANG_PLAYER, "NEWGKT")
cs_set_user_model(id, KeeperMdl)
set_user_rendering(id,kRenderFxGlowShell,255,255,0,kRenderNormal,255)
CurWeapon(id)
// play_wav(id, KEEPER);
play_wav(id, SoundDirect[24])
}
else
{
new NameKeeper[MAX_PLAYER + 1]
for(new x = 1; x <= MAX_PLAYER; x++)
{
new TeamX = get_user_team(x)
if(TeamX == 1 && user_is_keeper[x] && is_user_connected(x))
get_user_name(x, NameKeeper, MAX_PLAYER)
}
if(equali(NameKeeper,""))
{
arquerot = 0
cmdKeeper(id)
return PLUGIN_HANDLED
}
ColorChat(id, GREY, "^x04 You cannot be a goal keeper because %s already is.", NameKeeper)
}
}
else
{
ColorChat(id, GREY, "^x04 %L", LANG_PLAYER, "SPECCANT")
}
}
else
{
ColorChat(id, GREY, "^x04 Ya sos arquero!", LANG_PLAYER, "ARCHER")
}
}
}
else
ColorChat(id, GREY, "^x04 %L", LANG_PLAYER, "OPTIONDIS")
return PLUGIN_HANDLED
}