Raised This Month: $ Target: $400
 0% 

Headshot? GrenadeKill? MeleeKill?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
DataMatrix
Senior Member
Join Date: Aug 2005
Location: UK, Liverpool
Old 08-25-2005 , 12:14  
Reply With Quote #3

Fully working now, here is the fixed code if anyone wants to see what was changed
Code:
#include <amxmodx> #include <amxmisc> #include <tsconst> #include <tsx> #define LEVELS 9 public plugin_init() {     register_plugin("UT Killing Spree", "0.9.2", "Duca")     register_cvar("ut_streak_mode", "abe")     register_event("ResetHUD", "reset_hud", "b")     register_event("DeathMsg", "death_event", "a")     return PLUGIN_CONTINUE } new kills[33] = {0,...}; new deaths[33] = {0,...}; new g_Killers[33][4] //new Float:g_DeathStats[33] new levels[9] = {2, 3, 4, 5, 8, 9, 10, 11, 12} new sounds[9][] = {     "misc/doublekill",     "misc/multikill",     "misc/ultrakill",     "misc/monsterkill",     "misc/killingspree",     "misc/rampage",     "misc/dominating",     "misc/unstoppable",     "misc/godlike" } new messages[9][] = {     "%s: DOUBLE-KILL!!!",     "%s: MULTI-KILL!!!",     "%s: ULTRA-KILL!!!",     "%s: MONSTER-KILL!!!",     "%s IS ON A KILLING SPREE!!!",     "%s IS ON A RAMPAGE!!!",     "%s IS DOMINATING!!!",     "%s IS UNSTOPPABLE!!!",     "%s IS GODLIKE!!!" } new g_MeleeMsg[2][] = {     "%s owned %s with a swift melee attack",     "%s humiliated %s without bullets!" } new g_HeMessages[4][] = {     "%s blown %s into smithereens",     "%s lobbed a grenade into %s's pocket",     "%s wrapped a very special present for %s",     "%s made %s go boom!" } new g_SHeMessages[5][] = {     "%s blown himself into smithereens",     "%s trys the effect of a grenade",     "%s ate the grenade thinking it was an apple",     "%s held the grenade for too long",     "%s forgot he pulled the pin" } new g_HeadShots[7][] = {     "$kn killed $vn with a well^nplaced shot to the head!",     "$kn removed $vn's^nhead with the $wn",     "$kn turned $vn's head^ninto pudding with the $wn",     "$vn got pwned by $kn",     "$vn's head has been^nturned into red jelly",     "$kn has superb aim with the $wn,^nas $vn well knows.",     "$vn's head stayed in $kn's^ncrosshairs a bit too long..." }     public is_mode_set(bits) {     new mode[9]     get_cvar_string("ut_streak_mode", mode, 8)     return read_flags(mode) & bits } public death_event(id) {     new killer = read_data(1)     new victim = read_data(2)     kills[killer] += 1     kills[victim] = 0     deaths[killer] = 0     deaths[victim] += 1     for (new i = 0; i < LEVELS; i++) {         if (kills[killer] == levels[i]) {             announce(killer, i)             return PLUGIN_CONTINUE         }     }     return PLUGIN_CONTINUE } public announce(killer,level) {     new hostname[32],name[33]     get_cvar_string("hostname",hostname,31)     get_user_name(killer,name,32)     set_hudmessage(0, 100, 200, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, 2)         if (is_mode_set(2)) {         if (!equal(name,hostname)) {             show_hudmessage(0, messages[level], name)         } else {             show_hudmessage(0, "")         }     } else if (is_mode_set(8)) {         if (!equal(name,hostname)) {             show_hudmessage(killer, messages[level], name)         } else {             show_hudmessage(0, "")         }     }     if (is_mode_set(1)) {         if (!equal(name,hostname)) {             client_cmd(0, "spk %s", sounds[level])         } else {             client_cmd(0, "")         }     } else if (is_mode_set(4)) {         if (!equal(name,hostname)) {             client_cmd(killer, "spk %s", sounds[level])         } else {             client_cmd(0, "")         }     } } public reset_hud(id) {     if (is_mode_set(16)) {         if (kills[id] > levels[0]) {             client_print(id, print_chat,"* You are on a killstreak with %d kills.",kills[id])         } else if (deaths[id] > 1) {             client_print(id, print_chat,"* Take care, you are on a deathstreak with %d deaths in a row.",deaths[id])         }     } } public client_connect(id) {     kills[id] = 0     deaths[id] = 0 } public eResetHud(id) {     g_Killers[id][0] = 0 } public client_death(killer,victim,wpnindex,hitplace,TK) {     new killer_name[32]     get_user_name(killer,killer_name,31)     new grenade = (wpnindex == TSW_M61GRENADE) ? 1:0     new headshot = (hitplace == HIT_HEAD) ? 1:0     new selfKill = (killer == victim) ? 1:0     new victim_name[32]     get_user_name(victim,victim_name,31)     if (selfKill && grenade) {         set_hudmessage(255, 100, 100, -1.0, 0.15, 1, 6.0, 6.0, 0.5, 0.15, 1)         show_hudmessage(0,g_SHeMessages[random_num(0,4)],victim_name)     }     if (selfKill || TK)     return PLUGIN_CONTINUE     new vorigin[3], korigin[3]     get_user_origin(victim,vorigin)     get_user_origin(killer,korigin)     g_Killers[victim][0] = killer     if (xmod_is_melee_wpn(wpnindex)) {         set_hudmessage(255, 100, 100, -1.0, 0.15, 1, 6.0, 6.0, 0.5, 0.15, 1)         for (new i=1;i<=get_maxplayers();i++) {             //if (g_Killers[i][0] && g_DeathStats[i] > get_gametime()) continue             show_hudmessage(i,g_MeleeMsg[random_num(0,1)],killer_name,victim_name)           }         client_cmd(0,"spk misc/humiliation")     } else if (grenade) {         set_hudmessage(255, 100, 100, -1.0, 0.15, 1, 6.0, 6.0, 0.5, 0.15, 1)         for (new i=1;i<=get_maxplayers();i++) {             //if (g_Killers[i][0] && g_DeathStats[i] > get_gametime()) continue             show_hudmessage(i,g_HeMessages[random_num(0,3)],killer_name,victim_name)         }         client_cmd(0,"spk misc/humiliation")     }     if (headshot && !xmod_is_melee_wpn(wpnindex)) {         new weapon[32], message[128]         xmod_get_wpnname(wpnindex,weapon,31)         copy(message, 127, g_HeadShots[random_num(0,6)])         replace(message, 127 , "$vn", victim_name)         replace(message, 127 , "$wn", weapon)         replace(message, 127 , "$kn", killer_name)         set_hudmessage(100, 100, 255, -1.0, 0.19, 0, 6.0, 6.0, 0.5, 0.15, 1)         for (new i=1;i<=get_maxplayers();i++) {             //if (g_Killers[i][0] && g_DeathStats[i] > get_gametime()) continue             show_hudmessage(i,message)         }         client_cmd(0,"spk misc/headshot")     }     return PLUGIN_CONTINUE }
DataMatrix is offline
Send a message via MSN to DataMatrix
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:26.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode