Last Human Kill ( I don't know last human forward)help!

Coding Help/Re-API Supported
Post Reply
pirate228
Member
Member
India
Posts: 13
Joined: 11 Months Ago
Has thanked: 2 times
Been thanked: 0
Contact:

Last Human Kill ( I don't know last human forward)help!

#1

Post by pirate228 » 2 Weeks 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 }
*/

User avatar
Muhammet20
Veteran Member
Veteran Member
Syria
Posts: 391
Joined: 1 Year Ago
Location: Turkey
Has thanked: 36 times
Been thanked: 5 times
Age: 13
Contact:

#2

Post by Muhammet20 » 2 Weeks Ago

pirate228 wrote:
2 Weeks 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 }
*/
Note: i used this command: ze_get_humans_number() == 1 to get the last human number

Enjoy :)
.::Kaya Gaming || Never Give Up || Zombie Escape::. [Server is Under The Work]
https://kaya-gaming.ga/

I just believe in two things, First thing is who i see in the mirror, second thing is who i don't see in the sky.

User avatar
Muhammet20
Veteran Member
Veteran Member
Syria
Posts: 391
Joined: 1 Year Ago
Location: Turkey
Has thanked: 36 times
Been thanked: 5 times
Age: 13
Contact:

#3

Post by Muhammet20 » 2 Weeks Ago

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 "< >"
.::Kaya Gaming || Never Give Up || Zombie Escape::. [Server is Under The Work]
https://kaya-gaming.ga/

I just believe in two things, First thing is who i see in the mirror, second thing is who i don't see in the sky.

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 202
Joined: 2 Years Ago
Has thanked: 14 times
Been thanked: 7 times
Age: 20
Contact:

#4

Post by sPe3doN » 2 Weeks Ago

Muhammet20 wrote:
2 Weeks Ago
pirate228 wrote:
2 Weeks 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 }
*/
Note: i used this command: ze_get_humans_number() == 1 to get the last human number

Enjoy :)
it will work wrong like that
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

pirate228
Member
Member
India
Posts: 13
Joined: 11 Months Ago
Has thanked: 2 times
Been thanked: 0
Contact:

#5

Post by pirate228 » 2 Weeks Ago

alright , let me give both of them a try

pirate228
Member
Member
India
Posts: 13
Joined: 11 Months Ago
Has thanked: 2 times
Been thanked: 0
Contact:

#6

Post by pirate228 » 2 Weeks Ago

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

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 202
Joined: 2 Years Ago
Has thanked: 14 times
Been thanked: 7 times
Age: 20
Contact:

#7

Post by sPe3doN » 2 Weeks Ago

pirate228 wrote:
2 Weeks Ago
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
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.

User avatar
Muhammet20
Veteran Member
Veteran Member
Syria
Posts: 391
Joined: 1 Year Ago
Location: Turkey
Has thanked: 36 times
Been thanked: 5 times
Age: 13
Contact:

#8

Post by Muhammet20 » 2 Weeks Ago

sPe3doN wrote:
2 Weeks Ago
pirate228 wrote:
2 Weeks Ago
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
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.
yes this is true
maybe should edit the ze_core

[ Post made via Android ]
.::Kaya Gaming || Never Give Up || Zombie Escape::. [Server is Under The Work]
https://kaya-gaming.ga/

I just believe in two things, First thing is who i see in the mirror, second thing is who i don't see in the sky.

User avatar
Mohamed Alaa
Mod Developer
Mod Developer
Egypt
Posts: 609
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 48 times
Age: 19
Contact:

#9

Post by Mohamed Alaa » 6 Days Ago

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
}
Want your own mod edition? PM me.
Accepting web projects.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest