[Include] rf_Damage - One of the most realistic damage include
#1

Rodney Francalim

Includes
••••••••••••••••••••••••••••••••••••••••••••••••••

1: LOG
Код:
[v0.2 - 02/11/2015]:
- Added GetPlayerArmourEx(playerid, &Float:armour);
- Added GetPlayerHealthEx(playerid, &Float:health);
- Name, health and armour removed from player's head;
- Now the player gets "drunk" when he took a headshot;
- The DEBUG was removed;
[v0.1 - 02/10/2015]:
- Initial release;
(http://pastebin.com/JMNGX7gB)
2: Description
- Now the damage is based on the body part and the distance between the 2 players. If the player take damage on the torso, and he uses an armour, he loses his armour, else if the damage is on the another part, so he loses his life, only. The weapons have a max range that causes the "perfect" damage. Example: the sniper rifle has 2^6.0 of range, until this, the damage is only 41.5. After this, for each meter after the max range, the damage falls 0.06. It's just applied on weapons that use bullets.

3: What do we need?
- Progress Bar v2

4: Functions
Код:
SetPlayerHealthEx(playerid, Float:health);
SetPlayerArmourEx(playerid, Float:armour);
GetPlayerHealthEx(playerid, &Float:health);
GetPlayerArmourEx(playerid, &Float:armour);
5: Images
[ame]http://www.youtube.com/watch?v=WcVKQb4bcXA[/ame]

6: Download


7: Final considerations
- SORRY FOR MY BAD ENGLISH!
- It's my first Include that I post here, I hope that be useful.
- Yes, I'll do some changes, cause' I was using it in my GM.
- I don't have to say, but, if you'll use it, keep the credits.
- PLEASE, REPORT ANY BUG!!!

8: Thanks and credits
- [HLF]Southclaw for Progress Bar.

••••••••••••••••••••••••••••••••••••••••••••••••••
Reply
#2

Very good, Rodney.
Reply
#3

Great job man Rodney 10/10
Reply
#4

Why didn't you hook the functions

SetPlayerHealthEx(playerid, Float:health);
SetPlayerArmourEx(playerid, Float:armour);

?
Reply
#5

Quote:
Originally Posted by PT
Посмотреть сообщение
Why didn't you hook the functions

SetPlayerHealthEx(playerid, Float:health);
SetPlayerArmourEx(playerid, Float:armour);

?
Cause I... Don't know.

It worked well in my GM.

And I still need to do the GetPlayerHealth(Armour)Ex.
Reply
#6

Honestly it's definitely not the best. You should do all weapon ids and don't only use fixed values. You should also consider using multipliers. Like, if weapon id is fist or chute, multiply it by 0.6 because IRL a punch does not give as much damage as in GTA. But if it is a gun, don't multiply, use fixed values for a certain distance (say 50 meters) and multiply it by a number based on the distance from the set distance.
Reply
#7

Great Job!,Keep it up
Reply
#8

OnPlayerTakeDamage() is not really well suited for this task at all in fact your entire system sidesteps real issues I won't really get into too much but the concept of this system is good implementation is insufficient.

You can't set damage less than the amount of a weapon it will still kill the player now I see your system tries to address this by setting the HP to max but did you check health bars on the player to make sure they line up? Otherwise other players won't know how much HP that player really has.

Another problem is lagcomp is not very reliable so using an proper skinhit system would help out a lot.
Reply
#9

Quote:
Originally Posted by Pottus
Посмотреть сообщение
OnPlayerTakeDamage() is not really well suited for this task at all in fact your entire system sidesteps real issues I won't really get into too much but the concept of this system is good implementation is insufficient.

You can't set damage less than the amount of a weapon it will still kill the player now I see your system tries to address this by setting the HP to max but did you check health bars on the player to make sure they line up? Otherwise other players won't know how much HP that player really has.

Another problem is lagcomp is not very reliable so using an proper skinhit system would help out a lot.
I know all of these problems. I just removed the life bars above player's head. The programmer may attach a 3D Text with name, life and armour. But this include is useful just for RP/G' s servers. I never did it to put on a TDM, DM, A/D, etc...
Reply
#10

Quote:
Originally Posted by Rodney Francalim
Посмотреть сообщение
I know all of these problems. I just removed the life bars above player's head. The programmer may attach a 3D Text with name, life and armour. But this include is useful just for RP/G' s servers. I never did it to put on a TDM, DM, A/D, etc...
Did you just say that you were too lazy to fix problems that you knew of? Yet you still released it under this state? Without warning people? Ha, the effort that goes into releases nowadays kills me on the inside...

Referring to what Pottus said:
You should first run the damage through OnPlayerTake, and directly from there run it to OnPlayerGiveDamage, then from there set the players health bar and if it's less than or equal to 0.0 call OnPlayerDeath. To make the health server sided like you need, you can set the players real health to the value of the PlayerBars in OnPlayerUpdate then just use the PlayerBars as health handlers. This system works if you implement it right, Pottus proved this to me a while ago and I still use the system.

But of course you're not gonna listen; I mean really, you admitted that your effort was low so why would you take any of this advice?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)