Raised This Month: $ Target: $400
 0% 

[EDIT] +e Regeneration Plugin (Excerpt from the idea)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sepsis
Senior Member
Join Date: Jul 2011
Old 08-07-2011 , 04:05   [EDIT] +e Regeneration Plugin (Excerpt from the idea)
Reply With Quote #1

Hey guys , Came to my mind an idea

This plugin I would like to add a few features, e.g. The ability to grant health , at the start of the game two players will be given randomly and next to the name [+] sign will. But, This the sign [+] Only will see teammate.

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;

Sepsis is offline
Erdener
Senior Member
Join Date: Apr 2010
Location: Turkey
Old 08-07-2011 , 08:36   Re: [EDIT] +e Regeneration Plugin (Excerpt from the idea)
Reply With Quote #2

I need it too
__________________
Erdener is offline
Sepsis
Senior Member
Join Date: Jul 2011
Old 08-07-2011 , 08:55   Re: [EDIT] +e Regeneration Plugin (Excerpt from the idea)
Reply With Quote #3

Quote:
Originally Posted by Erdener View Post
I need it too
Then , We wait for aid
Sepsis is offline
Korxu
Senior Member
Join Date: Sep 2010
Old 08-07-2011 , 10:42   Re: [EDIT] +e Regeneration Plugin (Excerpt from the idea)
Reply With Quote #4

Is better use "Ham_ObjectCaps" to hook +use.
Korxu is offline
Sepsis
Senior Member
Join Date: Jul 2011
Old 08-07-2011 , 13:32   Re: [EDIT] +e Regeneration Plugin (Excerpt from the idea)
Reply With Quote #5

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"Ham_ObjectCaps");
 
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 
Ham_ObjectCaps(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;


Thnx but,
I would like to.The ability to grant health , This ability at the start of the game 1 or 2 players will be given randomly and next to the name [+] sign will. Yet [+] this the sign will see teammate only
Sepsis is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 08-07-2011 , 13:36   Re: [EDIT] +e Regeneration Plugin (Excerpt from the idea)
Reply With Quote #6

Code:
register_forward(FM_PlayerPreThink, "Ham_ObjectCaps");
--------------->>>>>>>
Code:
RegisterHam( Ham_ObjectCaps , "player", "Forward_ObjectCaps" )
and then
Code:
public Ham_ObjectCaps(id)
--------------->>>>>>>
Code:
public Forward_ObjectCaps(id)
OvidiuS is offline
Send a message via Skype™ to OvidiuS
Sepsis
Senior Member
Join Date: Jul 2011
Old 08-07-2011 , 13:43   Re: [EDIT] +e Regeneration Plugin (Excerpt from the idea)
Reply With Quote #7

Quote:
Originally Posted by OvidiuS View Post
PHP Code:
register_forward(FM_PlayerPreThink"Ham_ObjectCaps"); 
--------------->>>>>>>
PHP Code:
RegisterHam("Ham_ObjectCaps" "player""Forward_ObjectCaps" 
and then
PHP Code:
public Ham_ObjectCaps(id
--------------->>>>>>>
PHP Code:
public Forward_ObjectCaps(id
Thnx, But

Quote:
I would like to.The ability to grant health , This ability at the start of the game 1 or 2 players will be given randomly and next to the name [+] sign will. Yet [+] this the sign will see teammate only

Last edited by Sepsis; 08-07-2011 at 13:49.
Sepsis is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 08-07-2011 , 13:49   Re: [EDIT] +e Regeneration Plugin (Excerpt from the idea)
Reply With Quote #8

don't know for the + sign seen only by teammates, someone more expirienced maybe can help you.

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fun>

#define MAXPLAYERS 32
#define VERSION "1.0"

new gHPgTimes;
new 
gHealTimes[MAXPLAYERS 1];

public 
plugin_init() 
{
    
register_plugin("+e Regeneration"VERSION"MaNiax");
 
    
RegisterHamHam_ObjectCaps "player""Forward_ObjectCaps" )
    
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 
Forward_ObjectCaps(id)
{
    if(!
is_user_alive(id))
        return;
 
    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));

OvidiuS is offline
Send a message via Skype™ to OvidiuS
Sepsis
Senior Member
Join Date: Jul 2011
Old 08-07-2011 , 13:52   Re: [EDIT] +e Regeneration Plugin (Excerpt from the idea)
Reply With Quote #9

I understood , Ok, Thanx for help
Sepsis is offline
Old 08-08-2011, 01:30
sanzida
This message has been deleted by xPaw. Reason: Spam.
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:30.


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