#define USING_AMX 0 // 1 = Using AMX \ 0 = Using AMXX #if USING_AMX #include #include #else #include #include #include #include #endif new gMsgDeathMsg new gCurrentNade public plugin_init() { // Plugin Info register_plugin("Grenades Are Heavy", "1.0", "AssKicR") register_event("RoundTime", "newRound", "bc") register_cvar("amx_heimpactdmg","5") register_cvar("amx_fbimpactdmg","5") register_cvar("amx_sgimpactdmg","5") register_cvar("amx_obeyff", "1") gMsgDeathMsg = get_user_msgid("DeathMsg") } public newRound() { new Float:roundtime = get_cvar_float("mp_roundtime") * 60.0 new rtime = read_data(1) if(roundtime == rtime) { gCurrentNade=0 } } public pfn_touch(ptr, ptd) { if (ptd!=0 && ptr!=0) { new ptrname[32], ptdname[32], ptrModel[32] entity_get_string(ptr, EV_SZ_classname, ptrname, 31) entity_get_string(ptd, EV_SZ_classname, ptdname, 31) if(equal(ptrname, "grenade") && equal(ptdname, "player")) { if (gCurrentNade==ptr) return gCurrentNade=ptr new ptrOwner = entity_get_edict(ptr, EV_ENT_owner) new bool:HitFriend=false new ObeyFF = get_cvar_num("amx_obeyff") ? 1:0 new FFOn = get_cvar_num("mp_friendlyfire") ? 1:0 if(!FFOn && ObeyFF) { if(get_user_team(ptd) == get_user_team(ptrOwner)) { HitFriend=true } } if(!HitFriend) { entity_get_string(ptr, EV_SZ_model, ptrModel, 31) //client_print(0, 3, "Grenade with model ^"%s^" has hit a player",ptrModel) //This is for debugging if (equali(ptrModel,"models/w_hegrenade.mdl")) { emit_sound(ptr, CHAN_ITEM, "weapons/ric_metal-1.wav", 0.7, ATTN_NORM, 0, PITCH_NORM) emit_sound(ptd, CHAN_BODY, "player/bhit_flesh-1.wav", 0.7, ATTN_NORM, 0, PITCH_NORM) ImpactDamage(ptd,ptr) ScreenShake(ptd, 14, 14, 14 ) ScreenFlash(ptd, 255, 0, 0, 1, 200 ) HazedView(ptd, 120 ) ExtraDamage(ptd, ptrOwner, get_cvar_num("amx_heimpactdmg"), "grenade" ) }else if (equali(ptrModel,"models/w_flashbang.mdl")) { emit_sound(ptr, CHAN_ITEM, "weapons/ric_metal-1.wav", 0.7, ATTN_NORM, 0, PITCH_NORM) emit_sound(ptd, CHAN_BODY, "player/bhit_flesh-1.wav", 0.7, ATTN_NORM, 0, PITCH_NORM) ImpactDamage(ptd,ptr) ScreenShake(ptd, 14, 14, 14 ) ScreenFlash(ptd, 255, 0, 0, 1, 200 ) HazedView(ptd, 120 ) ExtraDamage(ptd, ptrOwner, get_cvar_num("amx_fbimpactdmg"), "flashbang" ) }else if (equali(ptrModel,"models/w_smokegrenade.mdl")) { emit_sound(ptr, CHAN_ITEM, "weapons/ric_metal-1.wav", 0.7, ATTN_NORM, 0, PITCH_NORM) emit_sound(ptd, CHAN_BODY, "player/bhit_flesh-1.wav", 0.7, ATTN_NORM, 0, PITCH_NORM) ImpactDamage(ptd,ptr) ScreenShake(ptd, 14, 14, 14 ) ScreenFlash(ptd, 255, 0, 0, 1, 200 ) HazedView(ptd, 120 ) ExtraDamage(ptd, ptrOwner, get_cvar_num("amx_sgimpactdmg"), "smokegrenade" ) } } } } } public ExtraDamage(id, attacker, damage, weaponDescription[] ) { if ( is_user_alive(id) ) { new userHealth=get_user_health(id) set_msg_block(gMsgDeathMsg, BLOCK_SET) set_user_health(id, userHealth - damage ) set_msg_block(gMsgDeathMsg, BLOCK_NOT) if ( userHealth - damage <= 0 ) { logKill(attacker,id, weaponDescription) if ( get_user_team(id) != get_user_team(attacker) ) { // The person dying shouldn't get negative credit for this kill (so add it back) set_user_frags( id, get_user_frags(id) + 1 ) // The killing should get credit for the frag set_user_frags( attacker, get_user_frags(attacker)+ 1 ) MoneyEvent(attacker,300,1) } else { // The person dying shouldn't get negative credit for this kill (so add it back) set_user_frags( id, get_user_frags(id)+ 1 ) // The killer killed a teammember or self // Engine gives credit for the kill so let's take away that + 1 set_user_frags( attacker, get_user_frags(attacker) - 2) MoneyEvent(attacker,150,0) } message_begin( MSG_BROADCAST, get_user_msgid("DeathMsg"),{0,0,0},0) write_byte(attacker) write_byte(id) write_byte(0) write_string(weaponDescription) message_end() } } } #if USING_AMX stock cs_get_user_money(index) return get_user_money(index) stock cs_set_user_money(index, money, flash = 1) set_user_money(index, money, flash) #endif public MoneyEvent(id,money,plus) { new HasMoney HasMoney = cs_get_user_money(id) if (plus) { if (HasMoney < 16000) { if (HasMoney+money > 16000) { cs_set_user_money(id,16000) }else{ cs_set_user_money(id,HasMoney+money) } } }else{ if (HasMoney > 0 ) { if (HasMoney-money < 0) { cs_set_user_money(id,0) }else{ cs_set_user_money(id,HasMoney-money) } } } } public logKill(id, victim, weaponDescription[] ) { //Save Hummiliation new namea[24],namev[24],authida[20],authidv[20],teama[8],teamv[8] //Info On Attacker get_user_name(id,namea,23) get_user_team(id,teama,7) get_user_authid(id,authida,19) //Info On Victim get_user_name(victim,namev,23) get_user_team(victim,teamv,7) get_user_authid(victim,authidv,19) //Log This Kill log_message("^"%s<%d><%s><%s>^" killed ^"%s<%d><%s><%s>^" with ^"%s^"", namea,get_user_userid(id),authida,teama,namev,get_user_userid(victim),authidv,teamv, weaponDescription ) } public ScreenShake(id, amplitude, duration, frequency ) { if ( !is_user_alive(id) ) return message_begin(MSG_ONE, get_user_msgid("ScreenShake"),{0,0,0},id) write_short( 1<