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

Quote:
Originally Posted by Pottus
Посмотреть сообщение
OnPlayerGiveDamage() is reported by the player WHO shoots another player.
OnPlayerTakeDamage() is reported by the player WHO was shot after taking damage.

If you want to use OnPlayerGiveDamage() which is what I recommend when creating your own damage system which any serious server should be using anyways since lagcomp as I have said many times is unreliable. You need to set all players to the same team to negate OnPlayerTakeDamage() I have created an include which I use to hook the SetPlayerTeam() and GetPlayerTeam() functions to do this behind the scenes.
Thanks mate, That answers my question, and as always, you have been very informative. I would rep++ you, but I did that a few days ago for something else, so the forum won't let me.

I haven't actually had to use the player teams thing yet, becuase I've just been doing this, to avoid the default samp damage thing that samp does
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    if(!isBulletWeapon(weaponid)){
        new name[MAX_PLAYER_NAME+1];
        GetPlayerName(playerid, name, sizeof(name));
        printf("possible malicious weapon data sent by %s(%d)!", name, playerid);
        return 0; // no damage, the client may be hacking
    }
   
    if(hittype == HITTYPE_PLAYER){
        //CustomWeaponDamage(playerid, weaponid, hittype, hitid);
        return 0; // we are doing custom damage, so prevent damage being done by samp
    }

    return 1; // allow the bullet to cause damage
}
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: 2 Guest(s)