AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   execute when player dies (https://forums.alliedmods.net/showthread.php?t=187777)

n0br41ner 06-17-2012 18:34

execute when player dies
 
Alright guys, its a simple one, but i donno how :(
I want that when a player dies, to execute a part of the code.

is it this one?: http://www.amxmodx.org/funcwiki.php?go=func&id=898
if yes, why is there killer, victim and such
also i want it to work when also he suicides and such, in the function comments, it says it wont work when someone suicide :(

isnt there a function that works like client_putinserver(id)
i mean a function that i pass through it the id of the player

thanks in advance

wickedd 06-17-2012 18:47

Re: execute when player dies
 
Take a look at this.

n0br41ner 06-17-2012 18:54

Re: execute when player dies
 
i really dont get it :(
so i should use it like this?

Code:

register_event("DathMsg", "myfunction")
if not can you please give a small sample?
thanks again :D

oh and btw where can i see all the messages that can be registered? (for future use:D)

claudiuhks 06-17-2012 19:03

Re: execute when player dies
 
Code:
public plugin_init( )   register_event( "DeathMsg", "CallbackForward", "a" /* It's globaly */, "1!0" /* Killer is not null */ );   /* Killer is first argument which is byte though */   /* Then 1 will be not equal with 0 when executing CallbackForward */ public CallbackForward( /* Null argument */ ) {   static iKiller;   static iVictim;   static iHeadshot;   static cWeapon[ 24 ];   iKiller = read_data( 1 ); /* 1 = Killer */   iVictim = read_data( 2 ); /* 2 = Victim */   iHeadshot = read_data( 3 ); /* 3 = Headshot */   read_data( 4, cWeapon, 23 ); /* 4 = Weapon name */   /*     So, iKiller will be every time higher than zero, as we set the condition in register_event.     That means every time we will have a connected killer which is player.   */ } /*   Type on Google "HL1 Game Events Wiki" to see the full list of events and their bytes, strings, coords, et cetera. */

n0br41ner 06-17-2012 19:07

Re: execute when player dies
 
thank you a lot :D now i understood :D


All times are GMT -4. The time now is 06:14.

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