AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to get how a player dies (https://forums.alliedmods.net/showthread.php?t=46064)

sub 10-17-2006 19:28

How to get how a player dies
 
How can I get liek what the player died from, ie from an ak from a glock from an awp?

XxAvalanchexX 10-17-2006 20:07

Re: How to get how a player dies
 
Code:
public plugin_init() {      register_event("DeathMsg","event_deathmsg","a"); } public event_deathmsg() {      new weaponName[32];      read_data(4,weaponName,31); }

weaponName would then be "ak47", "m4a1", "worldspawn", etcetera.

knekter 10-17-2006 20:46

Re: How to get how a player dies
 
you should do:
Code:
static weaponName[32]; read_data(4, weaponName, 31);

sub 10-17-2006 21:16

Re: How to get how a player dies
 
Thansk +Karma

edit: How do I maek it so it gives the weapon id. What I want to do with this is when a player dies a certain way, when they spawn it will have a different effect from each type of death.

Lord_Destros 10-17-2006 21:47

Re: How to get how a player dies
 
lol the bottem part of avalanches code

(the code within the DeathMsg)

sub 10-17-2006 21:57

Re: How to get how a player dies
 
Okay well I was just a little confused. Thanks to you too.

XxAvalanchexX 10-17-2006 22:38

Re: How to get how a player dies
 
You could just make a global variable that contains the weapon a user was killed with:
Code:
new killedWith[33][32];
And then on death, save the weapon to that instead:
Code:
read_data(4,killedWith[read_data(2)],31);
Then when a user spawns, do what you want based upon what is in that variable.

Silencer123 10-18-2006 13:59

Re: How to get how a player dies
 
note that DeathMsg event is only called in Games that
actually display a Message when a Player dies. For example,
SvenCoop does not.

sub 10-18-2006 15:16

Re: How to get how a player dies
 
Thanks Again, Yeah the Mod im Working with does use death messages.


All times are GMT -4. The time now is 09:44.

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