26.12.2010, 23:31
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.
}
}
EDIT
You may also want to use:
pawn Код:
if( newkeys & KEY_FIRE )