18.04.2016, 07:54
Код:
if ( ( newkeys & KEY_SECONDARY_ATTACK ) && !( oldkeys & KEY_SECONDARY_ATTACK ) && ( Bit_Get( player_bench, playerid ) == false ) && ( !IsPlayerAttachedObjectSlotUsed( playerid, BENCH_PRESS_INDEX ) ) ) { for( new o; o != sizeof bench_pos; o ++ ) { if( IsPlayerInRangeOfPoint( playerid, 2.0, bench_pos[ o ][ 0 ], bench_pos[ o ][ 1 ], bench_pos[ o ][ 2 ] ) ) { if( Bit_Get( bench_used, o ) == true ) return CallRemoteFunction( "OnPlayerStartBenchPress", "ii", playerid, 0 ); CallRemoteFunction( "OnPlayerStartBenchPress", "ii", playerid, 1 ); SetPlayerPos( playerid, bench_pos[ o ][ 0 ], bench_pos[ o ][ 1 ], bench_pos[ o ][ 2 ] ); SetPlayerFacingAngle( playerid, bench_pos[ o ][ 3 ] ); ApplyAnimation( playerid, "benchpress", "gym_bp_geton", 1, 0, 0, 0, 1, 0, 1 ); Bit_Set( player_bench, playerid, true ); Bit_Set( bench_used, o, true ); SetPVarInt( playerid, "player_current_bench", o ); SetPlayerCameraPos( playerid, bench_pos[ o ][ 0 ] - 1.5, bench_pos[ o ][ 1 ] + 1.5, bench_pos[ o ][ 2 ] + 0.5 ); SetPlayerCameraLookAt( playerid, bench_pos[ o ][ 0 ], bench_pos[ o ][ 1 ], bench_pos[ o ][ 2 ] ); TextDrawShowForPlayer( playerid, bench_power[ playerid ] ); TextDrawShowForPlayer( playerid, bench_reps[ playerid ] ); TextDrawShowForPlayer( playerid, bench_repslabel[ playerid ] ); SetTimerEx( "attachBarBellToPlayer", 3800, 0, "ii", playerid, getClosestBarBell( playerid ) ); SetPVarInt( playerid, "player_bench_timer", SetTimerEx( "updateBenchBar", 500, 1, "i", playerid ) ); break; } } }