Angles
#10

3DTryg. It does not require plug-ins.

PHP код:
public OnPlayerGiveDamage(playeriddamagedidFloat:amountweaponidbodypart){
    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;

Reply


Messages In This Thread
Angles - by GoldenLion - 01.09.2016, 15:07
Re: Angles - by Sew_Sumi - 01.09.2016, 15:11
Re: Angles - by GoldenLion - 01.09.2016, 15:15
Re: Angles - by Sew_Sumi - 01.09.2016, 15:44
Re: Angles - by GoldenLion - 01.09.2016, 15:49
Re: Angles - by AbyssMorgan - 01.09.2016, 15:51
Re: Angles - by GoldenLion - 01.09.2016, 16:05
Re: Angles - by GoldenLion - 01.09.2016, 17:10
Re: Angles - by Sew_Sumi - 01.09.2016, 17:20
Re: Angles - by AbyssMorgan - 01.09.2016, 17:22

Forum Jump:


Users browsing this thread: 2 Guest(s)