Raised This Month: $ Target: $400
 0% 

Coding Help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Stars
Junior Member
Join Date: Nov 2007
Old 11-06-2007 , 21:59   Coding Help
Reply With Quote #1

Okay, basically what i want to do, is make a plugin that runs when you take any damage.

What happens is... based on the damage taken, and your health after the damage, you will bleed for a certain time, or heal for a certain time...

Its quite simple, and Pawn is very easy to understand... im just having a lot of trouble linking in the HL commands.... such as:
-Starting a function when damage is taken
-Pauses in code (wait 1 second)
-Knowing Damage taken
-Knowing current hp
-and so on

(I first decided to look into AMX Mod X Scripting yesterday, so be nice)

I designed it below in Java, to help.







int HP;
int time;
int damage_taken;

public Bleed_Heal(int HP, damage_taken)
{
int dam_mult;

if (damage_taken > 75)
dam_mult = 2;

else if (damage_taken < 25)
dam_mult = 4;

else
dam_mult = 3;
if (50-HP > 0 )
{
time = (3(50-HP))

while (time > 0)
{
if (time%dam_mult == 0)
{
HP--;
}
wait 1 second;
time--;
}
}

else
{
time = (3(50-(100-HP)))
while (time > 0)
{
if (time%dam_mult == 0)
{
HP++;
}
wait 1 second;
time--;
}
}
}
Stars is offline
 


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 01:16.


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