Coding Help
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 (50-HP > 0 )} |
Re: Coding Help
Quote:
Quote:
Quote:
Quote:
|
Re: Coding Help
Thankyou, but im still confused...
How do i implement this? register_event("Damage", "hook_Damage", "be", "2>0"); |
Re: Coding Help
Insert in plugin_init() function.
|
Re: Coding Help
This is not tested but I'm pretty sure it should work.
PHP Code:
|
Re: Coding Help
how would i make someone squirt out a little bit of blood.
|
Re: Coding Help
moreso just drip blood to the ground below them, rather than squirt.
|
Re: Coding Help
Quote:
PS, thanks that was really useful. |
Re: Coding Help
set_task(1.0, "function_to_start");
Does this literally just pause for one second? Or does it go back to the start of the function in 1 second? |
Re: Coding Help
It will go to that function in 1 second
Pausing wouldn't be too useful in embedded code :D |
| All times are GMT -4. The time now is 01:16. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.