Raised This Month: $ Target: $400
 0% 

First Kill


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Trickzz
Member
Join Date: Jun 2011
Old 06-14-2011 , 06:11   First Kill
Reply With Quote #1

How to catch the moment of the first murder? And further work with a killer
Trickzz is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-14-2011 , 06:12   Re: First Kill
Reply With Quote #2

You could use a boolean to check if he is the first one.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
DjOptimuS
Senior Member
Join Date: Jan 2009
Old 06-14-2011 , 11:57   Re: First Kill
Reply With Quote #3

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; } 
DjOptimuS is offline
Trickzz
Member
Join Date: Jun 2011
Old 06-15-2011 , 11:24   Re: First Kill
Reply With Quote #4

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; }
Trickzz is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-15-2011 , 11:40   Re: First Kill
Reply With Quote #5

You put that in the Ham_Killed function.
That's the first kill.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Old 06-15-2011, 12:52
Trickzz
This message has been deleted by Trickzz.
Trickzz
Member
Join Date: Jun 2011
Old 06-15-2011 , 12:53   Re: First Kill
Reply With Quote #7

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; }

Trickzz is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-15-2011 , 13:13   Re: First Kill
Reply With Quote #8

And reset the boolean at new round event.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Trickzz
Member
Join Date: Jun 2011
Old 06-15-2011 , 14:16   Re: First Kill
Reply With Quote #9

Quote:
Originally Posted by ConnorMcLeod View Post
And reset the boolean at new round event.
Respected ConnorMcLeod, but how to do that restart occurs every new round?
Trickzz is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-15-2011 , 14:34   Re: First Kill
Reply With Quote #10

Quote:
Originally Posted by fysiks View Post
http://forums.alliedmods.net/showthread.php?t=42159

Everybody here should have this thread bookmarked.
__________________
fysiks is online now
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 23:33.


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