Raised This Month: $32 Target: $400
 8% 

Help with plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PeterVicent
New Member
Join Date: Aug 2019
Old 08-23-2019 , 07:41   Help with plugin
Reply With Quote #1

Hello, I need some help with a line of code, I would like to make a plugin that when a specific player dies, a specific sound plays. Like a quake sounds, but with STEAMID. Steamid to identify the player who died.

It would be possible?

Thanks, sorry for my bad english.
PeterVicent is offline
LearninG
Senior Member
Join Date: Apr 2019
Location: Iran
Old 08-23-2019 , 07:46   Re: Help with plugin
Reply With Quote #2

Hello ,
print the dead player steamid in chat ?


EDIT :

PHP Code:
#include <amxmodx>

new const MESSAGE[]= "[AMXX] Client %s has just died." // %s is client steamid


// Put players steamid here
new g_steamid[][]=
{
    
"STEAM_0:0:261810342" // My steamid for example

}

// Your sounds (will be played randomly)
new g_sounds[][] =
{
    
"sound.wav",
    
"sound2.wav",
    
"sound3.wav",
    
"sound4.wav",
    
"sound5.wav"
}

public 
plugin_precache()
{
    for (new 
ii<sizeof(g_sounds); i++)
    
precache_sound(g_sounds[i])
}

public 
plugin_init()
{
    
register_plugin"Quake sounds + Steamid""0.01""LearninG" )

    
register_event("DeathMsg""Player_Die""a""2>0")
}

public 
Player_Die()
{
    static 
iVictim szAuthid[32]
    
iVictim read_data(2)
    
get_user_authid(iVictim szAuthid charsmax(szAuthid))

    for (new 
ii<sizeof(g_steamid); i++)
    if (
equali(szAuthid g_steamid[i]))

    
client_print(print_chat MESSAGE szAuthid)
    
emit_sound(0CHAN_AUTOg_sounds[random(sizeof(g_sounds))], 1.0ATTN_NORM0PITCH_NORM)


Last edited by LearninG; 08-23-2019 at 09:05.
LearninG is offline
PeterVicent
New Member
Join Date: Aug 2019
Old 08-23-2019 , 09:10   Re: Help with plugin
Reply With Quote #3

Quote:
Originally Posted by LearninG View Post
Hello ,
print the dead player steamid in chat ?


EDIT :

PHP Code:
#include <amxmodx>

new const MESSAGE[]= "[AMXX] Client %s has just died." // %s is client steamid


// Put players steamid here
new g_steamid[][]=
{
    
"STEAM_0:0:261810342" // My steamid for example

}

// Your sounds (will be played randomly)
new g_sounds[][] =
{
    
"sound.wav",
    
"sound2.wav",
    
"sound3.wav",
    
"sound4.wav",
    
"sound5.wav"
}

public 
plugin_precache()
{
    for (new 
ii<sizeof(g_sounds); i++)
    
precache_sound(g_sounds[i])
}

public 
plugin_init()
{
    
register_plugin"Quake sounds + Steamid""0.01""LearninG" )

    
register_event("DeathMsg""Player_Die""a""2>0")
}

public 
Player_Die()
{
    static 
iVictim szAuthid[32]
    
iVictim read_data(2)
    
get_user_authid(iVictim szAuthid charsmax(szAuthid))

    for (new 
ii<sizeof(g_steamid); i++)
    if (
equali(szAuthid g_steamid[i]))

    
client_print(print_chat MESSAGE szAuthid)
    
emit_sound(0CHAN_AUTOg_sounds[random(sizeof(g_sounds))], 1.0ATTN_NORM0PITCH_NORM)

Thanks for reply!

This plugin show me the steamid from player dead? I want when the player with the steam id I put dies (the specific player I put in the plugin) a sound played. It can be by name too.

To make a joke with a friend of mine.

Thanks again!
PeterVicent is offline
LearninG
Senior Member
Join Date: Apr 2019
Location: Iran
Old 08-23-2019 , 09:22   Re: Help with plugin
Reply With Quote #4

Quote:
Originally Posted by PeterVicent View Post
Thanks for reply!

This plugin show me the steamid from player dead?
removed.


added nick support :
PHP Code:
#include <amxmodx>

// Put players steamid here
new g_steamid[][]=
{
    
"STEAM_0:0:261810342"
}

// Put players name here
new g_name[][]=
{
    
"LearninG"
}

// Your sound (will be played randomly)
new g_sounds[][] =
{
    
"sound.wav",
    
"sound2.wav",
    
"sound3.wav",
    
"sound4.wav",
    
"sound5.wav"
}

public 
plugin_precache()
{
    for (new 
ii<sizeof(g_sounds); i++)
    
precache_sound(g_sounds[i])
}

public 
plugin_init()
{
    
register_plugin"Quake sound + Steamid""0.01""LearninG" )

    
register_event("DeathMsg""Player_Die""a""2>0")
}

public 
Player_Die(iVictim)
{
    static 
iVictim szAuthid[32] , szName[32]
    
iVictim read_data(2)
    
get_user_authid(iVictim szAuthid charsmax(szAuthid))
    
get_user_name(iVictim szName charsmax(szName))

    for (new 
ii<sizeof(g_steamid) && i<sizeof(g_name); i++)
    if (
equali(szAuthid g_steamid[i]))
    {
        
emit_sound(iVictimCHAN_AUTOg_sounds[random(sizeof(g_sounds))], 1.0ATTN_NORM0PITCH_NORM)
    }
    else if (
equali(szName g_name[i]))
    {
        
emit_sound(iVictimCHAN_AUTOg_sounds[random(sizeof(g_sounds))], 1.0ATTN_NORM0PITCH_NORM)

    }

LearninG is offline
PeterVicent
New Member
Join Date: Aug 2019
Old 08-23-2019 , 09:26   Re: Help with plugin
Reply With Quote #5

Quote:
Originally Posted by LearninG View Post
removed.


added nick support :
PHP Code:
#include <amxmodx>

// Put players steamid here
new g_steamid[][]=
{
    
"STEAM_0:0:261810342"
}

// Put players name here
new g_name[][]=
{
    
"LearninG"
}

// Your sound (will be played randomly)
new g_sounds[][] =
{
    
"sound.wav",
    
"sound2.wav",
    
"sound3.wav",
    
"sound4.wav",
    
"sound5.wav"
}

public 
plugin_precache()
{
    for (new 
ii<sizeof(g_sounds); i++)
    
precache_sound(g_sounds[i])
}

public 
plugin_init()
{
    
register_plugin"Quake sound + Steamid""0.01""LearninG" )

    
register_event("DeathMsg""Player_Die""a""2>0")
}

public 
Player_Die(iVictim)
{
    static 
iVictim szAuthid[32] , szName[32]
    
iVictim read_data(2)
    
get_user_authid(iVictim szAuthid charsmax(szAuthid))
    
get_user_name(iVictim szName charsmax(szName))

    for (new 
ii<sizeof(g_steamid) && i<sizeof(g_name); i++)
    if (
equali(szAuthid g_steamid[i]))
    {
        
emit_sound(iVictimCHAN_AUTOg_sounds[random(sizeof(g_sounds))], 1.0ATTN_NORM0PITCH_NORM)
    }
    else if (
equali(szName g_name[i]))
    {
        
emit_sound(iVictimCHAN_AUTOg_sounds[random(sizeof(g_sounds))], 1.0ATTN_NORM0PITCH_NORM)

    }

You are a God my friend!

Thank you so much, I will test. You saved me!
PeterVicent is offline
Reply


Thread Tools
Display Modes

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:30.


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