[SOLVED] XXX Times kills
hi,
i tried to write a plugin to showes messages by kills. now i have no idea to show how manytimes is a user killed by the same user.
for example :
Quote:
[AMX] You are kiled by XXX! He has XX HP & XX AP. ( XX Times kills )
|
Quote:
[AMX] You killed XXX! ( XX Times Kills )
|
here is my code.
i just want to have a idea how to catch how manytimes is a player killed by the same Killer & how manytimes killed the killer the same Victim.
here is my code.
PHP Code:
#include <amxmodx>
new g_iMaxPlayers
public plugin_init() { register_plugin("Kill MSGs","1","One") register_event("DeathMsg","EventDeathMsg","a") g_iMaxPlayers = get_maxplayers() } public EventDeathMsg() { new iKiller = read_data( 1 ); new iVictim = read_data( 2 ); new szVictimName[ 32 ]; get_user_name( iVictim, szVictimName, charsmax( szVictimName ) ); if( iKiller == iVictim || !( 1 <= iKiller <= g_iMaxPlayers ) ) { client_print( 0, print_chat, "%s killed self", szVictimName ); } else { new szKillerName[ 32 ] new szVictimname [32] new killershp = get_user_health(iKiller) new killersAP = get_user_armor(iKiller) get_user_name( iKiller, szKillerName, charsmax( szKillerName ) ) get_user_name( iVictim, szVictimname, charsmax( szVictimname ) ) client_printc(iVictim, "\nKilled by \g%s\n! He has \g%d \nHP & \g%d \nAP.",szKillerName,killershp,killersAP) client_printc( iKiller, "\nYou killed \g%s",szVictimname) } } stock client_printc(const id,const input[], any:...) { new msg[191], players[32], count = 1; vformat(msg,190,input,3); replace_all(msg,190,"\g","^4");// green replace_all(msg,190,"\n","^1");// normal replace_all(msg,190,"\t","^3");// team if (id) players[0] = id; else get_players(players,count,"ch"); for (new i=0;i<count;i++) if (is_user_connected(players[i])) { message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("SayText"),_,players[i]); write_byte(players[i]); write_string(msg); message_end(); } }
but i have no idea how to catch it :( i hope you understand me
|