View Single Post
Author Message
allroundernaman
Member
Join Date: May 2020
Location: Somewhere Virtual
Old 06-27-2020 , 04:00   Knife Kill Bonus Plugin
Reply With Quote #1

Hi guys!

I have got this plugin from somewhere what I exactly don't remember.
This is a knife kill bonus plugin.

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <colorchat>
#include <fun>

#define PLUGIN "Knife Kill Bonus"
#define VERSION "1.1"
#define AUTHOR "Unknown"
#define CustomSound "sound/knifekill.mp3"

const TASK_ID 700

const Float:FAST_SPEED 480.0 //Your speed bonus

new const g_szSound[] = "knifekill.mp3"

new g_iSync
new bool:g_bHasSpeed[75]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("DeathMsg""onDeathMsgEvent""a")
    
register_event("CurWeapon""onCurWeaponEvent""be""1=1")
    
    
g_iSync CreateHudSyncObj()
}

public 
plugin_precache()
    
precache_sound(g_szSound)

public 
onDeathMsgEvent()
{
    new 
id read_data(1)
    
    new 
szWeapon[32]
    
read_data(4szWeaponcharsmax(szWeapon))
    
    if(
equal(szWeapon"knife") && is_user_alive(id))
    {
        new 
szName[32], szName2[32]
        
get_user_name(idszNamecharsmax(szName))
        
get_user_name(read_data(2), szName2charsmax(szName2))
        
        
set_hudmessage(255000.020.210.16.00.10.1, -1)
       
ColorChat(idprint_chat"^4[AMXX] Knife ^3%s ^4knived ^3%s ^4and got^3 10HP + 15 Sec Speed "szNameszName2)
        
set_hudmessage(255000.020.210.16.00.10.1, -1)
        
ShowSyncHudMsg(0g_iSync"Player %s knifed %s Hahahaha"szNameszName2)
        
    
/*client_cmd(id, "mp3 play %s", g_szSound)*/
    //client_cmd(id, "mp3 play %s", CustomSound)
client_cmd(0,"spk knifekill.mp3")
        
        
set_user_health(idget_user_healthid ) + 10 )
        
        
g_bHasSpeed[id] = true
        remove_task
(id TASK_ID)
        
set_task(15.0"taskRemoveSpeed"id TASK_ID)
        
set_user_maxspeed(idFAST_SPEED)
        
set_user_fragsidget_user_fragsid ) + )
    }
}

public 
onCurWeaponEvent(id)
    if(
g_bHasSpeed[id])
        
set_user_maxspeed(idFAST_SPEED)

public 
taskRemoveSpeed(id)
{
    
id -= TASK_ID
    g_bHasSpeed
[id] = false
    set_user_maxspeed
(id260.0)

I have some question about this plugin. First of all, this plugin makes sound in local system only. I want that if someone knife someone, sound must be for everyone even dead or alive in the server.

And the last thing I want it to choose a random song from my list of songs on each knife kill.

Thank you, this time I want to do it myself, so please guide me how can I do it.
__________________
SELLING COUNTER STRIKE SERVERS!! [email protected]

Website: https://namanvrati.cf/
Cheap Rates/ Renting also available.
Introducing myself: This is Naman Vrati, call me NamVr! I am a web developer and Counter Strike Server Manager, I own a server.

Piano Is My Life
allroundernaman is offline