Raised This Month: $ Target: $400
 0% 

A few questions


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Stars
Junior Member
Join Date: Nov 2007
Old 11-07-2007 , 02:30   A few questions
Reply With Quote #1

Alright, so this is my first ever Pawn program.... so dont laugh.

I need some help.

How do i increase/decease a players health by 1?
How do i make a small blood splurt?

Other than that, is this right so far?





#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);
new dam_mult = 3;
new time;



if (damage > 75)
{
dam_mult = 2;
}

else if (damage < 25)
{
dam_mult = 4;
}




if ((50-health)>0)
{
time = (3*(50-health))

while (time > 0)
{
set_task(1.0, func_dam(time, dam_mult, health));
time--;
}
}

else
{
time = (2*(50-(100-health));
while (time > 0)
{
set_task(1.0, func_heal(time, dam_mult, health));
time--;
}
}





func_heal(time, dam_mult, health)
{
if (time%dam_mult == 0)
{
*****HEALTH +1******
}
}



func_dam(time, dam_mult, health)
{
if (time%dam_mult == 0)
{
*****HEALTH -1******
*****BLOOD SPLURT******
}
}

return PLUGIN_HANDLED
}

Last edited by Stars; 11-07-2007 at 02:54.
Stars is offline
 



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