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

[....]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Erdener
Senior Member
Join Date: Apr 2010
Location: Turkey
Old 10-12-2010 , 08:20   [....]
Reply With Quote #1

[....]
__________________

Last edited by Erdener; 07-29-2013 at 07:22.
Erdener is offline
Vechta
Veteran Member
Join Date: Jun 2010
Old 10-12-2010 , 08:27   Re: [REQ] Press to E button for get Health
Reply With Quote #2

Cool, you saw it in a server,
so its not possible
Vechta is offline
blanko
Senior Member
Join Date: Aug 2008
Old 10-12-2010 , 08:28   Re: [REQ] Press to E button for get Health
Reply With Quote #3

For this, you can take shovemod script and modify it healing instead of shoving. Other guys can help you better...
blanko is offline
Old 10-12-2010, 08:39
Erdener
This message has been deleted by Erdener. Reason: nvm
Old 10-12-2010, 12:56
Erdener
This message has been deleted by Erdener. Reason: bump
nnajko
Senior Member
Join Date: May 2009
Location: Sweden
Old 10-12-2010 , 15:16   Re: [REQ] Press to E button(key) for get Health
Reply With Quote #4

Try this.
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>
#include <fun>
#define MAXPLAYERS 32
#define VERSION "1.0"
new gHPgTimes;
new 
gHealTimes[MAXPLAYERS 1];
public 
plugin_init() 
{
 
register_plugin("Team Healer"VERSION"MaNiax");
 
 
register_forward(FM_PlayerPreThink"HookUse");
 
register_event("HLTV""eNewRound""a""1=0""2=0");
 
 
gHP register_cvar("th_heal""25");
 
gTimes register_cvar("th_healtimes""2");
}
public 
eNewRound(id)
{
 new 
iPlayers[MAXPLAYERS], iNumiAll;
 
get_players(iPlayersiNum"a");
 for( new 
0iNumi++ )
 {
  
iAll iPlayers[i];
  
gHealTimes[iAll] = 0;
 }
}
public 
HookUse(id)
{
 if( !
is_user_alive(id) )
  return 
PLUGIN_HANDLED;
 
 new 
nbut pev(idpev_button);
 new 
obut pev(idpev_oldbuttons);
 
 if( (
nbut IN_USE) && !(obut IN_USE) )
 {
  if( 
gHealTimes[id] < get_pcvar_num(gTimes) )
  {
   new 
idAimingiBodyPart;
   
get_user_aiming(ididAimingiBodyPart);
   if( 
is_user_alive(idAiming) && (cs_get_user_team(id) == cs_get_user_team(idAiming)) ) 
   {
    new 
szHealer[33], szTarget[33];
    
get_user_name(idszHealercharsmax(szHealer));
    
get_user_name(idAimingszTargetcharsmax(szTarget));
    
set_user_health(idAimingget_user_health(idAiming) + get_pcvar_num(gHP)));
    
client_print(idprint_chat"** You healed %s with %i HP"szTargetget_pcvar_num(gHP));
    
client_print(idAimingprint_chat"** You got healed by %s! (%i HP)"szHealerget_pcvar_num(gHP));
    
gHealTimes[id]++;
   }
   else
   {
    
client_print(idprint_chat"** Invalid target!");
   }
  }
  else
  {
   
client_print(idprint_chat"** You have already healed %i/%i Times!"gHealTimes[id], get_pcvar_num(gTimes));
  }
 }
 
 return 
PLUGIN_CONTINUE;

Code:
Cvar: "th_heal" - "25"
Cvar: "th_healtimes" - "2"
nnajko is offline
Old 10-13-2010, 03:56
Erdener
This message has been deleted by Erdener. Reason: nvm
Old 10-13-2010, 03:59
Erdener
This message has been deleted by Erdener. Reason: nvm
Old 10-13-2010, 05:54
Erdener
This message has been deleted by Erdener. Reason: nvm
nnajko
Senior Member
Join Date: May 2009
Location: Sweden
Old 10-13-2010 , 07:10   Re: [REQ] Press to E button(key) for get Health
Reply With Quote #5

PHP Code:
set_user_health(idAimingget_user_health(idAiming) + get_pcvar_num(gHP))); 
Should be.
PHP Code:
set_user_health(idAimingget_user_health(idAiming) + get_pcvar_num(gHP)); 
One ")" to much.
nnajko is offline
Old 10-13-2010, 07:17
Erdener
This message has been deleted by Erdener. Reason: nvm
Erdener
Senior Member
Join Date: Apr 2010
Location: Turkey
Old 10-13-2010 , 10:37   Re: [REQ] Press to E button(key) for get Health
Reply With Quote #6

Just team-mate health increasing :S , My health not increasing

I want to just , my health increase.

Help
__________________
Erdener is offline
nnajko
Senior Member
Join Date: May 2009
Location: Sweden
Old 10-13-2010 , 10:59   Re: [REQ] Press to E button(key) for get Health
Reply With Quote #7

Oh, I understood wrong.
Try this:
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>
#include <fun>
#define MAXPLAYERS 32
#define VERSION "1.0"
new gHPgTimes;
new 
gHealTimes[MAXPLAYERS 1];
public 
plugin_init() 
{
 
register_plugin("+e Regeneration"VERSION"MaNiax");
 
 
register_forward(FM_PlayerPreThink"HookUse");
 
register_event("HLTV""eNewRound""a""1=0""2=0");
 
 
gHP register_cvar("th_heal""25");
 
gTimes register_cvar("th_healtimes""2");
}
public 
eNewRound(id)
{
 new 
iPlayers[MAXPLAYERS], iNumiAll;
 
get_players(iPlayersiNum"a");
 for( new 
0iNumi++ )
 {
  
iAll iPlayers[i];
  
gHealTimes[iAll] = 0;
 }
}
public 
HookUse(id)
{
 if( !
is_user_alive(id) )
  return 
PLUGIN_HANDLED;
 
 new 
nbut pev(idpev_button);
 new 
obut pev(idpev_oldbuttons);
 
 if( (
nbut IN_USE) && !(obut IN_USE) )
 {
  if( 
gHealTimes[id] < get_pcvar_num(gTimes) )
  {
   
set_user_health(idget_user_health(id) + get_pcvar_num(gHP));
   
client_print(idprint_chat"** You refreshed your health! (+%i HP)"get_pcvar_num(gHP));
   
gHealTimes[id]++;
  }
  else
  {
   
client_print(idprint_chat"** You have already healed %i/%i Times!"gHealTimes[id], get_pcvar_num(gTimes));
  }
 }
 
 return 
PLUGIN_CONTINUE;

nnajko is offline
Welgericht
Member
Join Date: Jul 2010
Old 10-13-2010 , 11:00   Re: [REQ] Press to E button(key) for get Health
Reply With Quote #8

Now your and your teammate hp'll increase. Do you want to increase only your hp?
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>
#include <fun>
#define MAXPLAYERS 32
#define VERSION "1.0"
new gHPgTimes;
new 
gHealTimes[MAXPLAYERS 1];
public 
plugin_init() 
{
 
register_plugin("Team Healer"VERSION"MaNiax");
 
 
register_forward(FM_PlayerPreThink"HookUse");
 
register_event("HLTV""eNewRound""a""1=0""2=0");
 
 
gHP register_cvar("th_heal""25");
 
gTimes register_cvar("th_healtimes""2");
}
public 
eNewRound(id)
{
 new 
iPlayers[MAXPLAYERS], iNumiAll;
 
get_players(iPlayersiNum"a");
 for( new 
0iNumi++ )
 {
  
iAll iPlayers[i];
  
gHealTimes[iAll] = 0;
 }
}
public 
HookUse(id)
{
 if( !
is_user_alive(id) )
  return 
PLUGIN_HANDLED;
 
 new 
nbut pev(idpev_button);
 new 
obut pev(idpev_oldbuttons);
 
 if( (
nbut IN_USE) && !(obut IN_USE) )
 {
  if( 
gHealTimes[id] < get_pcvar_num(gTimes) )
  {
   new 
idAimingiBodyPart;
   
get_user_aiming(ididAimingiBodyPart);
   if( 
is_user_alive(idAiming) && (cs_get_user_team(id) == cs_get_user_team(idAiming)) ) 
   {
    new 
szHealer[33], szTarget[33];
    
get_user_name(idszHealercharsmax(szHealer));
    
get_user_name(idAimingszTargetcharsmax(szTarget));
    
set_user_health(idAimingget_user_health(idAiming) + get_pcvar_num(gHP));
    
set_user_health(idget_user_health(id) + get_pcvar_num(gHP));
    
client_print(idprint_chat"** You healed %s with %i HP"szTargetget_pcvar_num(gHP));
    
client_print(idAimingprint_chat"** You got healed by %s! (%i HP)"szHealerget_pcvar_num(gHP));
    
gHealTimes[id]++;
   }
   else
   {
    
client_print(idprint_chat"** Invalid target!");
   }
  }
  else
  {
   
client_print(idprint_chat"** You have already healed %i/%i Times!"gHealTimes[id], get_pcvar_num(gTimes));
  }
 }
 
 return 
PLUGIN_CONTINUE;

Welgericht is offline
Erdener
Senior Member
Join Date: Apr 2010
Location: Turkey
Old 10-13-2010 , 11:17   Re: [REQ] Press to E button(key) for get Health
Reply With Quote #9

Cool,
maybe Hp and armor
__________________
Erdener is offline
Welgericht
Member
Join Date: Jul 2010
Old 10-13-2010 , 15:01   Re: [REQ] Press to E button(key) for get Health
Reply With Quote #10

For you and your teammate.
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>
#include <fun>
#define MAXPLAYERS 32
#define VERSION "1.0"
new gHPgTimes;
new 
gAP;
new 
gHealTimes[MAXPLAYERS 1];
public 
plugin_init() 
{
 
register_plugin("Team Healer"VERSION"MaNiax");
 
 
register_forward(FM_PlayerPreThink"HookUse");
 
register_event("HLTV""eNewRound""a""1=0""2=0");
 
 
gAP register_cvar("th_armor""25");
 
gHP register_cvar("th_heal""25");
 
gTimes register_cvar("th_healtimes""2");
}
public 
eNewRound(id)
{
 new 
iPlayers[MAXPLAYERS], iNumiAll;
 
get_players(iPlayersiNum"a");
 for( new 
0iNumi++ )
 {
  
iAll iPlayers[i];
  
gHealTimes[iAll] = 0;
 }
}
public 
HookUse(id)
{
 if( !
is_user_alive(id) )
  return 
PLUGIN_HANDLED;
 
 new 
nbut pev(idpev_button);
 new 
obut pev(idpev_oldbuttons);
 
 if( (
nbut IN_USE) && !(obut IN_USE) )
 {
  if( 
gHealTimes[id] < get_pcvar_num(gTimes) )
  {
   new 
idAimingiBodyPart;
   
get_user_aiming(ididAimingiBodyPart);
   if( 
is_user_alive(idAiming) && (cs_get_user_team(id) == cs_get_user_team(idAiming)) ) 
   {
    new 
szHealer[33], szTarget[33];
    
get_user_name(idszHealercharsmax(szHealer));
    
get_user_name(idAimingszTargetcharsmax(szTarget));
    
set_user_health(idAimingget_user_health(idAiming) + get_pcvar_num(gHP));
    
set_user_health(idget_user_health(id) + get_pcvar_num(gHP));
    
set_user_armor(idAimingget_user_armor(idAiming) + get_pcvar_num(gAP));
    
set_user_armor(idget_user_armor(id) + get_pcvar_num(gAP));
    
client_print(idprint_chat"** You healed %s with %i HP"szTargetget_pcvar_num(gHP));
    
client_print(idAimingprint_chat"** You got healed by %s! (%i HP)"szHealerget_pcvar_num(gHP));
    
gHealTimes[id]++;
   }
   else
   {
    
client_print(idprint_chat"** Invalid target!");
   }
  }
  else
  {
   
client_print(idprint_chat"** You have already healed %i/%i Times!"gHealTimes[id], get_pcvar_num(gTimes));
  }
 }
 
 return 
PLUGIN_CONTINUE;

For you only.
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>
#include <fun>
#define MAXPLAYERS 32
#define VERSION "1.0"
new gHPgTimes;
new 
gAP;
new 
gHealTimes[MAXPLAYERS 1];
public 
plugin_init() 
{
 
register_plugin("+e Regeneration"VERSION"MaNiax");
 
 
register_forward(FM_PlayerPreThink"HookUse");
 
register_event("HLTV""eNewRound""a""1=0""2=0");
 
 
gHP register_cvar("th_heal""25");
 
gAP register_cvar("th_armor""25");
 
gTimes register_cvar("th_healtimes""2");
}
public 
eNewRound(id)
{
 new 
iPlayers[MAXPLAYERS], iNumiAll;
 
get_players(iPlayersiNum"a");
 for( new 
0iNumi++ )
 {
  
iAll iPlayers[i];
  
gHealTimes[iAll] = 0;
 }
}
public 
HookUse(id)
{
 if( !
is_user_alive(id) )
  return 
PLUGIN_HANDLED;
 
 new 
nbut pev(idpev_button);
 new 
obut pev(idpev_oldbuttons);
 
 if( (
nbut IN_USE) && !(obut IN_USE) )
 {
  if( 
gHealTimes[id] < get_pcvar_num(gTimes) )
  {
   
set_user_health(idget_user_health(id) + get_pcvar_num(gHP));
   
set_user_armor(idget_user_armor(id) + get_pcvar_num(gAP))
   
client_print(idprint_chat"** You refreshed your health! (+%i HP)"get_pcvar_num(gHP));
   
gHealTimes[id]++;
  }
  else
  {
   
client_print(idprint_chat"** You have already healed %i/%i Times!"gHealTimes[id], get_pcvar_num(gTimes));
  }
 }
 
 return 
PLUGIN_CONTINUE;

Welgericht 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 22:22.


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