/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Headshot Sound Hud"
#define VERSION "1.0"
#define AUTHOR "speedkill"
new const muza[] = "misc/headshot2.wav"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg", "death", "a", "1>0")
}
public plugin_precache()
{
precache_sound(muza)
}
public death()
{
new Killer = read_data(1)
new Victim = read_data(2)
new Hs = read_data(3)
if(Killer != Victim && get_user_team(Killer) != get_user_team(Victim) && Hs)
{
client_cmd(Victim, "spk %s",muza);
client_cmd(Killer, "spk %s",muza);
set_hudmessage (000, 255, 000, -1.0, 0.2, 2, 0.02, 6.0, 0.01, 0.1, -1);
show_hudmessage(Killer, "HEADSHOT!");
set_hudmessage (255, 000, 000, -1.0, 0.2, 2, 0.02, 6.0, 0.01, 0.1, -1);
show_hudmessage(Victim, "HEADSHOT!");
}
}
Czy jest ktoś w stanie dopisać warunek że gdy headshot jest zadany z noża to odgrywa inny dźwięk, np. 'headshot3.wav'? Dźwięk ma być również słyszalny tylko dla ofiary i oprawcy, nie dla całego serwera.
Dodatkowo, podczas zabicia headshotem z noża chciałbym wyświetlić ikonkę statusu jako sprite, z tym raczej poradzę sobie sam ale jeżeli ktoś już by był w stanie napisać warunek na headshot nożem to mógł by dodać do gotowego kodu to:
stock Display_Icon(id, enable, name[], red, green, blue) {
if(is_user_connected(id)) {
message_begin(MSG_ONE, ikonka, {0,0,0}, id);
write_byte(enable);
write_string(name);
write_byte(red);
write_byte(green);
write_byte(blue);
message_end();
}
}
Oraz wyświetlić ikonkę podczas headshota z noża:
Display_Icon(id, 1, "dmg_poison", 0, 255, 0)
Z góry dziękuję za jakąkolwiek pomoc.
Użytkownik psilocybe edytował ten post 03.03.2012 18:21


Dodatki SourceMod



Temat jest zamknięty











