UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

How to detect the death of a zombie

broken avatar :(
Created 8 years ago
by n0x
0 Members and 1 Guest are viewing this topic.
2,170 views
broken avatar :(
×
broken avatar :(
Location: fr
Date Registered: 4 October 2016
Last active: 8 years ago
Posts
2
Respect
Forum Rank
Fresh Corpse
Primary Group
Member
My Contact & Social Links
More
×
n0x's Groups
n0x's Contact & Social Linksn0xirsm
Hi everyone, I want to call a function when a zombie die, but I haven't found how to do it.

So if anyone has a solution that would be great.  :)
broken avatar :(
×
broken avatar :(
Location: gbEurope
Date Registered: 20 September 2016
Last active: 2 years ago
Posts
17
Respect
Forum Rank
Legless Crawler
Primary Group
Member
×
ulraz_viper's Groups
ulraz_viper's Contact & Social Links
I'll take a stab at if, what you could use is the zombie counter function (posted on the forum) and manipulate it so its not showing on screen but you could check when the counter decreases... hope this helps you.
broken avatar :(
×
broken avatar :(
The King of Zombies
Location: usLouisiana
Date Registered: 24 June 2013
Last active: 4 years ago
Posts
2,148
Respect
Forum Rank
King of the Zombies
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Signature
Donate to me if you enjoy my work. https://www.paypal.me/thezombiekilla6
×
Dust's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Dust's Contact & Social LinksMrZ0mbiesFanaticdust103194MrZ0mbiesFanatic
Since you cant edit the stock scripts yet for bo3, you can just get the array of the zombie ai, and do a waittill death

something like this.

Code Snippet
Plaintext
function zombies_init()
{
while(1)
{
zombies = getaispeciesarray( "axis", "all" );
for( i = 0; i < zombies.size; i++ )
zombies[i] thread watch_for_death();
}
wait 0.1;
}

function watch_for_death()
{
self waittill("death");

//Whatever you want
}
broken avatar :(
×
broken avatar :(
Location: usYork, SC
Date Registered: 15 March 2014
Last active: 5 years ago
Posts
214
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
WaW Scriptor
Signature
WaW Scriptor
×
PROxFTW's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
PROxFTW's Contact & Social LinksPROxFTWPROxFTWPROxFTWPROxFTW
just open mapname.gsc if you want it for that map or whatever file but make sure this line is at the top, and if not add it
Code Snippet
Plaintext
#using scripts\zm\_zm_spawner;
then if in mapname.gsc add this in the main function otherwise place in any function as long as it gets called
Code Snippet
Plaintext
zm_spawner::register_zombie_death_event_callback( &zombie_death_do_function );
then add this to the bottom of the file
Code Snippet
Plaintext
function zombie_death_do_function()
{
//code goes here
}

 
Loading ...