OnPlayerWeaponShoot -
audriuxxx - 13.05.2014
It'is possible when you shoot to other person then this callback is called, and no damage will be doing to him?
Re: OnPlayerWeaponShoot -
Madd92 - 13.05.2014
Quote:
Originally Posted by audriuxxx
It'is possible when you shoot to other person then this callback is called, and no damage will be doing to him?
|
Just return 0 when the target player should not take damage.
Example:
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
new message[128];
if (hittype == BULLET_HIT_TYPE_PLAYER && hitid != INVALID_PLAYER_ID && weaponid == WEAPON_DEAGLE)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(hitid, x, y, z);
if (!IsPlayerAimingAt(playerid, x, y, z, 1.5))
{
format(message, sizeof(message), "[Anti-Hack] Player %s (%d) is suspected to use No-Aim.", player_info[playerid][playername], playerid);
SendAdminMessage(COLOR_RED, message);
return 0;
}
}
return 1;
}
Re: OnPlayerWeaponShoot -
audriuxxx - 13.05.2014
I know that

but it'is possible that he can escape from bullet ?

or something?
Re: OnPlayerWeaponShoot -
ball - 13.05.2014
Yes, its possible, for example player A shoot player B, but player B have modded skin. There are more examples, player on afk, bug with knife.
Re: OnPlayerWeaponShoot -
audriuxxx - 13.05.2014
Bug with knife? onplayerweaponshoot is called when you hit player with knife?
Re: OnPlayerWeaponShoot -
Konstantinos - 13.05.2014
Quote:
Originally Posted by audriuxxx
Bug with knife? onplayerweaponshoot is called when you hit player with knife?
|
No. And it's called for alt-tabbed players.
Re: OnPlayerWeaponShoot -
audriuxxx - 13.05.2014
I know that already. Maybe somebody know what is everyweapon (and hunter shooting) how much damage they make from one shoot.
Re: OnPlayerWeaponShoot -
Madd92 - 13.05.2014
Why would you need to know that? I don't even think you can say that definitively because the damage of the shotgun for example depends on how many bullets hit the target. But i have found this list:
http://pastebin.com/Z7aBuacN
Maybe it helps you
Re: OnPlayerWeaponShoot -
audriuxxx - 13.05.2014
Quote:
Originally Posted by Madd92
Just return 0 when the target player should not take damage.
Example:
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) { new message[128];
if (hittype == BULLET_HIT_TYPE_PLAYER && hitid != INVALID_PLAYER_ID && weaponid == WEAPON_DEAGLE) { new Float:x, Float:y, Float:z; GetPlayerPos(hitid, x, y, z); if (!IsPlayerAimingAt(playerid, x, y, z, 1.5)) { format(message, sizeof(message), "[Anti-Hack] Player %s (%d) is suspected to use No-Aim.", player_info[playerid][playername], playerid); SendAdminMessage(COLOR_RED, message); return 0; } } return 1; }
|
Where is IsPlayerAiming at function?
Re: OnPlayerWeaponShoot -
Madd92 - 13.05.2014
It's just an example, not that important. The function just checks whether the distance between the target and the aiming vector of the shooter is greater than 1.5.
The real problem to me is that I don't know what you really need ^^