Raised This Month: $ Target: $400
 0% 

remember (hp)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
flamin
BANNED
Join Date: Jul 2009
Location: Los Teques
Old 03-13-2010 , 11:46   remember (hp)
Reply With Quote #1

Hi! I think this post to help me able to remember the hp for the last round and enforcing when i'm alive and i am the hp for the last round! My code is this:

PHP Code:
public cmd_hpteam(id)
{
    if(
is_user_alive(id) && id != 0) { pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED"); }
    else
    {
        static 
Players[32], name[32]
        new 
playerCountiplayer
        get_players
(PlayersplayerCount"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,print_chat,"%s %L",pug_header2,id,"PUG_AUX_HP",is_user_aliveplayer ) ? get_user_health(player) : 0get_user_armor(player), name)  
        }
    }
    return 
PLUGIN_HANDLED

It should create a variable? For that i remember the hp for the last round?

This is what records the hp player: get_user_health(player)

I can do to which i save the hp? And you can see in a new round?
flamin is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 03-13-2010 , 11:56   Re: remember (hp)
Reply With Quote #2

Try this.
PHP Code:
#include <amxmodx>
#include <fun>

new g_Health[33], g_MaxPlayers;

public 
plugin_init()
{
    
register_logevent("RoundEnd"2"1=Round_End");
    
register_logevent("RoundStart"2"1=Round_Start");

    
g_MaxPlayers get_maxplayers();
}

public 
RoundEnd()
{
    new 
Client;

    while (++
Client <= g_MaxPlayers)
    {
        if (
is_user_alive(Client))
            
g_Health[Client] = get_user_health(Client);
        else
            
g_Health 0;
    }
}

public 
RoundStart()
{
    new 
Client;

    while (++
Client <= g_MaxPlayers)
        if (
is_user_alive(Client) && g_Health[Client])
            
set_user_health(Clientg_Health[Client]);

__________________
hleV is offline
Old 03-13-2010, 12:12
ConnorMcLeod
This message has been deleted by ConnorMcLeod.
flamin
BANNED
Join Date: Jul 2009
Location: Los Teques
Old 03-13-2010 , 13:26   Re: remember (hp)
Reply With Quote #3

I am a little rookie, puts my code complete so that they understand a little better and so help me to do...

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

#include <yap_modspecific>
#include <yap_forwards>
#include <yap_stocks>
#include <yap_const>

new const plugin_author[] = "PsychO"
new const plugin_name[] = "YAP-AUX"
new const plugin_version[] = "0.0.1"

public pug_cvar_help
public pug_cvar_admin_help

#define RESET_DELAY    15.0
new bool:allowdmg

public plugin_init()
{
    
register_plugin(plugin_name,plugin_version,plugin_author);

    
register_dictionary("yap.txt")
    
register_dictionary("yap_aux.txt")

    
pug_cvar_help register_cvar("pug_help","http://")
    
pug_cvar_admin_help register_cvar("pug_adminhelp","http://")

    
register_pug_admincmd("help","cmd_cmdlist",_,"Lista de todos los comandos PUG")

    
register_pug_clcmd("hp","cmd_hpteam",_,"Muestra el hp de los oponentes")

    
register_pug_clcmd("dmg","cmd_dmg",_,"Muestra el daņo que causastes y el que te causo el oponente")
    
register_pug_clcmd("rdmg","cmd_dmg",_,"Muestra el daņo que causastes y el que te causo el oponente")

    
register_pug_admincmd("svrestart","cmd_restart",PUG_CMD_LVL,"Solo para ADMIN")

    
//parse_header("BOE-E",pug_header,5)
}

// Rukia: We need to reset the dmg and hits when a client connects, disconnects, and rounds start
new pug_dmg[33][33]
new 
pug_hits[33][33]

public 
client_connect(id
{
    
arrayset(pug_dmg[id], 033); 
    
arrayset(pug_hits[id], 033);
}

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

public 
pug_round_start()
{
    
#if defined RESET_DELAY
        
set_taskRESET_DELAY"allowdmgreset" )
    
#else
        
allowdmgreset()
    
#endif
    
    
allowdmg true
}

public 
pug_round_start_failed()
{
    
#if defined RESET_DELAY
        
set_taskRESET_DELAY"allowdmgreset" )
    
#else
        
allowdmgreset()
    
#endif
    
    
allowdmg true
}

// Rukia: Assume that the mod specific plugin has loaded the correct module, or provided this for us
public  client_damage attackervictimamountwpnindexhitplaceTA )
{
    
//if (attacker == victim) return;

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

#include <yap_aux>


public cmd_hpall(id)
{
    if(
is_user_alive(id) && id != 0) { pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED"); }
    else
    {
        static 
Players[32], name[32]
        new 
playerCountiplayer
        get_players
(PlayersplayerCount"ah")

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

            
client_print(id,print_chat,"%s %L",pug_header2,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 != 0) { pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED"); }
    else
    {
        static 
Players[32], name[32]
        new 
playerCountiplayer
        get_players
(PlayersplayerCount"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,print_chat,"%s %L",pug_header2,id,"PUG_AUX_HP",is_user_aliveplayer ) ? get_user_health(player) : 0get_user_armor(player), name)  
        }
    }
    return 
PLUGIN_HANDLED
}

public 
allowdmgreset()
{
    for (new 
033; ++i)
    {
        
arrayset(pug_dmg[i], 033)    
        
arrayset(pug_hits[i], 033)  
    }
    
allowdmg false
}

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

Read well my code watch that top declare the variables PUG_DMG[33][33], PUG_HITS[33][33] which is where stocks the damage done and the damage received, in my code already shows me the damage caused in the last round when I run the command in a new round, but the hp would not shows for instance, if in the last round the player X i am in 34hp and at the onset of new round run the command tells me 100hp instead of telling 34hp want is to save the hp by the time already stipulated in my code, Help to structure the party in my code please
flamin is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 03-13-2010 , 16:29   Re: remember (hp)
Reply With Quote #4

Again, you don't need these vars:
PHP Code:
public pug_cvar_help
public pug_cvar_admin_help 
to be public.

It is displaying 100hp because you're using get_user_health(player)
You should create another array with the last round HP from clients:
PHP Code:
new pug_lastroundhp[33]; 
And set it on round end.
Seta00 is offline
flamin
BANNED
Join Date: Jul 2009
Location: Los Teques
Old 03-13-2010 , 18:24   Re: remember (hp)
Reply With Quote #5

Mmm you could help a little more? I want to implement my code could help me? Ceases my code here of the hp:

PHP Code:
// Rukia: We need to reset the dmg and hits when a client connects, disconnects, and rounds start
new pug_dmg[33][33]
new 
pug_hits[33][33]
new 
pug_lastroundhp[33];

public 
client_connect(id
{
    
arrayset(pug_dmg[id], 033); 
    
arrayset(pug_hits[id], 033);
}

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

public 
pug_round_start()
{
    
#if defined RESET_DELAY
        
set_taskRESET_DELAY"allowdmgreset" )
    
#else
        
allowdmgreset()
    
#endif
    
    
allowdmg true
}

public 
pug_round_start_failed()
{
    
#if defined RESET_DELAY
        
set_taskRESET_DELAY"allowdmgreset" )
    
#else
        
allowdmgreset()
    
#endif
    
    
allowdmg true
}

// Rukia: Assume that the mod specific plugin has loaded the correct module, or provided this for us
public  client_damage attackervictimamountwpnindexhitplaceTA )
{
    
//if (attacker == victim) return;

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

#include <yap_aux>


public cmd_hpall(id)
{
    if(
is_user_alive(id) && id != 0) { pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED"); }
    else
    {
        static 
Players[32], name[32]
        new 
playerCountiplayer
        get_players
(PlayersplayerCount"ah")

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

            
client_print(id,print_chat,"%s %L",pug_header2,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 != 0) { pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED"); }
    else
    {
        static 
Players[32], name[32]
        new 
playerCountiplayer
        get_players
(PlayersplayerCount"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,print_chat,"%s %L",pug_header2,id,"PUG_AUX_HP",is_user_aliveplayer ) ? get_user_health(player) : 0get_user_armor(player), name)  
        }
    }
    return 
PLUGIN_HANDLED

As i have a bool created for the command of damage which is to show me the damage of the last round when you run into a new round, if you realize i have the reset the damage but could help make the same with the hp and after as reset?
flamin is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 03-13-2010 , 21:27   Re: remember (hp)
Reply With Quote #6

PHP Code:
// Rukia: We need to reset the dmg and hits when a client connects, disconnects, and rounds start
new pug_dmg[33][33]
new 
pug_hits[33][33]
new 
pug_lastroundhp[33];

public 
client_connect(id
{
    
arrayset(pug_dmg[id], 033);
    
arrayset(pug_hits[id], 033);
    
pug_lastroundhp[id] = floatround(entity_get_float(idEV_FL_max_health));
}

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

public 
pug_round_start()
{
    
#if defined RESET_DELAY
        
set_taskRESET_DELAY"allowdmgreset" )
    
#else
        
allowdmgreset()
    
#endif
    
    
allowdmg true
}

public 
pug_round_start_failed()
{
    
#if defined RESET_DELAY
        
set_taskRESET_DELAY"allowdmgreset" )
    
#else
        
allowdmgreset()
    
#endif
    
    
allowdmg true
}

// Rukia: Assume that the mod specific plugin has loaded the correct module, or provided this for us
public  client_damage attackervictimamountwpnindexhitplaceTA )
{
    
//if (attacker == victim) return;

    
pug_dmg[attacker][victim] += amount
    pug_hits
[attacker][victim] += 1
    pug_lastroundhp
[victim] -= amount;
}

#include <yap_aux>


public cmd_hpall(id)
{
    if(
is_user_alive(id) && id != 0) { pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED"); }
    else
    {
        static 
Players[32], name[32]
        new 
playerCountiplayer
        get_players
(PlayersplayerCount"ah")

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

            
client_print(id,print_chat,"%s %L",pug_header2,id,"PUG_AUX_HP",name,pug_lastroundhp[player],get_user_armor(player))
        }
    }
    return 
PLUGIN_HANDLED
}

public 
cmd_hpteam(id)
{
    if(
is_user_alive(id) && id != 0) { pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED"); }
    else
    {
        static 
Players[32], name[32]
        new 
playerCountiplayer
        get_players
(PlayersplayerCount"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,print_chat,"%s %L",pug_header2,id,"PUG_AUX_HP",is_user_aliveplayer ) ? pug_lastroundhp[player] : 0get_user_armor(player), name)  
        }
    }
    return 
PLUGIN_HANDLED

And put this on the "allowdmgreset" function:
PHP Code:
for(new 033; ++i)
    
pug_lastroundhp[id] = 100
You can refine this code to get the best result, tweak it until you find it perfect.

EDIT: Also, if you're going to use this code, I strongly recommend you to use the value of `mp_freezetime' instead of `RESET_DELAY' to reset last round info.

Last edited by Seta00; 03-13-2010 at 21:29.
Seta00 is offline
flamin
BANNED
Join Date: Jul 2009
Location: Los Teques
Old 03-14-2010 , 10:37   Re: remember (hp)
Reply With Quote #7

Hi! SETA00 thank you for your help but i have put your code as you've put look:

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

#include <yap_modspecific>
#include <yap_forwards>
#include <yap_stocks>
#include <yap_const>

new const plugin_author[] = "PsychO"
new const plugin_name[] = "YAP-AUX"
new const plugin_version[] = "0.0.1"

#define RESET_DELAY    15.0
new bool:allowdmg

public plugin_init()
{
    
register_plugin(plugin_name,plugin_version,plugin_author);

    
register_dictionary("yap.txt")
    
register_dictionary("yap_aux.txt")

    
register_pug_admincmd("help","cmd_cmdlist",_,"Lista de todos los comandos PUG")

    
register_pug_clcmd("hp","cmd_hpteam",_,"Muestra el hp de los oponentes")

    
register_pug_clcmd("dmg","cmd_dmg",_,"Muestra el daņo que causastes y el que te causo el oponente")
    
register_pug_clcmd("rdmg","cmd_dmg",_,"Muestra el daņo que causastes y el que te causo el oponente")

    
register_pug_admincmd("svrestart","cmd_restart",PUG_CMD_LVL,"Solo para ADMIN")

    
//parse_header("BOE-E",pug_header,5)
}

// Rukia: We need to reset the dmg and hits when a client connects, disconnects, and rounds start
new pug_dmg[33][33]
new 
pug_hits[33][33]
new 
pug_lastroundhp[33];

public 
client_connect(id
{
    
arrayset(pug_dmg[id], 033); 
    
arrayset(pug_hits[id], 033);
    
pug_lastroundhp[id] = floatround(entity_get_float(idEV_FL_max_health));
}

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

public 
pug_round_start()
{
    
#if defined RESET_DELAY
        
set_taskRESET_DELAY"allowdmgreset" )
    
#else
        
allowdmgreset()
    
#endif
    
    
allowdmg true
}

public 
pug_round_start_failed()
{
    
#if defined RESET_DELAY
        
set_taskRESET_DELAY"allowdmgreset" )
    
#else
        
allowdmgreset()
    
#endif
    
    
allowdmg true
}

// Rukia: Assume that the mod specific plugin has loaded the correct module, or provided this for us
public  client_damage attackervictimamountwpnindexhitplaceTA )
{
    
//if (attacker == victim) return;

    
pug_dmg[attacker][victim] += amount
    pug_hits
[attacker][victim] += 1
    pug_lastroundhp
[victim] -= amount;
}

#include <yap_aux>


public cmd_hpall(id)
{
    if(
is_user_alive(id) && id != 0) { pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED"); }
    else
    {
        static 
Players[32], name[32]
        new 
playerCountiplayer
        get_players
(PlayersplayerCount"ah")

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

            
client_print(id,print_chat,"%s %L",pug_header2,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 != && !allowdmg ) { pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED"); }
    else
    {
        static 
Players[32], name[32]
        new 
playerCountiplayer
        get_players
(PlayersplayerCount"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,print_chat,"%s %L",pug_header2,id,"PUG_AUX_HP",is_user_aliveplayer ) ? pug_lastroundhp[player] : 0get_user_armor(player), name)
        }
    }
    return 
PLUGIN_HANDLED
}

public 
allowdmgreset(id)
{
    for (new 
033; ++i)
    {
        
arrayset(pug_dmg[i], 033)    
        
arrayset(pug_hits[i], 033)
        
pug_lastroundhp[id] = 100;  
    }
    
allowdmg false

To compile i got this error watches the image:
Attached Thumbnails
Click image for larger version

Name:	help.JPG
Views:	114
Size:	49.5 KB
ID:	61483  
flamin is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-14-2010 , 13:05   Re: remember (hp)
Reply With Quote #8

#include <engine>
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
flamin
BANNED
Join Date: Jul 2009
Location: Los Teques
Old 03-14-2010 , 19:57   Re: remember (hp)
Reply With Quote #9

Perfect change a little your code seta00 i now have a problem when killing a person and to remove more than 100 of life when place .hp when i am dead shows me 0hp but when i run when i'm alive in the new round shows me (-40hp) means that you remove 160 hp as i can put that when the player this died i always say 0hp? This is the complete code:

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

#include <yap_modspecific>
#include <yap_forwards>
#include <yap_stocks>
#include <yap_const>

new const plugin_author[] = "PsychO"
new const plugin_name[] = "YAP-AUX"
new const plugin_version[] = "0.0.1"

#define RESET_DELAY    15.0
new bool:allowdmg

public plugin_init()
{
    
register_plugin(plugin_name,plugin_version,plugin_author);

    
register_dictionary("yap.txt")
    
register_dictionary("yap_aux.txt")

    
register_pug_admincmd("help","cmd_cmdlist",_,"Lista de todos los comandos PUG")

    
register_pug_clcmd("hp","cmd_rdmg",_,"Muestra el hp de los oponentes")

    
register_pug_clcmd("dmg","cmd_dmg",_,"Muestra el daņo que causastes y el que te causo el oponente")
    
register_pug_clcmd("rdmg","cmd_dmg",_,"Muestra el daņo que causastes y el que te causo el oponente")

    
register_pug_admincmd("svrestart","cmd_restart",PUG_CMD_LVL,"Solo para ADMIN")

    
//parse_header("BOE-E",pug_header,5)
}

// Rukia: We need to reset the dmg and hits when a client connects, disconnects, and rounds start
new pug_dmg[33][33]
new 
pug_hits[33][33]
new 
pug_lastroundhp[33]

public 
client_connect(id
{
    
arrayset(pug_dmg[id], 033); 
    
arrayset(pug_hits[id], 033);
    
pug_lastroundhp[id] = floatround(entity_get_float(idEV_FL_max_health));
}

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

public 
pug_round_start()
{
    
#if defined RESET_DELAY
        
set_taskRESET_DELAY"allowdmgreset" )
    
#else
        
allowdmgreset()
    
#endif
    
    
allowdmg true
}

public 
pug_round_start_failed()
{
    
#if defined RESET_DELAY
        
set_taskRESET_DELAY"allowdmgreset" )
    
#else
        
allowdmgreset()
    
#endif
    
    
allowdmg true
}

// Rukia: Assume that the mod specific plugin has loaded the correct module, or provided this for us
public  client_damage attackervictimamountwpnindexhitplaceTA )
{
    
//if (attacker == victim) return;

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

#include <yap_aux>


public cmd_hpall(id)
{
    if(
is_user_alive(id) && id != 0) { pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED"); }
    else
    {
        static 
Players[32], name[32]
        new 
playerCountiplayer
        get_players
(PlayersplayerCount"ah")

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

            
client_print(id,print_chat,"%s %L",pug_header2,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 != && !allowdmg ) { pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED"); }
    else
    {
        static 
Players[32], name[32]
        new 
playerCountiplayer
        get_players
(PlayersplayerCount"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,print_chat,"%s %L",pug_header2,id,"PUG_AUX_HP",is_user_aliveplayer ) ? pug_lastroundhp[player] : 0get_user_armor(player), name)
        }
    }
    return 
PLUGIN_HANDLED
}

public 
allowdmgreset()
{
    for (new 
033; ++i)
    {
        
arrayset(pug_dmg[i], 033)    
        
arrayset(pug_hits[i], 033)
    
pug_lastroundhp[i] = 100 
    
}
    
allowdmg false
}

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
}

public 
cmd_rdmg(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 ) ? pug_lastroundhp[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 ) ? pug_lastroundhp[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 ) ? pug_lastroundhp[player] : 0)
        }
        else if(!
checkclient_print(id,print_chat,"%s %L",pug_header2,id,"PUG_AUX_NODMG")
    }
    return 
PLUGIN_HANDLED

flamin is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 03-14-2010 , 21:01   Re: remember (hp)
Reply With Quote #10

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

#include <yap_modspecific>
#include <yap_forwards>
#include <yap_stocks>
#include <yap_const>

new const plugin_author[] = "PsychO"
new const plugin_name[] = "YAP-AUX"
new const plugin_version[] = "0.0.1"

#define RESET_DELAY    15.0
new bool:allowdmg

public plugin_init()
{
    
register_plugin(plugin_name,plugin_version,plugin_author);

    
register_dictionary("yap.txt")
    
register_dictionary("yap_aux.txt")

    
register_pug_admincmd("help","cmd_cmdlist",_,"Lista de todos los comandos PUG")

    
register_pug_clcmd("hp","cmd_rdmg",_,"Muestra el hp de los oponentes")

    
register_pug_clcmd("dmg","cmd_dmg",_,"Muestra el daņo que causastes y el que te causo el oponente")
    
register_pug_clcmd("rdmg","cmd_dmg",_,"Muestra el daņo que causastes y el que te causo el oponente")

    
register_pug_admincmd("svrestart","cmd_restart",PUG_CMD_LVL,"Solo para ADMIN")

    
//parse_header("BOE-E",pug_header,5)
}

// Rukia: We need to reset the dmg and hits when a client connects, disconnects, and rounds start
new pug_dmg[33][33]
new 
pug_hits[33][33]
new 
pug_lastroundhp[33]

public 
client_connect(id
{
    
arrayset(pug_dmg[id], 033); 
    
arrayset(pug_hits[id], 033);
    
pug_lastroundhp[id] = floatround(entity_get_float(idEV_FL_max_health));
}

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

public 
pug_round_start()
{
    
#if defined RESET_DELAY
        
set_taskRESET_DELAY"allowdmgreset" )
    
#else
        
allowdmgreset()
    
#endif
    
    
allowdmg true
}

public 
pug_round_start_failed()
{
    
#if defined RESET_DELAY
        
set_taskRESET_DELAY"allowdmgreset" )
    
#else
        
allowdmgreset()
    
#endif
    
    
allowdmg true
}

// Rukia: Assume that the mod specific plugin has loaded the correct module, or provided this for us
public client_damage attackervictimamountwpnindexhitplaceTA )
{
    
//if (attacker == victim) return;

    
new userHealth get_user_health(victim);

    
pug_dmg[attacker][victim] += amount
    pug_hits
[attacker][victim] += 1
    pug_lastroundhp
[victim] -= (amount userHealth amount);
}

#include <yap_aux>


public cmd_hpall(id)
{
    if(
is_user_alive(id) && id != 0) { pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED"); }
    else
    {
        static 
Players[32], name[32]
        new 
playerCountiplayer
        get_players
(PlayersplayerCount"ah")

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

            
client_print(id,print_chat,"%s %L",pug_header2,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 != && !allowdmg ) { pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED"); }
    else
    {
        static 
Players[32], name[32]
        new 
playerCountiplayer
        get_players
(PlayersplayerCount"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,print_chat,"%s %L",pug_header2,id,"PUG_AUX_HP",is_user_aliveplayer ) ? pug_lastroundhp[player] : 0get_user_armor(player), name)
        }
    }
    return 
PLUGIN_HANDLED
}

public 
allowdmgreset()
{
    for (new 
033; ++i)
    {
        
arrayset(pug_dmg[i], 033)    
        
arrayset(pug_hits[i], 033)
    
pug_lastroundhp[i] = 100 
    
}
    
allowdmg false
}

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
}

public 
cmd_rdmg(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 ) ? pug_lastroundhp[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 ) ? pug_lastroundhp[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 ) ? pug_lastroundhp[player] : 0)
        }
        else if(!
checkclient_print(id,print_chat,"%s %L",pug_header2,id,"PUG_AUX_NODMG")
    }
    return 
PLUGIN_HANDLED

Seta00 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 08:35.


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