Raised This Month: $ Target: $400
 0% 

[HELP] Ultimate Sound modification


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 08-20-2013 , 12:16   Re: [HELP] Ultimate Sound modification
Reply With Quote #7

Sorry for overdoing it...
Code:
#include <amxmodx> #define PLUGIN_NAME "Ultimate Sounds Advanced" #define PLUGIN_VERSION "0.1" #define PLUGIN_AUTHOR "SAMURAI" new g_kills[33]; new g_deaths[33]; new bool:g_sound_enabled[33]; new g_pcvar_flags; enum enum_information {     kills,     message[64],     sound[64] } new const g_information[][enum_information] = {     { 3,    "%s: Triple Kill !",    "ultimate_sounds/triplekill_ultimate" },     { 4,    "%s: Multi Kill !", "ultimate_sounds/multikill_ultimate" },     { 6,    "%s: Ultra Kill !", "ultimate_sounds/ultrakill_ultimate" },     { 8,    "%s: Killing Spree !""ultimate_sounds/killingspree_ultimate" },     { 10,   "%s: Mega Kill !""ultimate_sounds/megakill_ultimate" },     { 12,   "%s: Holy Shit !""ultimate_sounds/holyshit_ultimate" },     { 14,   "%s: Ludicrous Kill !", "ultimate_sounds/ludicrouskill_ultimate" },     { 15,   "%s: Rampage !",        "ultimate_sounds/rampage_ultimate" },     { 16,   "%s: Unstoppable !",    "ultimate_sounds/unstoppable_ultimate" },     { 18,   "%s: M o n s t e R  K i L L ! ! !", "ultimate_sounds/monsterkill_ultimate" } }; public plugin_init() {     register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);         g_pcvar_flags = register_cvar("ultimate_sounds_advanced", "ab");         register_event("ResetHUD", "reset_hud", "b");     register_event("DeathMsg", "death_event", "a");         register_clcmd("say /play", "enable_sound");     register_clcmd("say /stop", "disable_sound"); } public enable_sound(id)     g_sound_enabled[id] = true;     public disable_sound(id)     g_sound_enabled[id] = false; public client_connect(id) {     g_kills[id] = 0;     g_deaths[id] = 0;     g_sound_enabled[id] = true; } public plugin_precache() {     for ( new i = 0 ; i < sizeof g_information ; i++ )         precache_sound(g_information[i][sound]); } plugin_mode() {     new mode[9];     get_pcvar_string(g_pcvar_flags, mode, charsmax(mode));     return read_flags(mode); } public death_event() {         new killer = read_data(1);     new victim = read_data(2);         if ( is_user_connected(victim) ) {         g_kills[victim] = 0;         g_deaths[victim]++;     }         if ( ! is_user_connected(killer) )         return;         g_kills[killer]++;     g_deaths[killer] = 0;     for ( new i = 0 ; i < sizeof g_information ; i++ ) {         if ( g_kills[killer] == g_information[i][kills]) {             announce(killer, i);             break;         }     }     return; } announce(killer, level) {         new name[33];     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);         new mode = plugin_mode();         if ( mode & 2 )         show_hudmessage(0, g_information[level][message], name);         else if ( mode & 8 )         show_hudmessage(killer, g_information[level][message], name);         if ( mode & 1 ) {         new players[32], iplayers;         get_players(players, iplayers, "ch");                 for ( new i = 0 ; i < iplayers ; i++ ) {             if ( g_sound_enabled[players[i]] )                 client_cmd(players[i], "spk %s", g_information[level][sound]);         }     }         else if ( mode & 4 )         client_cmd(killer, "spk %s", g_information[level][sound]); } public reset_hud(id) {     if ( ! ( plugin_mode() & 16 ) )         return;         if ( g_kills[id] > g_information[0][kills] )         client_print(id, print_chat, "* You are on a killstreak with %d kills.", g_kills[id]);             else if ( g_deaths[id] > 1 )         client_print(id, print_chat, "* Take care, you are on a deathstreak with %d deaths in a row.", g_deaths[id]); }
__________________

Last edited by Black Rose; 08-20-2013 at 13:59.
Black Rose is offline
 



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 15:44.


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