01.09.2016, 17:22
3DTryg. It does not require plug-ins.
PHP код:
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart){
if(damagedid != INVALID_PLAYER_ID){
new Float:x,Float:y,Float:z,
Float:tx,Float:ty,Float:tz,
Float:rx,Float:rz,Float:offset_rz;
GetPlayerPos(damagedid,x,y,z);
GetPlayerFacingAngle(damagedid,offset_rz);
GetPlayerPos(playerid,tx,ty,tz);
GetRotationFor2Point3D(x,y,z,tx,ty,tz,rx,rz);
CompRotationFloat(rz-offset_rz,rz);
//compare rz
if((rz >= 0.0 && rz <= 45.0) || (rz >= 315.0 && rz <= 360.0)){
//front of skin
} else if(rz >= 45.0 && rz <= 135.0){
//right of skin
} else if(rz >= 135.0 && rz <= 225.0){
//back of skin
} else if(rz >= 225.0 && rz <= 315.0){
//left of skin
}
}
return 1;
}