PHP Code:
public plugin_precache()
{
precache_sound("misc/bonusxp.wav");
}
public EventDeathMsg()
{
new killer = read_data(1);
new victim = read_data(2);
if( (g_first_client <= killer <= g_max_clients) && victim != killer )
{
if( IsUserAuthorized(killer) )
{
// regular kill
new xp = get_pcvar_num(cvar_xp_kill);
g_xp[killer] += xp;
set_hudmessage(255, 255, 255, -1.0, -0.7, 0, 6.0, 4.0);
show_hudmessage(killer, "+100", MESSAGE_TAG, xp);
emit_sound(killer, "misc/bonusxp.wav");
Save(killer);
}
}
else if( IsUserAuthorized(victim) )
{
// victim died of map causes or killed self
new xp = get_pcvar_num(cvar_xp_suicide);
g_xp[victim] -= xp;
ColorChat(victim, GREY, "^x04%s^x03 You lost^x04 %i XP^x03 for suicide!", MESSAGE_TAG, xp);
Save(victim);
}
}
This is not the full code because the plugin is private, i need help with playing the sound it wont play the error is: argument mismatch 2