AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Respawn hook player death (https://forums.alliedmods.net/showthread.php?t=74251)

Doc-Holiday 07-14-2008 21:21

Respawn hook player death
 
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

zwfgdlc 07-14-2008 22:01

Re: Respawn hook player death
 
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) }

Vet 07-14-2008 23:13

Re: Respawn hook player death
 
The above example has an error in registering the DeathMsg event. It should read:
register_event("DeathMsg", "hook_death", "a")

zwfgdlc 07-14-2008 23:35

Re: Respawn hook player death
 
yes,thanks for the warning.

Doc-Holiday 07-14-2008 23:52

Re: Respawn hook player death
 
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?

Exolent[jNr] 07-15-2008 01:07

Re: Respawn hook player death
 
http://www.amxmodx.org/funcwiki.php?...task&go=search


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

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