Raised This Month: $ Target: $400
 0% 

Respawn hook player death


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 07-14-2008 , 21:21   Respawn hook player death
Reply With Quote #1

Ok so question for you guys is ther a way i can hook the event player death? something similar to this

public hook_death(id)
{
if(player dies)
{
set_task(5.0, "respawn")
}
}

public respawn(id)
{
spawn(id)
}

and if there is a way can i put text that says

You will re spawn in %s Seconds and count down
Doc-Holiday is offline
zwfgdlc
Senior Member
Join Date: May 2006
Old 07-14-2008 , 22:01   Re: Respawn hook player death
Reply With Quote #2

Code:
public plugin_init() {     register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);     register_event("DeathMsg ", "hook_death", "a") } public hook_death() {     victim=read_data(2);     set_task(5.0, "respawn",victim); } public respawn(id) {     spawn(id) }

Last edited by zwfgdlc; 07-14-2008 at 23:30.
zwfgdlc is offline
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 07-14-2008 , 23:13   Re: Respawn hook player death
Reply With Quote #3

The above example has an error in registering the DeathMsg event. It should read:
register_event("DeathMsg", "hook_death", "a")
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
zwfgdlc
Senior Member
Join Date: May 2006
Old 07-14-2008 , 23:35   Re: Respawn hook player death
Reply With Quote #4

yes,thanks for the warning.
zwfgdlc is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 07-14-2008 , 23:52   Re: Respawn hook player death
Reply With Quote #5

i just changed it to edeathmsg or w/e on the public lol it was a bit easier to me.. but 5.0 is five min? right not seconds .5 would be five seconds correct?
Doc-Holiday is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-15-2008 , 01:07   Re: Respawn hook player death
Reply With Quote #6

http://www.amxmodx.org/funcwiki.php?...task&go=search
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:33.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode