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

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


Post New Thread Reply   
 
Thread Tools Display Modes
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-12-2010 , 22:28   Re: [TUT] Recording Damage/Hits Per-Round and Displaying It
Reply With Quote #31

PHP Code:
client_print(id,print_chat,"%s %L",pug_header2,id,"PUG_AUX_HP",get_user_health(player),get_user_armor(player), name

PHP Code:
client_print(id,print_chat,"%s %L",pug_header2,id,"PUG_AUX_HP",is_user_aliveplayer ) ? get_user_health(player) : 0get_user_armor(player), name
About the 0 HP during round-start, ESEA has it like that too. If you really want it I can make code for it later, but that's what ESEA has. If you're trying to replicate ESEA, stick with that.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 03-12-2010 , 22:42   Re: [TUT] Recording Damage/Hits Per-Round and Displaying It
Reply With Quote #32

Quote:
Originally Posted by flamin View Post

PHP Code:
public pug_cvar_help
public pug_cvar_admin_help 
Why are those public if they are just cvars..?
__________________
Hi.
Kreation is offline
Old 03-12-2010, 22:45
flamin
This message has been deleted by flamin.
Old 03-13-2010, 01:45
flamin
This message has been deleted by flamin.
flamin
BANNED
Join Date: Jul 2009
Location: Los Teques
Old 03-14-2010 , 20:08   Re: [TUT] Recording Damage/Hits Per-Round and Displaying It
Reply With Quote #33

Hi! Wrecked again your tutorial for that i prestes help! When I run the command .dmg shows me only to the people that i have done damage but i want to see all the team, as in this in the image, here you leave my code:

PHP Code:
public cmd_dmg(id)
{
    if( 
is_user_alive(id) && id != && !allowdmg pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED");
    else
    {
        static 
Players[32], name[32]
        new 
playerCountiplayer
        get_players
(PlayersplayerCount"ch")

        new 
tmp_hitstmp_dmgtmp_rhitstmp_rdmgcheck
        
for (i=0i<playerCounti++)
        {
            
player Players[i]
            
tmp_hits pug_hits[id][player]
            
tmp_rhits pug_hits[player][id]

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

                if(
player == idclient_print(id,print_chat,"%s %L",pug_header2,id,"PUG_AUX_DMG_SELF",tmp_dmg,tmp_hitsis_user_aliveplayer ) ? get_user_health(player) : 0)
                else
                {
                    
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)
                }
            }
          }

        
tmp_hits pug_hits[id][0]
        
tmp_rhits pug_hits[0][id]
        if( 
tmp_hits || tmp_rhits )
        {
            
tmp_dmg pug_dmg[id][0]
            
tmp_rdmg pug_dmg[0][id]
            
client_print(id,print_chat,"%s %L",pug_header2,id,"PUG_AUX_DMG","WorldSpawn",tmp_hits,tmp_dmgis_user_aliveplayer ) ? get_user_health(player) : 0)
        }
        else if(!
checkclient_print(id,print_chat,"%s %L",pug_header2,id,"PUG_AUX_NODMG")
    }
    return 
PLUGIN_HANDLED

Attached Thumbnails
Click image for larger version

Name:	Image.jpg
Views:	192
Size:	93.4 KB
ID:	61499  
flamin is offline
flamin
BANNED
Join Date: Jul 2009
Location: Los Teques
Old 03-15-2010 , 19:24   Re: [TUT] Recording Damage/Hits Per-Round and Displaying It
Reply With Quote #34

Wrecked_ i already have 2 days trying to do to show all the team contrary to execute the command .dmg :S and i did not obtain please help is that you know how to do it in your code you have achieved you can help with my code is the latest i lack please
flamin is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-15-2010 , 19:29   Re: [TUT] Recording Damage/Hits Per-Round and Displaying It
Reply With Quote #35

Stop to flood, be patient.
__________________
Arkshine is offline
flamin
BANNED
Join Date: Jul 2009
Location: Los Teques
Old 03-16-2010 , 23:55   Re: [TUT] Recording Damage/Hits Per-Round and Displaying It
Reply With Quote #36

Hi! I have been trying to implement what the cs_get_user_team but i did not succeed here you leave my code

PHP Code:
public cmd_dmg(id)
{
    if( 
is_user_alive(id) && id != && !allowdmg pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED");
    else
    {
        static 
Players[32], name[32]
        new 
playerCountiplayer
        get_players
(PlayersplayerCount"ch")

        new 
tmp_hitstmp_dmgtmp_rhitstmp_rdmgcheck
        
new CsTeams:teamid cs_get_user_teamid )
        for (
i=0i<playerCounti++)
        {
            
player Players[i]
            
tmp_hits pug_hits[id][player]
            
tmp_rhits pug_hits[player][id]

            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)
            }
          }

        
tmp_hits pug_hits[id][0]
        
tmp_rhits pug_hits[0][id]
        if( 
tmp_hits || tmp_rhits )
        {
            
tmp_dmg pug_dmg[id][0]
            
tmp_rdmg pug_dmg[0][id]
            
client_print(id,print_chat,"%s %L",pug_header2,id,"PUG_AUX_DMG","WorldSpawn",tmp_hits,tmp_dmgis_user_aliveplayer ) ? get_user_health(player) : 0)
        }
        else if(!
checkclient_print(id,print_chat,"",pug_header2,id,"PUG_AUX_NODMG")
    }
    return 
PLUGIN_HANDLED

I have not been able to achieve that i am all players such as could fix it?
flamin is offline
flamin
BANNED
Join Date: Jul 2009
Location: Los Teques
Old 03-17-2010 , 18:01   Re: [TUT] Recording Damage/Hits Per-Round and Displaying It
Reply With Quote #37

some help? it's urgent
flamin is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 03-17-2010 , 18:36   Re: [TUT] Recording Damage/Hits Per-Round and Displaying It
Reply With Quote #38

Does the bump rule apply to 3 days in a row posting for help?

lol just chill out and wait wrecked will get around to it hes half a genius so give him time.
Doc-Holiday is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 03-17-2010 , 20:58   Re: [TUT] Recording Damage/Hits Per-Round and Displaying It
Reply With Quote #39

Quote:
Originally Posted by flamin View Post
some help? it's urgent
I don't understand PUG code, so I'm posting what I currently use:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN    "Show Damage"
#define AUTHOR    "Seta00"
#define VERSION    "1.0"

new hits[33][33],
    
dmgs[33][33],
    
lives[33];
    
new 
cv_roundstart_delay;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_clcmd("say .dmg""showLastRoundDamage");
    
    
RegisterHam(Ham_TakeDamage"player""Ham_TakeDamagePost"1);
    
    
register_logevent("logevent_RoundStart"2"1=Round_Start");
    
register_logevent("logevent_RoundEnd"2"1=Round_End")  
    
    
cv_roundstart_delay register_cvar("dmg_roundstartdelay""5.0");
}

public 
client_connect(id) {
    
arrayset(hits[id], 0charsmax(hits[]));
    
dmgs[id] = hits[id];
}

public 
Ham_TakeDamagePost(thisidinflictoridattackerFloat:damagedamagebits) {
    
hits[this][idattacker]++;
    
dmgs[this][idattacker] += floatround(damage);
    return 
HAM_HANDLED;
}

public 
logevent_RoundStart() {
    
set_task(get_pcvar_float(cv_roundstart_delay), "resetScores");
}

public 
logevent_RoundEnd() {
    for (new 
033; ++i) {
        
lives[i] = get_user_health(i);
    }
}

public 
resetScores() {
    for (new 
0charsmax(hits); ++i) {
        
arrayset(hits[i], 0charsmax(hits[]));
        
dmgs[i] = hits[i];
    }
    
lives hits[0];
}

public 
showLastRoundDamage(id) {
    new 
message[255], username[32];
    new 
bool:tookHit false;
    
    
copy(messagecharsmax(message), "Took %d damage (%d hits) from ^"%s^" (%d HP)");
    
    for (new 
0charsmax(hits[]); ++i) {
        if (
hits[id][i] != 0) {
            if (
i) {
                if (
== id)
                    
copy(usernamecharsmax(username), "self");
                else
                    
get_user_name(iusernamecharsmax(username));
            } else {
                
copy(usernamecharsmax(username), "Worldspawn");
            }
            
client_print(idprint_chatmessagemin(dmgs[id][i],100), hits[id][i], usernamelives[i]);
            
tookHit true;
        }
    }
    
    if (!
tookHit)
        
client_print(idprint_chat"You didn't take any hit in the last round.");
    
    return 
PLUGIN_HANDLED_MAIN;

Seta00 is offline
flamin
BANNED
Join Date: Jul 2009
Location: Los Teques
Old 03-17-2010 , 21:20   Re: [TUT] Recording Damage/Hits Per-Round and Displaying It
Reply With Quote #40

Hi seta00 thanks for helping but what really need is to call team complete as it did wrecked in this code:

PHP Code:
new iPlayers[32]
    new 
iNum
    
new plrid
    
    get_players
iPlayersiNum )
    
    static 
name[32]
    static 
message[108]
    
    new 
CsTeams:idteam cs_get_user_teamid )
    
    for( new 
0iNumi++ )
    {
        
plrid iPlayers[i]
        
        if( 
id == plrid || cs_get_user_teamplrid ) == idteam )
        {
            continue;
        }
        
        
get_user_nameplridname31 )
        
        
formatex(
        
message107"Given: ( %i Damage / %i Hits ) Taken: ( %i Damage / %i Hits )",
        
iDamageGiven[id][plrid],
        
iHitsGiven[id][plrid],
        
iDamageTaken[id][plrid],
        
iHitsTaken[id][plrid]
        )
        
        
client_printidprint_chat"[%s] %s"namemessage )
    }
    
    return 
PLUGIN_CONTINUE;

If you realize the use cs_get_user_team to call the team complete to execute the command now i have tried to implement my code but i did not succeed here what leave

PHP Code:
public cmd_dmg(id)
{
    if( 
is_user_alive(id) && id != && !allowdmg pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED");
    else
    {
        static 
Players[32], name[32]
        new 
playerCountiplayer
        get_players
(PlayersplayerCount"ch")

        new 
tmp_hitstmp_dmgtmp_rhitstmp_rdmgcheck
        
for (i=0i<playerCounti++)
        {
            
player Players[i]
            
tmp_hits pug_hits[id][player]
            
tmp_rhits pug_hits[player][id]

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

                if(
player == idclient_print(id,print_chat,"%s %L",pug_header2,id,"PUG_AUX_DMG_SELF",tmp_dmg,tmp_hitsis_user_aliveplayer ) ? get_user_health(player) : 0)
                else
                {
                    
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)
                }
            }
          }

        
tmp_hits pug_hits[id][0]
        
tmp_rhits pug_hits[0][id]
        if( 
tmp_hits || tmp_rhits )
        {
            
tmp_dmg pug_dmg[id][0]
            
tmp_rdmg pug_dmg[0][id]
            
client_print(id,print_chat,"%s %L",pug_header2,id,"PUG_AUX_DMG","WorldSpawn",tmp_hits,tmp_dmgis_user_aliveplayer ) ? get_user_health(player) : 0)
        }
        else if(!
checkclient_print(id,print_chat,"%s %L",pug_header2,id,"PUG_AUX_NODMG")
    }
    return 
PLUGIN_HANDLED

Leave an image so that more or less can see what i want to perform
Attached Thumbnails
Click image for larger version

Name:	Image.jpg
Views:	163
Size:	93.4 KB
ID:	61668  
flamin 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 03:03.


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