Raised This Month: $12 Target: $400
 3% 

[TUT] Recording Damage/Hits Per-Round and Displaying It


Post New Thread Reply   
 
Thread Tools Display Modes
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 03-18-2010 , 16:30   Re: [TUT] Recording Damage/Hits Per-Round and Displaying It
Reply With Quote #51

Remove the check for damage == 0:
PHP Code:
 if( tmp_hits || tmp_rhits )
            {
                
check 1
                tmp_dmg 
pug_dmg[id][player]
                
tmp_rdmg pug_dmg[player][id]

                if( 
id == player || cs_get_user_teamplayer ) == teamid )
                {
                    continue;
                }

                
get_user_name(player,name31)
                
client_print(id,print_chat,"%s %L",pug_header2,id,"PUG_AUX_DMG",tmp_dmg,tmp_hits,tmp_rdmg,tmp_rhitsnameis_user_aliveplayer ) ? get_user_health(player) : 0)
            } 

PHP Code:
                check 1
                tmp_dmg 
pug_dmg[id][player]
                
tmp_rdmg pug_dmg[player][id]

                if( 
id == player || cs_get_user_teamplayer ) == teamid )
                {
                    continue;
                }

                
get_user_name(player,name31)
                
client_print(id,print_chat,"%s %L",pug_header2,id,"PUG_AUX_DMG",tmp_dmg,tmp_hits,tmp_rdmg,tmp_rhitsnameis_user_aliveplayer ) ? get_user_health(player) : 0
Seta00 is offline
flamin
BANNED
Join Date: Jul 2009
Location: Los Teques
Old 03-19-2010 , 00:42   Re: [TUT] Recording Damage/Hits Per-Round and Displaying It
Reply With Quote #52

Thank you seta00 until plan i could fix the problem thanks to you you what I am grateful you can help in the other thread to remember (hp)? It is a small problem...
flamin is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 03-19-2010 , 06:34   Re: [TUT] Recording Damage/Hits Per-Round and Displaying It
Reply With Quote #53

I've already read that, and you should be able to fix the problem by carefully reading my code.
Seta00 is offline
flamin
BANNED
Join Date: Jul 2009
Location: Los Teques
Old 03-19-2010 , 09:55   Re: [TUT] Recording Damage/Hits Per-Round and Displaying It
Reply With Quote #54

Quote:
Originally Posted by Seta00 View Post
I've already read that, and you should be able to fix the problem by carefully reading my code.
Thanks to new seta00 i have not solved but i no longer need that part of the code thank you could hecharme a hand in hand with this post? Https://forums.alliedmods.net/showthread.php?t=121715 what treatment to create is a random map thank you for everything!!!

Last edited by flamin; 03-19-2010 at 19:24.
flamin is offline
capet1nha
Junior Member
Join Date: Nov 2010
Old 10-09-2011 , 15:49   Re: [TUT] Recording Damage/Hits Per-Round and Displaying It
Reply With Quote #55

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

#include <pug_modspecific>
#include <pug_forwards>
#include <pug_stocks>
#include <pug_const>

public pug_cvar_help
public pug_cvar_admin_help

public plugin_init()
{
    
register_plugin("Auxiliary",AMXX_VERSION_STR,"Thales");

    
register_dictionary("pug.txt")
    
register_dictionary("pug_aux.txt")

    
pug_cvar_help register_cvar("pug_help","client.txt")
    
pug_cvar_admin_help register_cvar("pug_adminhelp","admin.txt")

    
register_pug_clcmd("hp","cmd_hp",_,"Mostra o HP do time adversario")
    
register_pug_clcmd("hpteam","cmd_hpteam",_,"Mostra o HP do seu time")
    
register_pug_clcmd("hpall","cmd_hpall",_,"Mostra o HP de todos os jogadores")

    
register_pug_clcmd("dmg","cmd_dmg",_,"Mostra o dano que voce causou no outro jogador")
    
register_pug_clcmd("rdmg","cmd_rdmg",_,"Mostra o dano que voce recebeu do outro jogador")

    
register_pug_admincmd("svrestart","cmd_restart",PUG_CMD_LVL,"Reinicia o mapa")

    
register_pug_admincmd("kick","cmd_kick",PUG_CMD_LVL,"<nome ou #userid> Kickar o jogador especificado")
    
register_pug_admincmd("bana","cmd_ban_antijogo",PUG_CMD_LVL,"<nome ou #userid> Banir (Temporariamente)")
    
register_pug_admincmd("banc","cmd_ban_cheat_smoke",PUG_CMD_LVL,"<nome ou #userid> Banir (Permanente)")

    
register_pug_admincmd("msg","cmd_msg",PUG_CMD_LVL,"Envia uma mensagem")
    
register_pug_admincmd("map","cmd_map",PUG_CMD_LVL,"Muda o mapa para o mapa especificado")

    
register_pug_clcmd("help","cmd_help",_,"Comandos dos Jogadores")
    
register_pug_clcmd("adminhelp","cmd_admin_help",PUG_CMD_LVL,"Comandos dos Admins")
}

new 
pug_dmg[33][33]
new 
pug_hits[33][33]

public 
client_authorized(id)
{
    
arrayset(pug_dmg[id],0,33); 
    
arrayset(pug_hits[id],0,33);
}


public 
client_disconnect(id)
{
    for(new 
033i++)
    {
        
pug_dmg[i][id] = 0;
        
pug_hits[i][id] = 0;
    }
}

public 
pug_round_start()
{
    for(new 
033; ++i)
    {
        
arrayset(pug_dmg[i],0,33)    
        
arrayset(pug_hits[i],0,33)    
    }
}

public 
pug_round_start_failed()
{
    for(new 
033; ++i)
    {
        
arrayset(pug_dmg[i],0,33)    
        
arrayset(pug_hits[i],0,33)    
    }
}

public  
client_damage(attacker,victim,amount,wpnindex,hitplace,TA)
{
    
/*if (attacker == victim) return;*/

    
pug_dmg[attacker][victim] += amount
    pug_hits
[attacker][victim] += 1
}

#include <pug_aux>

public cmd_hpall(id)
{
    if(
is_user_alive(id) && id != 0pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED");

    else
    {
        static 
Players[32],name[32]
        new 
playerCount,i,player
        get_players
(Players,playerCount,"ah")

        for(
i=0i<playerCounti++)
        {
            
player Players[i]
            
get_user_name(player,name,31)

            
client_print(id,3,"%s %L",pug_header,id,"PUG_AUX_HP",name,get_user_health(player),get_user_armor(player))
        }
    }
    return 
PLUGIN_HANDLED
}

public 
cmd_hp(id)
{
    if(
is_user_alive(id) && id != 0pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED");

    else
    {
        static 
Players[32],name[32]
        new 
playerCounti,player
        get_players
(Players,playerCount,"ah")

        new 
teamid pug_get_client_team(id)
        for (
i=0i<playerCounti++)
        {
            
player Players[i]

            if(
teamid == pug_get_client_team(player)) continue;

            
get_user_name(player,name,31)
            
client_print(id,3,"%s %L",pug_header,id,"PUG_AUX_HP",name,get_user_health(player),get_user_armor(player))
        }
    }
    return 
PLUGIN_HANDLED
}

public 
cmd_hpteam(id)
{
    if(
is_user_alive(id) && id != 0pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED");

    else
    {
        static 
Players[32],name[32]
        new 
playerCounti,player
        get_players
(Players,playerCount,"ah")

        new 
teamid pug_get_client_team(id)
        for (
i=0i<playerCounti++)
        {
            
player Players[i]

            if(
teamid != pug_get_client_team(player)) continue;

            
get_user_name(player,name,31)
            
client_print(id,3,"%s %L",pug_header,id,"PUG_AUX_HP",name,get_user_health(player),get_user_armor(player))
        }
    }
    return 
PLUGIN_HANDLED
}

public 
cmd_dmg(id)
{
    if(
is_user_alive(id) && id != 0pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED");

    else
    {
        static 
Players[32],name[32]
        new 
playerCount,i,player
        get_players
(Players,playerCount,"ch")

        new 
tmp_hits,tmp_dmg,check
        
        
for(i=0i<playerCounti++)
        {
            
player Players[i]
            
tmp_hits pug_hits[id][player]

            if(
tmp_hits)
            {
                
check 1
                tmp_dmg 
pug_dmg[id][player]

                if(
player == id)
                {
                    
client_print(id,3,"%s %L",pug_header,id,"PUG_AUX_DMG_SELF",tmp_hits,tmp_dmg)
                }
                else
                {
                    
get_user_name(player,name31)
                    
client_print(id,3,"%s %L",pug_header,id,"PUG_AUX_DMG",name,tmp_hits,tmp_dmg)
                }
            }
          }
        
tmp_hits pug_hits[id][0]
        
        if(
tmp_hits)
        {
            
tmp_dmg pug_dmg[id][0]
            
client_print(id,3,"%s %L",pug_header,id,"PUG_AUX_DMG","WorldSpawn",tmp_hits,tmp_dmg)
        }
        else if(!
check)
        {
            
client_print(id,3,"%s %L",pug_header,id,"PUG_AUX_NODMG")
        }
    }
    return 
PLUGIN_HANDLED
}

public 
cmd_rdmg(id)
{
    if(
is_user_alive(id) && id != 0pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED");

    else
    {
        static 
Players[32],name[32]

        new 
playerCount,i,player
        get_players
(Players,playerCount,"ch")

        new 
tmp_hits,tmp_dmg,check
        
        
for(i=0i<playerCounti++)
        {
            
player Players[i]
            
tmp_hits pug_hits[player][id]

            if(
tmp_hits)
            {
                
check 1
                tmp_dmg 
pug_dmg[player][id]

                if(
player == id)
                {
                    
client_print(id,3,"%s %L",pug_header,id,"PUG_AUX_RDMG_SELF",tmp_hits,tmp_dmg)
                }
                else
                {
                    
get_user_name(player,name31)
                    
client_print(id,3,"%s %L",pug_header,id,"PUG_AUX_RDMG",name,tmp_hits,tmp_dmg)
                }
            }
          }
        
tmp_hits pug_hits[0][id]
        
        if(
tmp_hits)
        {
            
tmp_dmg pug_dmg[0][id]
            
client_print(id,3,"%s %L",pug_header,id,"PUG_AUX_RDMG","WorldSpawn",tmp_hits,tmp_dmg)
        }
        else if(!
check)
        {
            
client_print(id,3,"%s %L",pug_header,id,"PUG_AUX_RNODMG")
        }
    }
    return 
PLUGIN_HANDLED
}

public 
cmd_restart(id,level,cid)
{
    if(!
cmd_access(id,level,cid,1)) return pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED")

    
server_cmd("restart")
        return 
PLUGIN_HANDLED
}


public 
cmd_kick(id,level,cid)
{
    if(!
cmd_access(id,level,cid,2)) return pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED")

     new 
arg[192]
      
read_args(arg,191)
      
remove_quotes(arg)

        
client_cmd(id,"amx_kick ^"%s^" ^"Kickado^"",arg)
        return 
PLUGIN_HANDLED
}

public 
cmd_ban_antijogo(id,level,cid)
{
    if(!
cmd_access(id,level,cid,2)) return pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED")

     new 
arg_1[192]
      
read_args(arg_1,191)
      
remove_quotes(arg_1)

        
client_cmd(id,"amx_ban ^"%s^" 1440 ^"Banido por AntiJogo^"",arg_1)
        return 
PLUGIN_HANDLED
}
public 
cmd_ban_cheat_smoke(id,level,cid)
{
    if(!
cmd_access(id,level,cid,2)) return pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED")

     new 
arg_2[192]
      
read_args(arg_2,191)
      
remove_quotes(arg_2)

        
client_cmd(id,"amx_ban ^"%s^" 0 ^"Banido por Uso de Cheat/NoSmoke^"",arg_2)
        return 
PLUGIN_HANDLED
}
public 
cmd_msg(id,level,cid)
{
    if(!
cmd_access(id,level,cid,2)) return pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED")

     new 
arg[192]
      
read_args(arg,191)
      
remove_quotes(arg)

    
client_print(0,3,"%s %s",pug_header,arg)
    
client_print(0,2,"%s %s",pug_header,arg)
        return 
PLUGIN_HANDLED
}

public 
cmd_rcon(id,level,cid)
{
    if(!
cmd_access(id,level,cid,2)) return pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED")

     new 
arg[192]
      
read_args(arg,191)
      
remove_quotes(arg)

        
server_cmd("%s",arg)
        return 
PLUGIN_HANDLED
}

public 
cmd_map(id,level,cid)
{
    if(!
cmd_access(id,level,cid,2)) return pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED")

     new 
arg[192]
      
read_args(arg,191)
      
remove_quotes(arg)

        
server_cmd("changelevel ^"%s^"",arg)
        return 
PLUGIN_HANDLED
}

public 
cmd_help(id)
{
    static 
tmp[255],name[32]
    
formatex(name,31,"Comandos - Clientes",pug_header)

    
get_pcvar_string(pug_cvar_help,tmp,255)
    
show_motd(id,tmp,name)
    return 
PLUGIN_HANDLED
}

public 
cmd_admin_help(id,level,cid)
{
    static 
tmp[255],name[32]
    if(!
cmd_access(id,level,cid,1)) return pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED")

    
formatex(name,31,"Comandos - Admins",pug_header)
    
get_pcvar_string(pug_cvar_admin_help,tmp,255)
    
show_motd(id,tmp,name)
    return 
PLUGIN_HANDLED



tried to put in my pug did not work can someone help?

-------
use [Google Translate]

Last edited by capet1nha; 10-09-2011 at 15:52.
capet1nha 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 07:02.


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