View Single Post
wy19850
Member
Join Date: Feb 2020
Location: suzhou
Old 02-17-2020 , 12:26   Re: To help new plug-in
Reply With Quote #12

#include <amxmod>

new PLUGIN_NAME[] = "Headshot Sound"
new PLUGIN_AUTHOR[] = "Cheap_Suit"
new PLUGIN_VERSION[] = "1.2"

public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_event("DeathMsg", "Event_Death", "a")
}

public plugin_precache() {
precache_sound("misc/hpain3.wav")
}

public Event_Death()
{
new victim = read_data(2)

new victimTeam[16]
get_user_team(victim, victimTeam, 15)

new players[32], playerCnt
get_players(players, playerCnt, "ae", victimTeam)

for(new i = 0; i < playerCnt; i++) {
client_cmd(players[i], "spk misc/hpain3.wav")
}
}

Last edited by wy19850; 02-17-2020 at 12:27.
wy19850 is offline
Send a message via Skype™ to wy19850