Damage - Client vs Server [rep++]
#1

This is probably a hard question, so I will give rep to whoever can clarify this for me.

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 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.
Reply


Messages In This Thread
Damage - Client vs Server [rep++] - by EnforcerDon - 02.10.2014, 23:59
Re: Damage - Client vs Server [rep++] - by Abagail - 03.10.2014, 00:04
Re: Damage - Client vs Server [rep++] - by EnforcerDon - 03.10.2014, 00:20
Re: Damage - Client vs Server [rep++] - by JJack - 03.10.2014, 01:52
Re: Damage - Client vs Server [rep++] - by Pottus - 03.10.2014, 01:57
Re: Damage - Client vs Server [rep++] - by EnforcerDon - 03.10.2014, 02:12
Re: Damage - Client vs Server [rep++] - by XGreen - 03.10.2014, 02:17
Re: Damage - Client vs Server [rep++] - by Pottus - 03.10.2014, 02:18
Re: Damage - Client vs Server [rep++] - by EnforcerDon - 03.10.2014, 02:23
Re: Damage - Client vs Server [rep++] - by EnforcerDon - 03.10.2014, 02:26

Forum Jump:


Users browsing this thread: 1 Guest(s)