Raised This Month: $ Target: $400
 0% 

Health + Armor Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
no1kn0wz
New Member
Join Date: Jun 2011
Location: Venezuela
Old 06-13-2011 , 14:29   Health + Armor Plugin
Reply With Quote #1

Hi there,
I'm planning to make a plugin to get like 40+ hp and armor (in counter-strike 1.6) - after get one kill - and for example - if you kill some1 and you have 70hp - +40, then you'll have 110hp (it can be over 100) - but i want it with a maximun of 220hp and 150armor..i tried to code this using the code posted on this thread, but didn't get luck:

https://forums.alliedmods.net/showthread.php?t=67284

This is my current code:
Code:
#include <amxmodx>
#include <cstrike>
#include <fun>

// Health limit
#define LIMIT 99999999

public plugin_init()
{
    register_plugin("HP + AP After Kill -", "0.1", "Mxx");
    register_event("DeathMsg", "event_DeathMsg", "a");
}

public event_DeathMsg()
{
    static killer, victim;
    killer = read_data(1);
    victim = read_data(2);
    if(!is_user_connected(killer) || !is_user_connected(victim) || !is_user_alive(killer))
        return;
    
    cs_set_user_armor(killer, min(LIMIT, get_user_armor(killer) +20), CS_ARMOR_VESTHELM);
    set_user_health(killer, min(LIMIT, get_user_health(killer) + 40));
}
All i need now is set the maximun HP to 220 and armor to 100 - any ideas?

I'll be really thankful if i get this working - thanks beforehand!

Last edited by no1kn0wz; 06-13-2011 at 15:57.
no1kn0wz is offline
Erox902
Veteran Member
Join Date: Jun 2009
Location: Never Never Land
Old 06-13-2011 , 16:17   Re: Health + Armor Plugin
Reply With Quote #2

Code:
#include <amxmodx> #include <cstrike> #include <fun> // Health limit #define LIMIT 220 #define LIMIT2 150 public plugin_init() {     register_plugin("HP + AP After Kill -", "0.1", "Mxx");     register_event("DeathMsg", "event_DeathMsg", "a"); } public event_DeathMsg() {     static killer, victim;     killer = read_data(1);     victim = read_data(2);     if(!is_user_connected(killer) || !is_user_connected(victim) || !is_user_alive(killer))         return;         cs_set_user_armor(killer, min(LIMIT2, get_user_armor(killer) +40), CS_ARMOR_VESTHELM);     set_user_health(killer, min(LIMIT, get_user_health(killer) + 40)); }
Just like this or did you mean something diffrent? :S
Erox902 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 23:31.


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