Raised This Month: $ Target: $400
 0% 

help, Count of hits in players and output to the panel


Post New Thread Reply   
 
Thread Tools Display Modes
=MaTi=
Member
Join Date: Jan 2008
Old 01-16-2010 , 22:00   Re: help, damage_dods round end & SendPanelToClient()
Reply With Quote #11

Here you have all the events for DOD:S http://wiki.alliedmods.net/Day_of_Defeat:_Source_Events

For round end, I would suggest using dod_round_win unless in DOD:S stalemate is possible.
=MaTi= is offline
georgy
Member
Join Date: Dec 2008
Old 01-17-2010 , 11:29   Re: help, damage_dods round end & SendPanelToClient()
Reply With Quote #12

Quote:
Originally Posted by =MaTi= View Post
Here you have all the events for DOD:S http://wiki.alliedmods.net/Day_of_Defeat:_Source_Events

For round end, I would suggest using dod_round_win unless in DOD:S stalemate is possible.
I tried thank, but also this event, the standard spelling of the module of a conclusion of the information in the panel is impossible, who example can will throw
__________________
In Game Shacal_rus
georgy is offline
=MaTi=
Member
Join Date: Jan 2008
Old 01-17-2010 , 12:47   Re: help, damage_dods round end & SendPanelToClient()
Reply With Quote #13

Quote:
Originally Posted by georgy View Post
I tried thank, but also this event, the standard spelling of the module of a conclusion of the information in the panel is impossible, who example can will throw
You can use a loop to browse through all the players.

PHP Code:
public OnPluginStart()
{
    
HookEvent("dod_round_win",RoundWinEvent);
}

public 
RoundWinEvent(Handle:event, const String:name[], bool:dontBroadcast)
{
    for(new 
i=1;i<=MaxClients;i++)
    {
        if(
IsClientInGame(i))
        {
            
//display the panel to client "i"
        
}
    }

=MaTi= is offline
georgy
Member
Join Date: Dec 2008
Old 01-17-2010 , 13:09   Re: help, damage_dods round end & SendPanelToClient()
Reply With Quote #14

=MaTi=, many thanks, now I can continue to realize the idea....
__________________
In Game Shacal_rus
georgy is offline
georgy
Member
Join Date: Dec 2008
Old 01-23-2010 , 12:56   Re: help, dod_point_captured
Reply With Quote #15

Help, help, help!!!!!!
PHP Code:
public PlayerEventPointcaptured_dods(Handle:event, const String:name[], bool:dontBroadcast)
{
for(new 
i=1i<=MaxClientsi++)
{
new 
client i;
 
if(
IsClientInGame(client) && IsClientConnected(client))
{
g_pointcaptured[client] ++;
}
}

The given variant of function shows how much all objects is grasped how to define for separately taken player the same parametre.

Solution is found!!!
__________________
In Game Shacal_rus

Last edited by georgy; 01-24-2010 at 03:19.
georgy is offline
georgy
Member
Join Date: Dec 2008
Old 01-25-2010 , 05:47   Re: help, dod_round_end Penal
Reply With Quote #16

On an event does a dod_round_win player see a panel with a result for a round, if he is killed to or during the offensive of this event that this panel does not hatch, how to decide such problem???
__________________
In Game Shacal_rus

Last edited by georgy; 01-31-2010 at 15:32.
georgy is offline
georgy
Member
Join Date: Dec 2008
Old 01-30-2010 , 14:32   Re: help, Count of hits in players and output to the panel
Reply With Quote #17

rHi!
Has faced a problem, it is necessary to consider quantity of murders of the player as other players, a variable g_HitsTaken [client] [attacker] and players it играком, the variable g_HitsDown [attacker] [client] to store it before event player_death and to output in the panel unsetting contents of these cells for collection of the new information. When on a server 2 players all works normally but as soon as on a server it is more играков all works incorrectly.

PHP Code:
public PlayerHurtEvent_dods(Handle:event, const String:name[], bool:dontBroadcast)
{
 if(!
c_showhitsEnable//plugin diabled
  
return;
 new 
client     GetClientOfUserId(GetEventInt(event"userid"));
 new 
attacker   GetClientOfUserId(GetEventInt(event"attacker"));
 if(
client==|| attacker==0)
  return;
 
 if (
IsClientInGame(client) && IsClientInGame(attacker))
 {
  new 
String:clientName[64];
  new 
String:attackerName[64];
  
//new String:TitleName[64]
 
  
GetClientName(clientclientName64)
  
GetClientName(attackerattackerName64)
  new 
hitgroup GetEventInt(event"hitgroup")
 
  if((
hitgroup >= 0) && (hitgroup <=7))
  {
   new 
damage   GetEventInt(event"damage")
 
  
// Hitgroups
  // 0 = body (generic part for css)
  // 1 = Head
  // 2 = Upper Chest
  // 3 = Lower Chest
  // 4 = Left arm
  // 5 = Right arm
  // 6 = Left leg
  // 7 = Right Leg
   
new Float:client_pos[3];
   new 
Float:attacker_pos[3];
   
GetClientAbsOrigin(client,client_pos);
   
GetClientAbsOrigin(attacker,attacker_pos);
   new 
Float:distance GetVectorDistance(client_pos,attacker_pos,false);
   
distance*=0.025;
 
   new 
String:g_HitboxName[MAXHITGROUPS+1][128];
   new 
String:g_Target[128];
   new 
String:g_Attacker[128];
   new 
String:temp[128];
 
   
Format(tempsizeof(temp), "%T""hbBody"client);
   
g_HitboxName[0]=temp;
   
Format(tempsizeof(temp), "%T""hbHead"client);
   
g_HitboxName[1]=temp;
   
Format(tempsizeof(temp), "%T""hbUpChest"client);
   
g_HitboxName[2]=temp;
   
Format(tempsizeof(temp), "%T""hbLowChest"client);
   
g_HitboxName[3]=temp;
   
Format(tempsizeof(temp), "%T""hbLeftarm"client);
   
g_HitboxName[4]=temp;
   
Format(tempsizeof(temp), "%T""hbRightarm"client);
   
g_HitboxName[5]=temp;
   
Format(tempsizeof(temp), "%T""hbLeftleg"client);
   
g_HitboxName[6]=temp;
   
Format(tempsizeof(temp), "%T""hbRightleg"client);
   
g_HitboxName[7]=temp;
   
Format(tempsizeof(temp), "%T""hbAttacker"client);
   
g_Attacker temp;
   
Format(tempsizeof(temp), "%T""hbTadget"client);
   
g_Target temp;
 
 
 
   
//PrintToChat(client,"\x01\x05Attacker: %s\x01, %s  %i dmg, %.2fm", attackerName, hitgroups[hitgroup], damage,distance);
   
PrintToChat(client,"\x01\x05%s : %s\x01, %s  %i dmg, %.2fm",g_AttackerattackerNameg_HitboxName[hitgroup], damage,distance);
   
PrintToChat(attacker,"\x04%s : %s\x01, %s  %i dmg, %.2fm",g_TargetclientName,g_HitboxName[hitgroup],damage,distance);
 
   if(
hitgroup == 1)
   {
    
g_headshot[attacker] ++;
   }
 
   
g_HitsDown[client][attacker] ++;
   
g_DamageDown[attacker] += damage;
   
g_HitsTaken[attacker][client] ++;
   
g_DamageTaken[client] += damage;
  }
 
 }

next script

PHP Code:
public PlayerDeathEvent_dods(Handle:event, const String:name[], bool:dontBroadcast)
{
 
 
 new 
client     GetClientOfUserId(GetEventInt(event"userid"));
 new 
attacker   GetClientOfUserId(GetEventInt(event"attacker"));
 
 
 if (
IsClientInGame(client) && IsClientInGame(attacker))
 {
 
  new 
String:clientName[64];
  new 
String:attackerName[64];
 
  
GetClientName(clientclientName64);
  
GetClientName(attackerattackerName64);
 
  
decl String:killer[256];
  
decl String:dmgkillerD[256];
  
decl String:dmgkillerT[256];
  
decl String:ShotAttac[256];
  
decl String:ShotVictim[256];
 
  if(
attacker == client)
  {
   
g_suicide[client]++;
 
   
Format(killersizeof(killer), "%T""tegsuicide"client);
 
  }
   else
   {
    
g_killer[client]++;
    
g_death[attacker]++;
 
    
Format(killersizeof(killer), "%T""You Kill"clientattackerName);
    
Format(dmgkillerTsizeof(dmgkillerT), "%T""tegDowndmg"clientg_DamageDown[client]);
 
    if(
g_DamageTaken[client] != 0)
    {
     
Format(dmgkillerDsizeof(dmgkillerD), "%T""tegTakendmg"clientg_DamageTaken[client]);
    }
   }
  if((
g_Panelend[client] == 0) && (c_showhitsAttacker))
  {
   new 
Handle:killReportPanal=CreatePanel();
   if((
attacker != client) && (g_DamageDown[client] != 0))
   {
    
DrawPanelItem(killReportPanaldmgkillerT);
 
    
//addiding
    
for(new i=1i<=MaxClientsi++)
    {
     if(
IsClientInGame(i) && IsClientConnected(i) && (client != i) && (g_HitsTaken[client][i] != 0))
     {
      
Format(ShotVictimsizeof(ShotVictim), "%T""tegYouShot"client attackerNameg_HitsTaken[client][i]);
      
DrawPanelText(killReportPanalShotVictim);
     }
    }
   }
   if(
attacker != client)
   {
    
DrawPanelItem(killReportPanaldmgkillerD);
 
    
//addiding
    
for(new i=1i<=MaxClientsi++)
    {
     if(
IsClientInGame(i) && IsClientConnected(i) && (client != i) && (g_HitsDown[client][i] != 0))
     {
      
Format(ShotAttacsizeof(ShotAttac), "%T""tegShotsToYou"clientattackerNameg_HitsDown[client][i]);
      
DrawPanelText(killReportPanalShotAttac);
     }
    }
   }
   
DrawPanelText(killReportPanalkiller);
   
SendPanelToClient(killReportPanalclientHandler_MyPanel5);
   
CloseHandle(killReportPanal);
  }
  
clearDamageClientreport(client);
 } 
}
 
public 
Handler_MyPanel(Handle:menuMenuAction:actionparam1param2)
{

If it is necessary I can lay out all text of a plugin

Solution is found!!!
__________________
In Game Shacal_rus

Last edited by georgy; 01-31-2010 at 15:33.
georgy is offline
Reply



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 11:05.


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