Eklentinin source code dosyası ektedir.Böyle lüzumsuz paylaşımları hiç sevmiyorum 8 beğeni gelirse paylaşacağım yok 50 kişi indirirse paylaşacağım yok 10 kişi isterse paylaşacağım 3 kişi dilenirse paylaşacağım ya paylaş yada paylaşma arkadaşım.
PHP- Kodu:
#include <amxmodx>
#define PLUGIN "Low health breathe"
#define VERSION "1.0"
#define AUTHOR "balck"
new dmgcvar, lowdmgfade;
new bool:low_dmg[33] = false;
public plugin_precache() {
precache_sound("sound/breathe.wav");
}
public plugin_init(){
register_plugin(PLUGIN, VERSION, AUTHOR);
register_cvar("lowhealthbreathe", VERSION, FCVAR_SERVER|FCVAR_SPONLY);
dmgcvar = register_cvar("amx_low_dmg", "26");
lowdmgfade = register_cvar("amx_low_dmg_sfade", "1");
register_event("Damage", "event_damage", "be");
register_event("DeathMsg", "event_deathmsg", "a");
register_event("HLTV", "event_new_round", "a", "1=0", "2=0");
}
public event_damage(id){
if(!is_user_connected(id) || is_user_bot(id))
return PLUGIN_HANDLED;
if(get_user_health(id) < get_pcvar_num(dmgcvar)){
if(low_dmg[id] == true) {
return PLUGIN_HANDLED
} else {
set_task(1.6, "lowdmg", id, _, _, "b");
low_dmg[id] = true;
}
}
return PLUGIN_CONTINUE;
}
public event_deathmsg() {
new id = read_data(2);
if(!is_user_connected(id) || is_user_bot(id) || low_dmg[id] == false)
return PLUGIN_HANDLED;
remove_task(id);
low_dmg[id] = false;
return PLUGIN_CONTINUE;
}
public event_new_round() {
new pnum, id, players[32];
get_players(players, pnum, "c");
for(new i = 0; i < pnum; i++){
id = players[i];
if(is_user_connected(id) && low_dmg[id] == true){
remove_task(id);
low_dmg[id] = false;
}
}
}
public lowdmg(id) {
client_cmd(id, "spk sound/breathe");
if(get_pcvar_num(lowdmgfade)) {
message_begin(MSG_ONE, get_user_msgid("ScreenFade"), {0,0,0}, id)
write_short( 10<<12 ) // fade lasts this long duration
write_short( 10<<16 ) // fade lasts this long hold time
write_short( 1<<0 ) // fade type (in / out)
write_byte( 210 ) // fade red
write_byte( 0 ) // fade green
write_byte( 0 ) // fade blue
write_byte( 210 ) // fade alpha
message_end()
}
}