AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to count the killings of a player? (https://forums.alliedmods.net/showthread.php?t=88935)

alan_el_more 03-30-2009 20:46

How to count the killings of a player?
 
How to count the killings of a player?
thanks in advance :D

Spunky 03-30-2009 20:47

Re: How to count the killings of a player?
 
http://www.amxmodx.org/funcwiki.php?go=func&id=1

alan_el_more 03-30-2009 20:48

Re: How to count the killings of a player?
 
Quote:

Originally Posted by Spunky (Post 793573)

but that resume at the end of a round.

Arkshine 03-30-2009 20:50

Re: How to count the killings of a player?
 
No. This native gives the current player's frag. That's all.

Dr.G 03-31-2009 04:50

Re: How to count the killings of a player?
 
make a simple global to count it, something like this:

PHP Code:

/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <hamsandwich>
 
 
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
 
new g_kill_counter[33]
 
 
public 
plugin_init() 
{
 
register_plugin(PLUGINVERSIONAUTHOR)
 
 
RegisterHam(Ham_Killed"player""func_Ham_Killed",1)
 
/*                *1          *2         *3
 
 *1 - Register an entity is killed = Ham_Killed
 *2 - Entity named: player
 *3 - Function to forward to: Player_Killed  */
}
 
 
public 
func_Ham_Killed(idiAttackershouldgib
{
 
 
g_kill_counter[iAttacker]++
 
 
client_print(iAttacker3" Kill # %d"g_kill_counter[iAttacker])
 



anakin_cstrike 03-31-2009 07:56

Re: How to count the killings of a player?
 
Quote:

Originally Posted by Dr.G (Post 793818)
make a simple global to count it, something like this:

PHP Code:

/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <hamsandwich>
 
 
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
 
new g_kill_counter[33]
 
 
public 
plugin_init() 
{
 
register_plugin(PLUGINVERSIONAUTHOR)
 
 
RegisterHam(Ham_Killed"player""Player_Killed",1)
 
/*                *1          *2         *3
 
 *1 - Register an entity is killed = Ham_Killed
 *2 - Entity named: player
 *3 - Function to forward to: Player_Killed  */
}
 
 
public 
func_Ham_Killed(idiAttackershouldgib
{
 
 
g_kill_counter[iAttacker]++
 
 
client_print(iAttacker3" Kill # %d"g_kill_counter[iAttacker])
 



That won't do anything, because you named the function "Player_Killed" and you used "func_Ham_Killed".

And it will be more easy to use deathmsg ( first param - killer )

Dr.G 03-31-2009 08:10

Re: How to count the killings of a player?
 
lol correct, fixed. and thanks

alan_el_more 03-31-2009 08:46

Re: How to count the killings of a player?
 
thank you but I have already settled
Like you and +k :D

ConnorMcLeod 03-31-2009 12:25

Re: How to count the killings of a player?
 
Make sure killer is between 1 and maxplayers before you use the array.

alan_el_more 03-31-2009 12:32

Re: How to count the killings of a player?
 
i use this:

PHP Code:

new kill_count[33]

public 
plugin_init()
{
    
register_event("DeathMsg""player_die""a")
}

public 
player_die()
{
    static 
attackerattacker read_data(1)
    
kill_count[attacker]++




All times are GMT -4. The time now is 02:17.

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