Quote:
Originally Posted by Alucard^
Good but the id in the public of the DeathMsg is useless. The DeathMsg is a global event.
|
then how to do it without DeathMsg
Last version
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
#define prpsounds 2
new preplist[prpsounds][]=
{
"server/stayinalive",
"server/force"
}
public plugin_init() {
register_plugin( "x-","x","x" )
register_event( "DeathMsg", "Event_Death", "a" )
}
public Event_Death(id) {
//======== •Random colors
new r = random(256)
new g = random(256)
new b = random(256)
//======== •Last player
new players_ct[32], players_t[32], ict, ite;
get_players(players_ct,ict,"ae","CT")
get_players(players_t,ict,"ae","TERRORIST")
//======== •Get players
new name1[32], name2[32]
get_user_name(players_ct[0],name1,32)
get_user_name(players_t[0],name2,32)
//======== •Random Sounds
new q
q = random_num(0,prpsounds-1)
//======== •Begin
if( ite == 1 ) {
client_cmd(0,"spk %s",preplist[q]);
set_hudmessage(r,g,b, -1.0, 0.30, 0, 6.0, 6.0)
show_hudmessage(0, "%s is alone :)", name1)
} else if( ict == 1 ) {
client_cmd(0,"spk %s",preplist[q]);
set_hudmessage(r,g,b, -1.0, 0.30, 0, 6.0, 6.0)
show_hudmessage(0, "%s is alone :)", name2)
}
//======== •End
}
public plugin_precache() {
precache_sound("server/stayinalive.wav")
precache_sound("server/force.wav")
return PLUGIN_CONTINUE
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1026\\ f0\\ fs16 \n\\ par }
*/