PHP Code:
new g_iMaxPlayers
{
// [...]
register_event("DeathMsg", "eDeath", "a", "1>0")
// [...]
g_iMaxplayers = get_maxplayers()
// [...]
}
// [...]
public eDeath() {
new killer = read_data(1)
if( killer > g_iMaxPlayers )
{
return
}
new iWeapon = get_user_weapon(killer)
Btw, your usage of 'switch' in completely not appropriated, check directly value, for example instead of :
PHP Code:
switch(iAchLevel[read_data(2)][DIES]) {
case 500: {
TotalAchievements[read_data(2)]++
ColorChat(read_data(2), GREEN, "[SWE-KUNG]^1 Congratulations! You have unlocked the achievement:^3 Anti-GodMode!")
emit_sound(read_data(2), CHAN_STATIC, szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
}
->
PHP Code:
if(iAchLevel[read_data(2)][DIES] == 500) {
TotalAchievements[read_data(2)]++
ColorChat(read_data(2), GREEN, "[SWE-KUNG]^1 Congratulations! You have unlocked the achievement:^3 Anti-GodMode!")
emit_sound(read_data(2), CHAN_STATIC, szAchievementSound, 1.0, ATTN_NORM, 0, PITCH_NORM)
}
Also, do never use read_data(2) more than 1 time, it won't change, do :
new victim = read_data(2), and then use victim in the rest of the function.
__________________