Kod: Tümünü seç
#include <amxmodx>
#include <zombieplague>
#define PLUGIN "xxx"
#define VERSION "xxx"
#define AUTHOR "xxx"
new g_virus, name[32], bool: z_olabilirsin;
const tvirus_ap_fiyat = 30
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
g_virus = zp_register_extra_item("Zombi Ol", tvirus_ap_fiyat, ZP_TEAM_HUMAN)
}
public plugin_end()
{
remove_task(123456);
}
public event_new_round(id)
{
z_olabilirsin = false;
set_task(12.0, "ZombiOlabilirsin", 123456);
}
public zp_extra_item_selected(id, itemid)
{
if (itemid == g_virus)
{
if (z_olabilirsin == true)
{
get_user_name(id, name, 31)
set_hudmessage(0, 255, 0, -0.05, -0.45, 1, 0.0, 5.0, 1.0, 1.0, -1)
show_hudmessage(0, "%s kendisine T-Virus'u enjekte ederek zombi oldu!", name)
//set_task(5.0, "set_zombie", id)
set_zombie(id)
}
else
{
zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + tvirus_ap_fiyat)
ChatColor(id, "!g[Mort Vivante] !ySuan zombi olamazsin!")
}
}
}
public ZombiOlabilirsin(taskid)
{
z_olabilirsin = true;
}
public set_zombie(id)
{
get_user_name(id, name, 31)
server_cmd("amx_show_activity 0")
server_cmd("zp_zombie %s", name)
server_cmd("amx_show_activity 2")
}
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4")
replace_all(msg, 190, "!y", "^1")
replace_all(msg, 190, "!team", "^3")
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();
}
}
}
}