If the player always gets achievement on his first kill with those conditions then you can just check if has yet gotten the achievement. I don't know if you are planning on taking action in a different function on first kill so I added a separate variable. I assume you want the first kill variable reset at each player spawn?
I hope you don't mind hamsandwich. Untested.
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
const MaxPlayers = 32;
new InfectedClass[ MaxPlayers + 1 ];
new bool:g_bHunterAchieviment[ MaxPlayers + 1 ];
new bool:g_bFirstKill[ MaxPlayers + 1 ];
new g_HUDSyncObj;
public plugin_init()
{
RegisterHam( Ham_Spawn , "player" , "fwHamSpawn_Post" , 1 );
RegisterHam( Ham_Killed , "player" , "fwHamKilled" );
g_HUDSyncObj = CreateHudSyncObj();
}
public fwHamSpawn_Post( id )
{
g_bFirstKill[ id ] = true;
}
public fwHamKilled( iVictim , iKiller , iShouldGib )
{
if ( iVictim == iKiller )
return HAM_IGNORED;
/*If - killers first kill
- killer has not yet gotten achievement
- victim is not infected class ( == 0 )
- victim is a terrorist */
if( g_bFirstKill[ iKiller ] && !g_bHunterAchieviment[ iKiller ] && !InfectedClass[ iVictim ] && ( cs_get_user_team( iVictim ) == CS_TEAM_T ) )
{
set_hudmessage(255, 0, 0, -1.0, 0.55, 0, 0.0, 2.0, 2.0, 1.0, -1);
ShowSyncHudMsg( iKiller , g_HUDSyncObj , "[L4D]: You gained a hunter killer achievement!");
g_bHunterAchieviment[ iKiller ] = true;
}
g_bFirstKill[ iKiller ] = false;
return HAM_IGNORED;
}
__________________