The newround event doesn't provide a client-parameter, stop adding one.
Also your else-if() is the same as a regular else() in this case.
I optimized some things for you. Every time a CT becomes the last CT or the last CT kills someone, he gets the hudmessage.
PHP Code:
#include < amxmodx >
#include < cstrike >
#include < hamsandwich >
new iLastCTKills, iLastCT
public plugin_init()
{
RegisterHam(Ham_Killed, "player", "hamKilledPost", true )
RegisterHam(Ham_TakeDamage, "player", "hamTakeDamagePre", false )
register_logevent("eventRoundStart", 2, "1=Round_Start")
}
public searchLastCT()
{
new iPlayers[32], iNum
get_players(iPlayers, iNum, "ae", "CT")
if(iNum == 1)
{
iLastCT = iPlayers[0]
return 1
}
return 0
}
public eventRoundStart()
{
iLastCT = -1
iLastCTKills = 0
if(searchLastCT()) Information(iLastCT)
}
public client_disconnect(id)
{
if(cs_get_user_team(id) == CS_TEAM_CT)
{
if(searchLastCT()) Information(iLastCT)
}
}
public hamKilledPost(victim, attacker, shouldgib)
{
if(iLastCT == -1 && cs_get_user_team(victim) == CS_TEAM_CT )
{
if(searchLastCT()) Information(iLastCT)
}
if( attacker == iLastCT && iLastCTKills < 10 && cs_get_user_team(victim) == CS_TEAM_T )
{
iLastCTKills += 1;
Information(iLastCT)
}
return 1;
}
public hamTakeDamagePre(const victim, const inflictor, const attacker, Float:damage, const iDamageType)
{
if( victim == attacker )
return HAM_IGNORED
if(attacker != iLastCT )
return HAM_IGNORED
SetHamParamFloat(4, damage * (1 + iLastCTKills * 0.1 ) )
return HAM_IGNORED;
}
public Information( client )
{
if( !is_user_alive( client ) )
return PLUGIN_CONTINUE;
new szBar[11]
for(new i = 0; i < iLastCTKills; i++)
{
szBar[i] = '+';
}
for(new i = iLastCTKills; i < 10; i++)
{
szBar[i] = '-';
}
set_hudmessage( 0, 255, 0, 0.30, 0.78, 0, 6.0, 1.0 )
show_hudmessage( client, "Power Attack [ %i%% ]^n [ %s ]", 100 + iLastCTKills * 10, szBar)
return PLUGIN_CONTINUE;
}