Would something like this work?
#1

Hey, I haven't been scripting for a while and I really can't test this code as I don't have any player available to help me out, so I'll need your confirmation here.

Lets say I have a weapon that I want to constantly deal the damage of 25, doesn't matter which case.
Would this do the trick? (GivePlayerHealth and Damage are premade functions, of course...)
pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
    GivePlayerHealth(damagedid, amount);
    GivePlayerDamage(damagedid, 25);
    return 1;
}
This isn't complete yet, as you see I haven't even written a code that will get the weapon ID, but I will take it from there if you can confirm this as working.
Reply
#2

Of course ...

Many people use OnPlayerGiveDamage/OnPlayerTakeDamage for prevent "GodMod"
Reply
#3

ya it work's
Reply
#4

Thanks guys.
Reply
#5

Wait, so... are you saying that I can use OnPlayerGiveDamage for general hit detection, and then just use a server sided variable? Because it sounds a little easier...
Anyway thanks but I think snipers are going to be instant kill, I wanna keep things real!
Reply
#6

Hey I'd be really happy if you can share that code! Unless it's private of course...
Anyway many thanks for the help I am really clear with this whole damage detection thing now.
Reply
#7

Quote:
Originally Posted by [HLF]Southclaw
Посмотреть сообщение
Ah sorry, it took me and my friend about 3 (very) late nights to figure out the mathematics for that damage model! I wanted to keep it for my server, make sure it's unique!

You could experiment with many things though, like different places the body can be hit, this can't be precise but you can do a basic height check to see if they were shot in the legs, torso, or neck and head.

Another thing I experimented with was Critical Hits, depending on a player's skill level with a specific weapon, they had a higher chance of getting a critical hit on a player which would add a bit of damage. But again, be careful with this, you don't want to focus entirely on player levels giving advantages because all in all, level only shows how long a player has been playing not how good he is!
I understand, no problem!

Critical hits were on my mind though from many games, still haven't seen it around samp!
Anyway I have some long nights before me I see
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)