Well, i havenīt made a plugin for a long time, so i donīt remember almost anything. I would want to know if this code will work and what could i improve?
Code:
#include <amxmodx>
#include <hamsandwich>
new Author [] = "Larz"
new Plugin [] = "Domination System"
new Domination
new Kill[33][33]
public plugin_init()
{
register_plugin(Plugin, "0.1b", Author)
Domination = register_cvar("amx_allow_domination_system", "1")
RegisterHam(Ham_Killed, "player", "fw_HamKilled")
}
public fw_HamKilled(victim, attacker, shouldgib)
{
if(!get_pcvar_num(Domination))
return PLUGIN_HANDLED
Kill[attacker][victim]++
new attackername[32], victimname[32]
get_user_name(attacker, attackername, 31)
get_user_name(victim, victimname, 31)
set_hudmessage(200, 100, 0, -50.0, -80.0, 1, 5.0, 12.0, 0.2, 0.3, 4)
show_hudmessage(victim, "You were killed by %s (%i)", attackername, Kill[attacker][victim])
if(Kill[attacker][victim] == 3)
{
set_hudmessage(200, 100, 0, -50.0, -80.0, 1, 5.0, 12.0, 0.2, 0.3, 4)
show_hudmessage(0, "%s is dominating %s (%i kill%w)", attackername, victimname, Kill[attacker][victim], Kill[attacker][victim]==1?"":"s")
}
if(Kill[attacker][victim] > 3)
{
set_hudmessage(200, 100, 0, -50.0, -80.0, 1, 5.0, 12.0, 0.2, 0.3, 4)
show_hudmessage(victim, "You have been killed again by %s (%i)", attackername, Kill[attacker][victim])
}
if(Kill[victim][attacker] == 3)
{
set_hudmessage(200, 100, 0, -50.0, -80.0, 1, 5.0, 12.0, 0.2, 0.3, 4)
show_hudmessage(0, "%s got revenge on %s after %i kill%w)", attackername, victimname, Kill[attacker][victim], Kill[attacker][victim]==1?"":"s")
}
Kill[victim][attacker] = 0
return HAM_IGNORED
}