Raised This Month: $ Target: $400
 0% 

DeathMsg is running more than once?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Leon M.
Senior Member
Join Date: Apr 2009
Location: Germany
Old 05-12-2010 , 15:40   Re: DeathMsg is running more than once?
Reply With Quote #1

Yeah, and the counters won't increased.
Leon M. is offline
Leon M.
Senior Member
Join Date: Apr 2009
Location: Germany
Old 05-16-2010 , 09:23   Re: DeathMsg is running more than once?
Reply With Quote #2

Hi, I did not need to start a new thread. I only have a short question about the use of trie. Can someone show me examples about using of the celltrie.inc?

I must create and set a trie, and I must delete some informations!

Many Thanks in advance
Leon
Leon M. is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-16-2010 , 09:59   Re: DeathMsg is running more than once?
Reply With Quote #3

Since you are using csx, you could use forward client_death as well, so you directly get weapon index, and team attack.


Anyway here it is :

PHP Code:
#include <amxmodx>
#include <csx>

new Trie:g_tPistolsShortNames

public plugin_init()
{
//    register_plugin(PLUGIN, VERSION, AUTHOR)

    
register_event("DeathMsg""Event_DeathMsg""a""1<0")
    
// register_event("TextMsg", "Event_TextMsg_Restart", "a", "2&#Game_C", "2&#Game_w")
    // register_logevent("LogEvent_Round_Start", 2, "1=Round_Start")

    
g_tPistolsShortNames TrieCreate()

    
// set any value, later we only gonna check if the string key exists in this try
    
TrieSetCell(g_tPistolsShortNames"p228"CSW_P228)
    
TrieSetCell(g_tPistolsShortNames"usp"CSW_USP)
    
TrieSetCell(g_tPistolsShortNames"glock18"CSW_GLOCK18)
    
TrieSetCell(g_tPistolsShortNames"fiveseven"CSW_FIVESEVEN)
    
TrieSetCell(g_tPistolsShortNames"elites"CSW_ELITE)
    
TrieSetCell(g_tPistolsShortNames"deagle"CSW_DEAGLE)
}

public 
plugin_end()
{
    
TrieDestroy(g_tPistolsShortNames)
}

public 
client_damage(iAttackeriVictimiDamageiWeaponiHitplaceTA)
{
    if (
iAttacker && iVictim)
    {
        
g_iHits[iAttacker][iVictim]++
    }
}

public 
Event_DeathMsg()
{
    new 
iKiller read_data(1)
    new 
iVictim read_data(2)

    
g_iPistolKills[iVictim] = 0
    g_iKnifeKills
[iVictim] = 0

    
if(iKiller == iVictim)
    {
        return
    }

    if (
get_user_team(iKiller) != get_user_team(iVictim)){
    {
        new 
szWeapon[10]
        
read_data(4szWeaponcharsmax(szWeapon))
        if ( 
IsWeaponPistol(szWeapon) )
        {
            
g_iPistolKills[iKiller]++
        }
        else if(
equal(szWeapon"knife"))
        {
            
g_iKnifeKills[iKiller]++
        }
    }
}

IsWeaponPistol(const szWeaponShortName[])
{
    return 
TrieKeyExists(g_tPistolsShortNamesszWeaponShortName)
}

// not used
stock GetWeaponIndex(const szWeaponShortName[])
{
    new 
iId
    
if( TrieGetCell(g_tPistolsShortNamesszWeaponShortNameiId) )
    {
        return 
iId
    
}
    return 
0

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Leon M.
Senior Member
Join Date: Apr 2009
Location: Germany
Old 05-16-2010 , 11:15   Re: DeathMsg is running more than once?
Reply With Quote #4

Thank you
Leon M. is offline
Reply



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 03:38.


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