Raised This Month: $ Target: $400
 0% 

.dmg help :(


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
GoPostal
Junior Member
Join Date: Apr 2007
Old 09-19-2007 , 16:25   .dmg help :(
Reply With Quote #1

I am really stuck can someone rewrite this ? I will Pay monies for it to be written good. PM ME and name a price. I just want admins only to have a amx_dmg command. The command should not be noticeable to other players. It should show how many bullets hit and the damage, and should also work during the round.

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

// Standard Contstants.
#define MAX_TEAMS               2
#define MAX_PLAYERS             32 + 1

#define MAX_NAME_LENGTH         31
#define MAX_WEAPON_LENGTH       31
#define MAX_TEXT_LENGTH         255
#define MAX_BUFFER_LENGTH       2047

new g_izUserRndName[MAX_PLAYERS][MAX_NAME_LENGTH + 1]
new g_izUserRndStats[MAX_PLAYERS][8]
new g_izUserGameStats[MAX_PLAYERS][8]

new DamageRecord[33][33]

 public client_connect(id)
{     
    /* Clear this player's damage record */
for (id = 0; id < MAX_PLAYERS; id++)
        {
            g_izUserRndName[id][0] = 0
            
            for (i = 0; i < 8; i++)
            
            g_izUserRndStats[id][i] = 0
                                    }     
    arrayset(DamageRecord[id], 0, get_maxplayers())
} 

public client_disconnect(id)
{     
    /* Clear all players' records of this player */ 
for (id = 0; id < MAX_PLAYERS; id++)
            {
                for (i = 0; i < 8; i++)
                    g_izUserGameStats[id][i] = 0
    
    new maxPlayers = get_maxplayers()     
    for (new i=1; i<=maxPlayers; i++)     
    {         
        DamageRecord[i][id] = 0
    } 
}
 
/* Call this when you get damage */
public OnDamage()
 OnDamage(attacker, victim, amount) 
 {     
    /* Ignore self damage */     
    if (attacker == victim)     
    {         
    return     
    }     
    /* Log the damage */     
    DamageRecord[attacker][victim] += amount
} 

/* Call this when the round restarts */ 
public OnRoundRestart()
OnRoundRestart()
{     
    /* Clear everyone's records */     
    new maxPlayers = get_maxplayers()     
    for (new i=1; i<=maxPlayers; i++)     
    {         
        arrayset(DamageRecord[i], 0, maxPlayers)     
    } 
} 

/* Call this when you want to display damage stats to a client */ 

if( equali( arg, ".dmgg" ) )
DisplayDamageRecord(client)
{     
    new maxPlayers = get_maxplayers()     
    for (new i=1; i<=maxPlayers; i++)     
    {         
        if (!is_connected(i))
        continue         
        if (DamageRecord[client][i])
        {              
        new name[32]              
        get_user_name(i,name, 31)              
        client_print(client, print_chat, "You dealt %d damage to %s", DamageRecord[client][i], name)         
        }     
    } 
}

Last edited by GoPostal; 09-19-2007 at 16:47.
GoPostal 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 16:06.


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