ApplyAnimation problem
#5

pawn Код:
for( new i; i < MAX_PLAYERS; i++ )
{
    if( i == playerid ) continue; // Skip if the playerid equals i
   
    if( IsPlayerInRangeOfPoint( i, 1.0, x, y, z ) )
    {
        new
            Float: playerHealth // Health / Armour are floats!
        ;
       
        GetPlayerHealth( i, playerHealth );
        SetPlayerHealth( i, playerHealth - 10.0 );
       
        format( string, sizeof( string ), "You have been punched by %s", pName );
        SendClientMessage( i, 0xFFFF00AA, string );
       
        PlayerPlaySound( i, 1130, 0.0, 0.0, 0.0 );
        PlayerPlaySound( playerid, 1130, 0.0, 0.0, 0.0 );
       
        break; // Can't punch more than one person.
    }
}
Untested.

EDIT

You may also want to use:

pawn Код:
if( newkeys & KEY_FIRE )
So that other keys ( W / S / A / D ) can be pressed while pressing KEY_FIRE.
Reply


Messages In This Thread
2 problems! - by Mean - 26.12.2010, 20:33
Re: ApplyAnimation problem - by ToPhrESH - 26.12.2010, 22:24
Re: ApplyAnimation problem - by Mean - 26.12.2010, 22:32
Re: ApplyAnimation problem - by ToPhrESH - 26.12.2010, 22:37
Re: ApplyAnimation problem - by JamesC - 26.12.2010, 23:31
Re: ApplyAnimation problem - by Mean - 27.12.2010, 09:28

Forum Jump:


Users browsing this thread: 1 Guest(s)