02.10.2014, 23:59
This is probably a hard question, so I will give rep to whoever can clarify this for me.
I have these three callbacks...
I know what OnPlayerWeaponShot does, (correct me if I'm wrong, but it is called when a player syncs to the server that they have fired their weapon), but I have questions about the other two.
I wan't to know what events trigger the other two callbacks. For now I'm assuming that OnPlayerGiveDamage is called when a player syncs to the server that they have hit another player, while OnPlayerTakeDamage is called when the hit player syncs back to say they have been hit.
I tend to be very particular in the way I write my code (correctness is everything), so I desire to understand exactly what happens server vs client side when a player gets shot, so as I can write my code as hack proof as possible.
Just so you know, I need to know this because I am implementing a custom damage system (that aims to be more realistic). Thanks in advance for your help.
I have these three callbacks...
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
return 1; // allow the bullet to cause damage
}
// called after a player updates that they have taken damage
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
return 1;
}
// called when a player says they have given damage
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
{
return 1;
}
I wan't to know what events trigger the other two callbacks. For now I'm assuming that OnPlayerGiveDamage is called when a player syncs to the server that they have hit another player, while OnPlayerTakeDamage is called when the hit player syncs back to say they have been hit.
I tend to be very particular in the way I write my code (correctness is everything), so I desire to understand exactly what happens server vs client side when a player gets shot, so as I can write my code as hack proof as possible.
Just so you know, I need to know this because I am implementing a custom damage system (that aims to be more realistic). Thanks in advance for your help.