Post by vixetory on Mar 22, 2022 22:05:13 GMT
Hello guys, I don´t know if this site is still active, but my friend has recreated one old zombie server for fun, for some old memories and nostalgia.
I want to help him to succeed. There is one plugin that we can not fix. It´s about Nem/Surv AutoSlay. This is how plugin should work:
- If admin turns a player into Nemesis or Survivor before 5 rounds since last Nem/Surv round, player will get slayed.
I found the plugin I was looking for, but it has bug. If player gets turned into Nem or Surv by server, he gets killed. I want to bypass that, it has to slay only if admin turns someone.
I have maybe better solution, instead of getting slayed, is it possible to just disable nem/surv in admin menu (and consule commands too) until rounds reaches 5?
Here is code:
I want to help him to succeed. There is one plugin that we can not fix. It´s about Nem/Surv AutoSlay. This is how plugin should work:
- If admin turns a player into Nemesis or Survivor before 5 rounds since last Nem/Surv round, player will get slayed.
I found the plugin I was looking for, but it has bug. If player gets turned into Nem or Surv by server, he gets killed. I want to bypass that, it has to slay only if admin turns someone.
I have maybe better solution, instead of getting slayed, is it possible to just disable nem/surv in admin menu (and consule commands too) until rounds reaches 5?
Here is code:
#include <amxmodx>
#include <cstrike>
#include <fakemeta>
#include <zombieplague>
new i, round;
public plugin_init()
{
register_plugin("[ZP] Auto Slay", "0.1", "Torge")
round = register_cvar("zp_rounds", "5") // After 5 round can make nemesis/survivor
register_concmd("zp_rounds", "zp_rounds") // Console command
}
public zp_rounds()
{
if (i < get_pcvar_num(round))
{
client_print(0, print_console, "[ZP] Rounds after last nemesis/survivor: %i.", i)
}else
client_print(0, print_console, "[ZP] Rounds after last nemesis/survivor: %i. You CAN make nemesis or survivor NEXT ROUND!", i)
}
public zp_round_started(gamemode, id)
{
if (gamemode == MODE_SURVIVOR)
{
if (i < get_pcvar_num(round))
{
i=0;
static name[32]
get_user_name(id, name, 32)
client_print(0, print_chat, "Player %s has been slayed for making nemesis too early! ", name)
user_kill(id)
}
}
if (gamemode == MODE_NEMESIS)
{
if (i < get_pcvar_num(round))
{
i=0;
static name[32]
get_user_name(id, name, 32)
client_print(0, print_chat, "Player %s has been slayed for making nemesis too early! ", name)
user_kill(id)
}
}
if(gamemode == MODE_INFECTION)
{i++
}
if(gamemode == MODE_SWARM)
{i++
}
if(gamemode == MODE_PLAGUE)
{i++
}
if(gamemode == MODE_MULTI)
{i++
}
}