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

Armor & Health Repair [Updated]


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Technical/Development       
speed_script
Junior Member
Join Date: Jul 2012
Old 07-30-2012 , 09:30   Armor & Health Repair [Updated]
Reply With Quote #1

Health & Armor Repair

Description: This Plugin Raise Your Health And Your Armor Evry Time To Return 100

Cvars:
Health repair Plugin:
rh_enabled 1/0 ON/OFF (Default: 1)
rh_health "Health Value" Health to Raise (Default: 5)
rh_time "Float" Raise Time (Default: 3.0)
Armor repair Plugin:
ra_enabled 1/0 ON/OFF (Default: 1)
ra_armor "Armor Value" Armor to Raise (Default: 10)
ra_time "Float" Raise Time (Default: 3.0)

Required Modules:
amxmodx
amxmisc
hamsandwich
fun

Setup:
1. Download the plugins
2. Put The Plugins in addons/amxmodx/plugins/
3. Write at the end of the file plugins.ini in addons/amxmodx/configs/
Attached Files
File Type: sma Get Plugin or Get Source (ArmorRepair.sma - 939 views - 1.5 KB)
File Type: sma Get Plugin or Get Source (HealthRepair.sma - 968 views - 1.6 KB)

Last edited by speed_script; 08-03-2012 at 12:25. Reason: Updated :)
speed_script is offline
Send a message via Skype™ to speed_script
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 07-30-2012 , 11:27   Re: Health Repair V1.0
Reply With Quote #2

Check if the player is alive in Ham_Spawn handler.

Isn't better to use Health Message ?
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
speed_script
Junior Member
Join Date: Jul 2012
Old 07-30-2012 , 11:57   Re: Health Repair V1.0
Reply With Quote #3

Thanks
Fixed.

Last edited by speed_script; 07-31-2012 at 15:21.
speed_script is offline
Send a message via Skype™ to speed_script
pingplug
Member
Join Date: Jul 2011
Old 07-31-2012 , 09:49   Re: Health Repair V1.0
Reply With Quote #4

Nice Plugin I will Use it !
__________________
Working on:
[AMXX] Scripting
pingplug is offline
Send a message via Yahoo to pingplug Send a message via Skype™ to pingplug
speed_script
Junior Member
Join Date: Jul 2012
Old 07-31-2012 , 10:09   Re: Health Repair V1.0
Reply With Quote #5

Thanks
speed_script is offline
Send a message via Skype™ to speed_script
Swaycher
Senior Member
Join Date: Feb 2009
Location: Arg/MyHome/PawnStudio
Old 08-02-2012 , 18:38   Re: Health Repair V1.0
Reply With Quote #6

PHP Code:
/*
*
* Description: This Plugin Raise Your Health evry 3 second (The Default Time) To 100 (Like COD Games)
*
* Cvars:
* rh_enabled 1/0 ON/OFF (Default: 1)
* rh_health "Health Number" Health to Raise (Default: 5)
* rh_time "Float"  Raise Time (Default: 3.0)

*/

#include <amxmodx>
#include <hamsandwich>
#include <fun>

#define PLUGIN "Simple Repair Health"
#define VERSION "1.0"
#define AUTHOR "Speed_Script"

new g_cvarg_healthg_sec;

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_cvar   register_cvar("rh_enabled""1")
    
g_health register_cvar("rh_health""5"// Evry Time +"5"HP
    
g_sec      register_cvar("rh_time""3.0"// Evry "1.0"sec +5HP
    
    
RegisterHam(Ham_Spawn"player""FwHamSpawned"1)    
}

public 
FwHamSpawned(id
{
    if (!
get_pcvar_num(g_cvar))
        return 
HAM_IGNORED
    
    
new Float:Time get_pcvar_float(g_sec)
    
set_task(Time"RepairDemage"id__"b")
    
    return 
HAM_HANDLED
}

public 
RepairDemage(id)
{
    if (!
is_user_alive(id) || !get_pcvar_num(g_cvar))
        return 
PLUGIN_CONTINUE
    
    
new hp get_pcvar_num(g_health)
    
    if (
get_user_health(id) > 100)
    {
        return 
PLUGIN_CONTINUE
    
}
    else if (
get_user_health(id) > 95)
    {
        
set_user_health(id100)
        return 
PLUGIN_CONTINUE
    
}
    
    
set_user_health(idget_user_health(id) + hp)
    return 
PLUGIN_HANDLED

I fixed some things
__________________
Quote:
Originally Posted by fearAR View Post
Claro esta que no tengo idea de como verificar los diferentes cortes de ángulo.
http://forums.alliedmods.net/showthread.php?t=196349

Last edited by Swaycher; 08-02-2012 at 18:39.
Swaycher is offline
Send a message via MSN to Swaycher Send a message via Skype™ to Swaycher
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 08-02-2012 , 19:54   Re: Health Repair V1.0
Reply With Quote #7

First, we should check if player is alive in ham_spawn handler , and , i think Hooking Health message its better than do a task.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
speed_script
Junior Member
Join Date: Jul 2012
Old 08-03-2012 , 11:29   Re: Health Repair V1.0
Reply With Quote #8

Thanks
The Plguin is updated

Code:
   if(task_exists(id, 0))
           return HAM_IGNORED
        set_task(Time, "RepairDemage", id, "", 0, "b")

Because Many tasks Will Be set and the health up speedy

Sorry A little error Fixed
__________________
I'm Just A Beginner

Last edited by speed_script; 08-03-2012 at 12:23.
speed_script is offline
Send a message via Skype™ to speed_script
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-03-2012 , 12:23   Re: Armor & Health Repair
Reply With Quote #9

@Swaycher

Instead of say "i've fixed something", at least say what you have fixed.
Or tell him what are the problems.
This plugin has just been released...



@speed_script

This is really poorly coded, i guess it's your first plugin ?
Also i think it is redundant, gonna unaprove.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-03-2012 at 12:24.
ConnorMcLeod is offline
speed_script
Junior Member
Join Date: Jul 2012
Old 08-03-2012 , 12:27   Re: Armor & Health Repair [Updated]
Reply With Quote #10

Sorry A little Error Fixed

I've changed The Ham_Spawn To Ham_TakeDemage

Please put it in New Plugin Submissions

the plugin Work!
it's a good Idea!
__________________
I'm Just A Beginner

Last edited by speed_script; 08-03-2012 at 12:28.
speed_script is offline
Send a message via Skype™ to speed_script
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 07:30.


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