Last Human Kill ( I don't know last human forward)help!
Last Human Kill ( I don't know last human forward)help!
/* Plugin generated by AMXX-Studio */
#include <zombieplague>
#include <amxmodx>
#include <hamsandwich>
#define PLUGIN "lasthumankill"
#define VERSION "0.1"
#define AUTHOR "Barney"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
RegisterHam(Ham_TakeDamage, "player", "fw_killlasthuman");
}
public client_putinserver(id)
{
new g_Ham_Bot
if(!g_Ham_Bot && is_user_bot(id))
{
g_Ham_Bot = 1
set_task(0.1, "Do_RegisterHam_Bot", id)
}
}
public Do_RegisterHam_Bot(id)
{
RegisterHamFromEntity(Ham_TakeDamage, id, "fw_killlasthuman")
}
public fw_killlasthuman(victim, inflictor, attacker, Float:damage)
{
if(victim != attacker && is_user_connected(attacker) && zp_get_user_last_human(victim) && zp_get_user_zombie(attacker))
{
ExecuteHamB(Ham_Killed, victim, attacker, 0)
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/
#include <zombieplague>
#include <amxmodx>
#include <hamsandwich>
#define PLUGIN "lasthumankill"
#define VERSION "0.1"
#define AUTHOR "Barney"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
RegisterHam(Ham_TakeDamage, "player", "fw_killlasthuman");
}
public client_putinserver(id)
{
new g_Ham_Bot
if(!g_Ham_Bot && is_user_bot(id))
{
g_Ham_Bot = 1
set_task(0.1, "Do_RegisterHam_Bot", id)
}
}
public Do_RegisterHam_Bot(id)
{
RegisterHamFromEntity(Ham_TakeDamage, id, "fw_killlasthuman")
}
public fw_killlasthuman(victim, inflictor, attacker, Float:damage)
{
if(victim != attacker && is_user_connected(attacker) && zp_get_user_last_human(victim) && zp_get_user_zombie(attacker))
{
ExecuteHamB(Ham_Killed, victim, attacker, 0)
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/
-
- Veteran Member
- Posts: 408
- Joined: 5 years ago
- Contact:
pirate228 wrote: ↑4 years ago /* Plugin generated by AMXX-Studio */
#include <zombieplague>
#include <amxmodx>
#include <hamsandwich>
#define PLUGIN "lasthumankill"
#define VERSION "0.1"
#define AUTHOR "Barney"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
RegisterHam(Ham_TakeDamage, "player", "fw_killlasthuman");
}
public client_putinserver(id)
{
new g_Ham_Bot
if(!g_Ham_Bot && is_user_bot(id))
{
g_Ham_Bot = 1
set_task(0.1, "Do_RegisterHam_Bot", id)
}
}
public Do_RegisterHam_Bot(id)
{
RegisterHamFromEntity(Ham_TakeDamage, id, "fw_killlasthuman")
}
public fw_killlasthuman(victim, inflictor, attacker, Float:damage)
{
if(victim != attacker && is_user_connected(attacker) && zp_get_user_last_human(victim) && zp_get_user_zombie(attacker))
{
ExecuteHamB(Ham_Killed, victim, attacker, 0)
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/
i converted it for you, give a try:
Code: Select all
#include <zombie_escape>
#define PLUGIN "[ZE] lasthumankill"
#define VERSION "0.1"
#define AUTHOR "Barney"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
RegisterHam(Ham_TakeDamage, "player", "fw_killlasthuman");
}
public client_putinserver(id)
{
new g_Ham_Bot
if(!g_Ham_Bot && is_user_bot(id))
{
g_Ham_Bot = 1
set_task(0.1, "Do_RegisterHam_Bot", id)
}
}
public Do_RegisterHam_Bot(id)
{
RegisterHamFromEntity(Ham_TakeDamage, id, "fw_killlasthuman")
}
public fw_killlasthuman(victim, inflictor, attacker, Float:damage)
{
if(victim != attacker && is_user_connected(attacker) && ze_get_humans_number() == 1 && ze_is_user_zombie(attacker))
{
ExecuteHamB(Ham_Killed, victim, attacker, 0)
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/
ze_get_humans_number() == 1
to get the last human numberEnjoy
-
- Veteran Member
- Posts: 408
- Joined: 5 years ago
- Contact:
also if you will type an code here on this forum you should type this
[code]
<Your Code>
[/code]
but don't use this symbols "< >"
[code]
<Your Code>
[/code]
but don't use this symbols "< >"
it will work wrong like thatMuhammet20 wrote: ↑4 years agopirate228 wrote: ↑4 years ago /* Plugin generated by AMXX-Studio */
#include <zombieplague>
#include <amxmodx>
#include <hamsandwich>
#define PLUGIN "lasthumankill"
#define VERSION "0.1"
#define AUTHOR "Barney"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
RegisterHam(Ham_TakeDamage, "player", "fw_killlasthuman");
}
public client_putinserver(id)
{
new g_Ham_Bot
if(!g_Ham_Bot && is_user_bot(id))
{
g_Ham_Bot = 1
set_task(0.1, "Do_RegisterHam_Bot", id)
}
}
public Do_RegisterHam_Bot(id)
{
RegisterHamFromEntity(Ham_TakeDamage, id, "fw_killlasthuman")
}
public fw_killlasthuman(victim, inflictor, attacker, Float:damage)
{
if(victim != attacker && is_user_connected(attacker) && zp_get_user_last_human(victim) && zp_get_user_zombie(attacker))
{
ExecuteHamB(Ham_Killed, victim, attacker, 0)
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/
i converted it for you, give a try:Note: i used this command:Code: Select all
#include <zombie_escape> #define PLUGIN "[ZE] lasthumankill" #define VERSION "0.1" #define AUTHOR "Barney" public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); RegisterHam(Ham_TakeDamage, "player", "fw_killlasthuman"); } public client_putinserver(id) { new g_Ham_Bot if(!g_Ham_Bot && is_user_bot(id)) { g_Ham_Bot = 1 set_task(0.1, "Do_RegisterHam_Bot", id) } } public Do_RegisterHam_Bot(id) { RegisterHamFromEntity(Ham_TakeDamage, id, "fw_killlasthuman") } public fw_killlasthuman(victim, inflictor, attacker, Float:damage) { if(victim != attacker && is_user_connected(attacker) && ze_get_humans_number() == 1 && ze_is_user_zombie(attacker)) { ExecuteHamB(Ham_Killed, victim, attacker, 0) } } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par } */
ze_get_humans_number() == 1
to get the last human number
Enjoy
first: when you use ze_get_humans_number() == 1 it will not kill the last human this will kill penultimate human use 0 to kill last human
seconde: it will killed and inf the last human in the same time
alright , let me give both of them a try
not working I tried ze_get_humans_number() == 1 and 0
KICKED :
error : you killed 1 and 2 teammate
error : you killed 2 and 3 teammate
error : you killed 3 and 4 teammate
KICKED :
error : you killed 1 and 2 teammate
error : you killed 2 and 3 teammate
error : you killed 3 and 4 teammate
cuz when you killed last human its killed him and infcted him in the same time, Ask @Raheem or @Mohamed Alaa maybe they can fix it.
-
- Veteran Member
- Posts: 408
- Joined: 5 years ago
- Contact:
- Night Fury
- Mod Developer
- Posts: 677
- Joined: 7 years ago
- Contact:
Try this:
Code: Select all
#include <zombie_escape>
#define TASK 1100
new g_iLastHumanIndex
public plugin_init()
{
register_plugin("[ZE] Addons: Kill last human", "1.0", "Barney")
}
public ze_game_started()
{
set_task(0.1, "Check_Humans", TASK, _, _, "b")
}
public Check_Humans(TaskID)
{
if (ze_is_game_started() && (ze_get_humans_number() == 1))
{
for (new id = 1; id <= get_member_game(m_nMaxPlayers); id++)
{
if (ze_is_user_zombie(id) || !is_user_alive(id))
continue
g_iLastHumanIndex = id
remove_task(TASK)
break
}
}
}
public ze_user_infected_pre(iVictim, iInfector, iDamage)
{
if (iVictim == g_iLastHumanIndex && is_user_alive(iVictim) && is_user_alive(iInfector))
{
ExecuteHamB(Ham_Killed, iVictim, iInfector, 0)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute
Sign in
Who is online
Users browsing this forum: No registered users and 7 guests