AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] remember team (https://forums.alliedmods.net/showthread.php?t=121363)

flamin 03-14-2010 21:42

[HELP] remember team
 
1 Attachment(s)
Hi! I have had problems in order to do this, I use yap pug mod, I need to run the command .dmg which is that shows you the damage received, you can see all the players on the team contrary example i am CT run the command and that i am all players Terrorists because this code which makes is that you shows only players who have you done damage could help to create this? Here no longer an example in an image, And ceases my code here:

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



flamin 03-15-2010 12:16

Re: [HELP] remember team
 
Some help please

Arkshine 03-15-2010 12:43

Re: [HELP] remember team
 
When you will stop to bump your thread after some hours; when you should wait at least 15 days.

flamin 03-15-2010 13:06

Re: [HELP] remember team
 
What are you reason but is that i have as 2 weeks trying to fix the code as explain top and as this in the picture but nobody helps me you can help?

grimvh2 03-15-2010 13:23

Re: [HELP] remember team
 
First of all, no body understands you.
Secondly read the rules.

flamin 03-15-2010 13:43

Re: [HELP] remember team
 
I do not understand? Ok look at the photo what i achieve is that i am all the players on the team contrary when you run the .dmg osea a cs_get_user_team or something similar but nose as implement could help me?

grimvh2 03-15-2010 13:47

Re: [HELP] remember team
 
I don't understand google translator.
As far as I can see from your screenshot, use Hamsandwich and register Ham_TakeDamage like this :

PHP Code:

RegisterHamHam_TakeDamage"player""TakeDamage_player")

public 
TakeDamage_player(idiEntidattackerFloat:damagedamagebits)
{




flamin 03-15-2010 13:55

Re: [HELP] remember team
 
Ok you explain that image is of ESEA te puts all my code here since the ham already what i have but otherwise here what really

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <engine>
#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"

#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]

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 != && !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 ) ? 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
        
new CsTeams:idteam 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(
player == id || cs_get_user_teamplayer ) == idteam client_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
                {
                    if(
cs_get_user_teamplayer ) == idteam ) 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,"%s %L",pug_header2,id,"PUG_AUX_NODMG")
    }
    return 
PLUGIN_HANDLED


Recalls that what i want is that when you run the command .dmg tells me in client_print all the players on the team contrary like this in the image if you realize in the image emerging players that they do not do harm or you did damage that is what i achieve that leaving the players so don't make them done damage because in my code only got to that i damage i understand? :wink:

ConnorMcLeod 03-15-2010 14:00

Re: [HELP] remember team
 
Who is nadien ?

flamin 03-15-2010 14:07

Re: [HELP] remember team
 
excuse me, was a mistake in my script i have already settled connor you can help?


All times are GMT -4. The time now is 08:44.

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