03.10.2014, 02:12
Quote:
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. |
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
}