Raised This Month: $ Target: $400
 0% 

A few questions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Drak
Veteran Member
Join Date: Jul 2005
Old 11-07-2007 , 22:39   Re: A few questions
Reply With Quote #1

Well to give a player "1+ Health" would look similar to this:
Code:
new health = get_user_health(id); set_user_health(id,health+1);
Taking away the health should be obvious "set_user_health(id,health-1);"
NOTE: You can also do:
Code:
set_user_health(id,get_user_health(id)+1)
But if you're calling "set_user_health()" more then once, it's better the other way.
As for the blood 'splurts' that would mostlikely be accomplished by user messages. (Search for it)

Also, you have "functions in functions" You can't do this in Pawn/Small. So, i quickly went over the code abit, and commented it.
Code:
#include <amxmodx> #include <amxmisc> //This contains some useful functions #include <fun> //This contains the function to change health new PLUGIN[]="Bleed/Heal Mod" new AUTHOR[]="Stars" new VERSION[]="0.01" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR);     register_event("Damage", "hook_Damage", "be", "2>0"); } public hook_Damage(id) {     new damage = read_data(2);     new name[32];         get_user_name(id, name, 31);     //new health = pev(id, pev_health); // This is a Fakemeta native (You can use fun/engine modules to get this)     new health = get_user_health(id)     new dam_mult = 3;     //new time; // Time is a function/native, so your variable cannot be named this.     new szTime         if(damage > 75)         dam_mult = 2;     else if(damage < 25)         dam_mult = 4;             // I couldn't really make sence of that was below here.. S     if(50-health > 0 )     {     }     else     {     }     return PLUGIN_HANDLED } func_heal(id,szTime,dam_mult,health) {     if(szTime % dam_mult == 0)     {         // Heath + 1     } } func_dam(id,szTime,dam_mult,health) {     if(szTime % dam_mult == 0)     {         // Health         // Blood  Splurt     } }
I don't think that helps much.. but yeah..
__________________
Oh yeah

Last edited by Drak; 11-07-2007 at 22:48.
Drak is offline
Send a message via MSN to Drak
Stars
Junior Member
Join Date: Nov 2007
Old 11-07-2007 , 23:45   Re: A few questions
Reply With Quote #2

Thanks for clearing a few little things up ill fix it up a bit today, then demand more help !
Stars 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 01:17.


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