AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   First Kill (https://forums.alliedmods.net/showthread.php?t=159213)

Trickzz 06-14-2011 06:11

First Kill
 
How to catch the moment of the first murder? And further work with a killer

drekes 06-14-2011 06:12

Re: First Kill
 
You could use a boolean to check if he is the first one.

DjOptimuS 06-14-2011 11:57

Re: First Kill
 
Use Ham to catch player kill

use

PHP Code:

new bool:FirstKill true

PHP Code:

RegisterHam(Ham_Killed"player""fw_PlayerKilled"); 

at

PHP Code:

public fw_PlayerKilled(victimattackershouldgib

use

PHP Code:

if(FirstKill) { FirstKill false; } 


Trickzz 06-15-2011 11:24

Re: First Kill
 
Thanks to drekes, and DjOptimus. But where to insert the last line, you can suggest an example?

Quote:

public fw_PlayerKilled(victim, attacker, shouldgib)
and this
Quote:

if(FirstKill) { FirstKill = false; }

drekes 06-15-2011 11:40

Re: First Kill
 
You put that in the Ham_Killed function.
That's the first kill.

Trickzz 06-15-2011 12:53

Re: First Kill
 
like this?

PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "First Kill"
#define VERSION "1.0"
#define AUTHOR "AUTHOR"

new bool:FirstKill true;  

public 
plugin_init() 
{
        
register_plugin(PLUGINVERSIONAUTHOR)
        
RegisterHam(Ham_Killed"player""fw_PlayerKilled");           
}

public 
fw_PlayerKilled(victimattackershouldgib)  
}
        if(
FirstKill) { FirstKill false; }



ConnorMcLeod 06-15-2011 13:13

Re: First Kill
 
And reset the boolean at new round event.

Trickzz 06-15-2011 14:16

Re: First Kill
 
Quote:

Originally Posted by ConnorMcLeod (Post 1488792)
And reset the boolean at new round event.

Respected ConnorMcLeod, but how to do that restart occurs every new round?

fysiks 06-15-2011 14:34

Re: First Kill
 
Quote:

Originally Posted by fysiks (Post 1488837)
http://forums.alliedmods.net/showthread.php?t=42159

Everybody here should have this thread bookmarked.


Trickzz 06-15-2011 14:49

Re: First Kill
 
Tell at least some principle of use, I'm not so smart in this case


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

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