/* Plugin generated by AMXX-Studio */ #include #include #include #include #include #include #include #include #include #define POKAZ_STATUS 2895 #define MINIMUM_FALL_SPEED 300 #define MAXIMUM_DAMAGE_FROM_JUMP 70.0 #define DAMAGE 30.0 #define DELAY 0.2 new const nazwa[] = "Wiedźma Hogata(SuperPremium)"; new const opis[] = "Ma 25 nozy do rzucania, 25 skokow, nieslychac jego korkow, zabija po skoku na glowe,"; new const bronie = 1= get_user_health(Touched)){ zyje = false; } new origin[3]; get_user_origin(Touched,origin) origin[2] += 25 if(zyje == true){ if(get_user_team(Touched) == get_user_team(kid)) { new name[33] get_user_name(kid,name,32) client_print(0,print_chat,"%s attacked a teammate",name) } message_begin(MSG_BROADCAST,SVC_TEMPENTITY) write_byte(TE_BLOODSPRITE) write_coord(origin[0]) write_coord(origin[1]) write_coord(origin[2]) write_short(blood2) write_short(blood) write_byte(229) write_byte(25) message_end() set_user_health(Touched,get_user_health(Touched) - get_cvar_num("amx_knifedamage_mw2")); emit_sound(Touched, CHAN_ITEM, "player/headshot1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) cod_inflict_damage(Toucher, Touched, 100.0, 1.0, 0, 0) //cod_set_user_xp(kid, cod_get_user_xp(kid) + 100) } else { if(get_user_team(Touched) == get_user_team(kid)) { set_user_frags(kid, get_user_frags(kid) - 1) client_print(kid,print_center,"You killed a teammate") } else { set_user_frags(kid, get_user_frags(kid) + 1) cod_set_user_xp(kid, cod_get_user_xp(kid) + 10) } new gmsgScoreInfo = get_user_msgid("ScoreInfo") new gmsgDeathMsg = get_user_msgid("DeathMsg") message_begin(MSG_BROADCAST,SVC_TEMPENTITY) write_byte(TE_BLOODSPRITE) write_coord(origin[0]) write_coord(origin[1]) write_coord(origin[2]) write_short(blood2) write_short(blood) write_byte(229) write_byte(25) message_end() set_msg_block(gmsgDeathMsg,BLOCK_ONCE) set_msg_block(gmsgScoreInfo,BLOCK_ONCE) user_kill(Touched,1) message_begin(MSG_ALL,gmsgScoreInfo) write_byte(kid) write_short(get_user_frags(kid)) write_short(get_user_deaths(kid)) write_short(0) write_short(get_user_team(kid)) message_end() message_begin(MSG_ALL,gmsgScoreInfo) write_byte(Touched) write_short(get_user_frags(Touched)) write_short(get_user_deaths(Touched)) write_short(0) write_short(get_user_team(Touched)) message_end() message_begin(MSG_ALL,gmsgDeathMsg,{0,0,0},0) write_byte(kid) write_byte(Touched) write_byte(0) write_string("knife") message_end() emit_sound(Touched, CHAN_ITEM, "player/die1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) } //usuwam noz remove_entity(Toucher) } } public Punch_View(id, Float:ViewAngle[3]) { set_pev(id, pev_punchangle, ViewAngle) } public forward_touch(toucher, touched) // This function is called every time a player touches another player. { // NOTE: The toucher is the player standing/falling on top of the other (touched) player's head. if(!is_user_alive(toucher) || !is_user_alive(touched)) // The touching players can't be dead. return; if(!get_pcvar_num(amx_headsplash)) // If the plugin is disabled, stop messing with things. return; if(!ma_klase[toucher]) return; if(falling_speed[touched]) // Check if the touched player is falling. If he/she is, don't continue. return; if(get_user_team(toucher) == get_user_team(touched) && !get_cvar_num("mp_friendlyfire")) // If the touchers are in the same team and friendly fire is off, don't continue. return; new touched_origin[3], toucher_origin[3]; get_user_origin(touched, touched_origin); // Get the origins of the players so it's possible to check if the toucher is standing on the touched's head. get_user_origin(toucher, toucher_origin); new Float:toucher_minsize[3], Float:touched_minsize[3]; pev(toucher,pev_mins,toucher_minsize); pev(touched,pev_mins,touched_minsize); // If touche*_minsize is equal to -18.0, touche* is crouching. if(touched_minsize[2] != -18.0) // If the touched player IS NOT crouching, check if the toucher is on his/her head. { if(!(toucher_origin[2] == touched_origin[2]+72 && toucher_minsize[2] != -18.0) && !(toucher_origin[2] == touched_origin[2]+54 && toucher_minsize[2] == -18.0)) { return; } } else // If the touched player is crouching, check if the toucher is on his/her head { if(!(toucher_origin[2] == touched_origin[2]+68 && toucher_minsize[2] != -18.0) && !(toucher_origin[2] == touched_origin[2]+50 && toucher_minsize[2] == -18.0)) { return; } } if(falling_speed[toucher] >= MINIMUM_FALL_SPEED) // If the toucher is falling in the required speed or faster, then landing on top of the touched's head, do some damage to the touched. MUHAHAHAHAHA!!! { new Float:damage = ((falling_speed[toucher] - MINIMUM_FALL_SPEED + 30) * (falling_speed[toucher] - MINIMUM_FALL_SPEED + 30)) / 1300; if(damage > MAXIMUM_DAMAGE_FROM_JUMP) // Make shure that the touched player don't take too much damage. damage = MAXIMUM_DAMAGE_FROM_JUMP; damage_player(touched, toucher, damage); // Damage or kill the touched player. damage_after[toucher][touched] = 0.0; // Reset. } if(is_user_alive(touched) && damage_after[toucher][touched] damage) { new pwned_origin[3]; get_user_origin(pwned, pwned_origin); message_begin(MSG_BROADCAST, SVC_TEMPENTITY); // BLOOOOOOOOOOOD!! write_byte(TE_BLOODSPRITE); write_coord(pwned_origin[0]+8); write_coord(pwned_origin[1]); write_coord(pwned_origin[2]+26); write_short(blood2); write_short(blood); write_byte(248); write_byte(4); message_end(); new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "trigger_hurt")); if(!ent) return; new value[16]; float_to_str(damage * 2, value, sizeof value - 1); set_kvd(0, KV_ClassName, "trigger_hurt"); set_kvd(0, KV_KeyName, "dmg"); set_kvd(0, KV_Value, value); set_kvd(0, KV_fHandled, 0); dllfunc(DLLFunc_KeyValue, ent, 0); num_to_str(DMG_GENERIC, value, sizeof value - 1); set_kvd(0, KV_ClassName, "trigger_hurt"); set_kvd(0, KV_KeyName, "damagetype"); set_kvd(0, KV_Value, value); set_kvd(0, KV_fHandled, 0); dllfunc(DLLFunc_KeyValue, ent, 0); set_kvd(0, KV_ClassName, "trigger_hurt"); set_kvd(0, KV_KeyName, "origin"); set_kvd(0, KV_Value, "8192 8192 8192"); set_kvd(0, KV_fHandled, 0); dllfunc(DLLFunc_KeyValue, ent, 0); dllfunc(DLLFunc_Spawn, ent); set_pev(ent, pev_classname, "head_splash"); dllfunc(DLLFunc_Touch, ent, pwned); engfunc(EngFunc_RemoveEntity, ent); } else { new pwned_origin[3]; get_user_origin(pwned, pwned_origin); message_begin(MSG_BROADCAST, SVC_TEMPENTITY); // BLOOOOOOOOOOOD!! write_byte(TE_BLOODSPRITE); write_coord(pwned_origin[0]+8); write_coord(pwned_origin[1]); write_coord(pwned_origin[2]+26); write_short(blood2); write_short(blood); write_byte(248); write_byte(12); message_end(); set_pev(pwned, pev_frags, float(get_user_frags(pwned) + 1)); user_silentkill(pwned); make_deathmsg(pwnzor, pwned, 1, "his/her feet <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/smile.png' class='bbc_emoticon' alt=':)' />"); if(get_user_team(pwnzor) != get_user_team(pwned)) // If it was a team kill, the pwnzor's money should get reduced instead of increased. { set_pev(pwnzor, pev_frags, float(get_user_frags(pwnzor) + 1)); cs_set_user_money(pwnzor, cs_get_user_money(pwnzor) + 300); cod_set_user_xp(pwnzor, cod_get_user_xp(pwnzor) + 10) } else { set_pev(pwnzor, pev_frags, float(get_user_frags(pwnzor) - 1)); cs_set_user_money(pwnzor, cs_get_user_money(pwnzor) - 300); } message_begin(MSG_ALL, get_user_msgid("ScoreInfo")); // Fixes the scoreboard. write_byte(pwnzor); write_short(get_user_frags(pwnzor)); write_short(cs_get_user_deaths(pwnzor)); write_short(0); write_short(get_user_team(pwnzor)); message_end(); message_begin(MSG_ALL, get_user_msgid("ScoreInfo")); write_byte(pwned); write_short(get_user_frags(pwned)); write_short(cs_get_user_deaths(pwned)); write_short(0); write_short(get_user_team(pwned)); message_end(); set_pev(pwned, pev_frags, float(get_user_frags(pwned) - 1)); } } public death_event() { new kid = read_data(1) new id = read_data(2) if(g_isDying[id]) { g_isDying[id] = false remove_task(4247545+id) } if( kid != id && is_user_alive(kid) && ma_klase[id]) { cod_set_user_xp(kid, cod_get_user_xp(kid) + 30) } } public PlayerPreThink(id) { if(!ma_klase[id]) return PLUGIN_CONTINUE; new button = pev(id, pev_button); new oldbutton = pev(id, pev_oldbuttons); new flags = pev(id, pev_flags); if((button & IN_JUMP) && !(flags & FL_ONGROUND) && !(oldbutton & IN_JUMP) && skoki[id]) { skoki[id]25; new Float:velocity[3]; pev(id, pev_velocity, velocity); velocity[2] = random_float(265.0,285.0); set_pev(id, pev_velocity, velocity); } else if(flags & FL_ONGROUND) skoki[id] = 3; return PLUGIN_CONTINUE; }
Użytkownik RychuxD edytował ten post 03.04.2013 16:55