pawno урок прес(pres) качание
admin Дата: Вторник, 09.08.2011, 22:59:11 | Сообщение # 1
Группа: Администраторы
Сообщений: 3869
Для начало скачаем include и положим вашу в папку с pawno где вы работаете. Если вдруг есть include можете приступать дальше! Верху прописываем если нету у вас: Code
#include <progress> #include <YSI\y_bit> #define BENCH_PRESS_INDEX (1) stock static Float: bench_pos[ ][ ] = { { 773.0491,1.4285,1000.7209, 269.2024 }, // Los Santos спортзал { 766.3170,-47.3574,1000.5859, 179.2983 }, // San Fierro спортзал { 764.9001,-60.5580,1000.6563, 1.9500 } // Las Venturas спортзал }; stock static Float: barbell_pos[ ][ ] = { { 774.42907715,1.88309872,1000.48834229,0.00000000,270.00000000,87.99966431 }, // Los Santos Тренажерный зал штанга { 765.85528564,-48.86857224,1000.64093018,0.00000000,89.49993896,0.00000000 }, // San Fierro Тренажерный зал штанга { 765.34039307,-59.18271637,1000.63793945,0.00000000,89.49993896,181.25012207 } // Las Venturas Тренажерный зал штанга }; stock static Text:bench_power[ MAX_PLAYERS ], Text:bench_reps[ MAX_PLAYERS ], Text:bench_repslabel[ MAX_PLAYERS ], BitArray:player_bench< MAX_PLAYERS >, BitArray:player_disallow_rep< MAX_PLAYERS >, BitArray:bench_used< sizeof bench_pos >, barbell_objects[ sizeof barbell_pos ] ; forward attachBarBellToPlayer( clientid, barbell_id ); forward removeBarBellToPlayer( clientid, barbell_id ); forward allowPlayerRep( clientid ); forward updateBenchBar( clientid );
Ищем public OnGameModeInit и туда добавляем: Code
for( new o; o != sizeof barbell_pos; ++ o ) barbell_objects[ o ] = CreateObject( 2913, barbell_pos[ o ][ 0 ], barbell_pos[ o ][ 1 ], barbell_pos[ o ][ 2 ], barbell_pos[ o ][ 3 ], barbell_pos[ o ][ 4 ], barbell_pos[ o ][ 5 ] ); return true;
Так должен выглядеть примерно public: Code
public OnGameModeInit( ) { for( new o; o != sizeof barbell_pos; ++ o ) barbell_objects[ o ] = CreateObject( 2913, barbell_pos[ o ][ 0 ], barbell_pos[ o ][ 1 ], barbell_pos[ o ][ 2 ], barbell_pos[ o ][ 3 ], barbell_pos[ o ][ 4 ], barbell_pos[ o ][ 5 ] ); return true; }
Ищем public OnGameModeExit() и туда добавляем: Code
for( new o; o != sizeof barbell_pos; ++ o ) DestroyObject( barbell_objects[ o ] ); for( new p; p != GetMaxPlayers( ); ++ p ) { TextDrawDestroy( bench_power[ p ] ); TextDrawDestroy( bench_reps[ p ] ); TextDrawDestroy( bench_repslabel[ p ] ); } return true;
Примерно так должен выглядеть public: Code
public OnGameModeExit( ) { for( new o; o != sizeof barbell_pos; ++ o ) DestroyObject( barbell_objects[ o ] ); for( new p; p != GetMaxPlayers( ); ++ p ) { TextDrawDestroy( bench_power[ p ] ); TextDrawDestroy( bench_reps[ p ] ); TextDrawDestroy( bench_repslabel[ p ] ); } return true; }
И щяс выложу public сами найдете и распределите! 1. Code
public OnPlayerConnect( playerid ) { Bit_Set( player_bench, playerid, false ); Bit_Set( player_disallow_rep, playerid, false ); ApplyAnimation( playerid, "benchpress", "null", 1, 0, 0, 0, 1, 0, 1 ); SetPVarInt( playerid, "player_bench_progress", _:CreateProgressBar( 550.000000, 166.000000, .color = 0x00F900FF ) ); bench_power[ playerid ] = TextDrawCreate(426.000000, 158.000000, "Power:"); TextDrawBackgroundColor(bench_power[ playerid ], 255); TextDrawFont(bench_power[ playerid ], 2); TextDrawLetterSize(bench_power[ playerid ], 0.400000, 1.800000); TextDrawColor(bench_power[ playerid ], -1); TextDrawSetOutline(bench_power[ playerid ], 0); TextDrawSetProportional(bench_power[ playerid ], 1); TextDrawSetShadow(bench_power[ playerid ], 1); bench_reps[ playerid ] = TextDrawCreate(426.000000, 203.000000, "PRES:"); TextDrawBackgroundColor(bench_reps[ playerid ], 255); TextDrawFont(bench_reps[ playerid ], 2); TextDrawLetterSize(bench_reps[ playerid ], 0.509999, 1.800000); TextDrawColor(bench_reps[ playerid ], -1); TextDrawSetOutline(bench_reps[ playerid ], 0); TextDrawSetProportional(bench_reps[ playerid ], 1); TextDrawSetShadow(bench_reps[ playerid ], 1); bench_repslabel[ playerid ] = TextDrawCreate(557.000000, 203.000000, "0"); TextDrawBackgroundColor(bench_repslabel[ playerid ], 255); TextDrawFont(bench_repslabel[ playerid ], 2); TextDrawLetterSize(bench_repslabel[ playerid ], 0.509999, 1.800000); TextDrawColor(bench_repslabel[ playerid ], -1); TextDrawSetOutline(bench_repslabel[ playerid ], 0); TextDrawSetProportional(bench_repslabel[ playerid ], 1); TextDrawSetShadow(bench_repslabel[ playerid ], 1); return true; }
2. Code
public OnPlayerDisconnect( playerid, reason ) { if( Bit_Get( player_bench, playerid ) == true ) { Bit_Set( bench_used, GetPVarInt( playerid, "player_current_bench" ), false ); removeBarBellToPlayer( playerid, getClosestBarBellEx( playerid ) ); } DestroyProgressBar( Bar:GetPVarInt( playerid, "player_bench_progress" ) ); TextDrawDestroy( bench_power[ playerid ] ); TextDrawDestroy( bench_reps[ playerid ] ); TextDrawDestroy( bench_repslabel[ playerid ] ); return true; }
3. Code
public OnPlayerKeyStateChange( playerid, newkeys, oldkeys ) { 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; } } } else if ( ( newkeys & KEY_SECONDARY_ATTACK ) && !( oldkeys & KEY_SECONDARY_ATTACK ) && ( Bit_Get( player_bench, playerid ) == true ) && ( IsPlayerAttachedObjectSlotUsed( playerid, BENCH_PRESS_INDEX ) ) ) { CallRemoteFunction( "OnPlayerExitBenchPress", "ii", playerid, GetPVarInt( playerid, "player_bench_reps" ) ); Bit_Set( player_bench, playerid, false ); ApplyAnimation( playerid, "benchpress", "gym_bp_getoff", 1, 0, 0, 0, 0, 0, 1 ); SetTimerEx( "removeBarBellToPlayer", 3000, 0, "ii", playerid, getClosestBarBellEx( playerid ) ); SetPVarInt( playerid, "player_bench_reps", 0 ); Bit_Set( bench_used, GetPVarInt( playerid, "player_current_bench" ), false ); TextDrawHideForPlayer( playerid, bench_power[ playerid ] ); TextDrawHideForPlayer( playerid, bench_reps[ playerid ] ); TextDrawHideForPlayer( playerid, bench_repslabel[ playerid ] ); KillTimer( GetPVarInt( playerid, "player_bench_timer" ) ); TextDrawSetString( bench_repslabel[ playerid ], "0" ); HideProgressBarForPlayer( playerid, Bar:GetPVarInt( playerid, "player_bench_progress" ) ); } else if ( ( newkeys & KEY_SPRINT ) && !( oldkeys & KEY_SPRINT ) && ( Bit_Get( player_bench, playerid ) == true ) && ( IsPlayerAttachedObjectSlotUsed( playerid, BENCH_PRESS_INDEX ) ) && ( Bit_Get( player_disallow_rep, playerid ) == false ) ) { SetProgressBarValue( Bar:GetPVarInt( playerid, "player_bench_progress" ), GetProgressBarValue( Bar:GetPVarInt( playerid, "player_bench_progress" ) ) + 5 ); UpdateProgressBar( Bar:GetPVarInt( playerid, "player_bench_progress" ), playerid ); if( GetProgressBarValue( Bar:GetPVarInt( playerid, "player_bench_progress" ) ) == 100 ) { switch( random( 2 ) ) { case 0: ApplyAnimation( playerid, "benchpress", "gym_bp_up_A", 1, 0, 0, 0, 1, 0, 1 ); case 1: ApplyAnimation( playerid, "benchpress", "gym_bp_up_B", 1, 0, 0, 0, 1, 0, 1 ); } Bit_Set( player_disallow_rep, playerid, true ); SetProgressBarValue( Bar:GetPVarInt( playerid, "player_bench_progress" ), 0 ); SetTimerEx( "allowPlayerRep", 2000, 0, "ii", playerid ); SetPVarInt( playerid, "player_bench_reps", GetPVarInt( playerid, "player_bench_reps" ) + 1 ); CallRemoteFunction( "OnPlayerBenchPress", "ii", playerid, GetPVarInt( playerid, "player_bench_reps" ) ); static s_string[ 3 ] ; format( s_string, sizeof s_string, "%i", GetPVarInt( playerid, "player_bench_reps" ) ); TextDrawSetString( bench_repslabel[ playerid ], s_string ); TextDrawShowForPlayer( playerid, bench_repslabel[ playerid ] ); } } return true; }
После этого добавляем public в любое место: Code
public updateBenchBar( clientid ) { new Bar:s_bar = Bar:GetPVarInt( clientid, "player_bench_progress" ) ; SetProgressBarValue( s_bar, GetProgressBarValue( s_bar ) - 8 ); UpdateProgressBar( s_bar, clientid ); } public allowPlayerRep( clientid ) { Bit_Set( player_disallow_rep, clientid, false ); ApplyAnimation( clientid, "benchpress", "gym_bp_down", 1, 0, 0, 0, 1, 0, 1 ); PlayerPlaySound( clientid, 1054, 0, 0, 0 ); } public removeBarBellToPlayer( clientid, barbell_id ) { SetCameraBehindPlayer( clientid ); ClearAnimations( clientid, 1 ); TogglePlayerControllable( clientid, 1 ); Bit_Set( player_bench, clientid, false ); RemovePlayerAttachedObject( clientid, BENCH_PRESS_INDEX ); barbell_objects[ barbell_id ] = CreateObject( 2913, barbell_pos[ barbell_id ][ 0 ], barbell_pos[ barbell_id ][ 1 ], barbell_pos[ barbell_id ][ 2 ], barbell_pos[ barbell_id ][ 3 ], barbell_pos[ barbell_id ][ 4 ], barbell_pos[ barbell_id ][ 5 ] ); } public attachBarBellToPlayer( clientid, barbell_id ) { SetPlayerAttachedObject( clientid, BENCH_PRESS_INDEX, 2913, 6); DestroyObject( barbell_id ); ShowProgressBarForPlayer( clientid, Bar:GetPVarInt( clientid, "player_bench_progress" ) ); } stock getClosestBarBellEx( clientid ) { for( new o; o != sizeof barbell_pos; ++ o ) if( IsPlayerInRangeOfPoint( clientid, 5.0, barbell_pos[ o ][ 0 ], barbell_pos[ o ][ 1 ], barbell_pos[ o ][ 2 ] ) ) return o; return false; } stock getClosestBarBell( clientid ) { for( new o; o != sizeof barbell_pos; ++ o ) if( IsPlayerInRangeOfPoint( clientid, 5.0, barbell_pos[ o ][ 0 ], barbell_pos[ o ][ 1 ], barbell_pos[ o ][ 2 ] ) ) return barbell_objects[ o ]; return false; }
Зайти и качаться - enter Качаться по стандартному gta sa - пробел! Урок by - 26_RUSSS
zm-jail.ru Разработка сайта samp-pawno.ru
Сообщение отредактировал [east_side]_trane - Суббота, 10.12.2011, 22:48:24
Сообщение Для начало скачаем include и положим вашу в папку с pawno где вы работаете. Если вдруг есть include можете приступать дальше! Верху прописываем если нету у вас: Code
#include <progress> #include <YSI\y_bit> #define BENCH_PRESS_INDEX (1) stock static Float: bench_pos[ ][ ] = { { 773.0491,1.4285,1000.7209, 269.2024 }, // Los Santos спортзал { 766.3170,-47.3574,1000.5859, 179.2983 }, // San Fierro спортзал { 764.9001,-60.5580,1000.6563, 1.9500 } // Las Venturas спортзал }; stock static Float: barbell_pos[ ][ ] = { { 774.42907715,1.88309872,1000.48834229,0.00000000,270.00000000,87.99966431 }, // Los Santos Тренажерный зал штанга { 765.85528564,-48.86857224,1000.64093018,0.00000000,89.49993896,0.00000000 }, // San Fierro Тренажерный зал штанга { 765.34039307,-59.18271637,1000.63793945,0.00000000,89.49993896,181.25012207 } // Las Venturas Тренажерный зал штанга }; stock static Text:bench_power[ MAX_PLAYERS ], Text:bench_reps[ MAX_PLAYERS ], Text:bench_repslabel[ MAX_PLAYERS ], BitArray:player_bench< MAX_PLAYERS >, BitArray:player_disallow_rep< MAX_PLAYERS >, BitArray:bench_used< sizeof bench_pos >, barbell_objects[ sizeof barbell_pos ] ; forward attachBarBellToPlayer( clientid, barbell_id ); forward removeBarBellToPlayer( clientid, barbell_id ); forward allowPlayerRep( clientid ); forward updateBenchBar( clientid );
Ищем public OnGameModeInit и туда добавляем: Code
for( new o; o != sizeof barbell_pos; ++ o ) barbell_objects[ o ] = CreateObject( 2913, barbell_pos[ o ][ 0 ], barbell_pos[ o ][ 1 ], barbell_pos[ o ][ 2 ], barbell_pos[ o ][ 3 ], barbell_pos[ o ][ 4 ], barbell_pos[ o ][ 5 ] ); return true;
Так должен выглядеть примерно public: Code
public OnGameModeInit( ) { for( new o; o != sizeof barbell_pos; ++ o ) barbell_objects[ o ] = CreateObject( 2913, barbell_pos[ o ][ 0 ], barbell_pos[ o ][ 1 ], barbell_pos[ o ][ 2 ], barbell_pos[ o ][ 3 ], barbell_pos[ o ][ 4 ], barbell_pos[ o ][ 5 ] ); return true; }
Ищем public OnGameModeExit() и туда добавляем: Code
for( new o; o != sizeof barbell_pos; ++ o ) DestroyObject( barbell_objects[ o ] ); for( new p; p != GetMaxPlayers( ); ++ p ) { TextDrawDestroy( bench_power[ p ] ); TextDrawDestroy( bench_reps[ p ] ); TextDrawDestroy( bench_repslabel[ p ] ); } return true;
Примерно так должен выглядеть public: Code
public OnGameModeExit( ) { for( new o; o != sizeof barbell_pos; ++ o ) DestroyObject( barbell_objects[ o ] ); for( new p; p != GetMaxPlayers( ); ++ p ) { TextDrawDestroy( bench_power[ p ] ); TextDrawDestroy( bench_reps[ p ] ); TextDrawDestroy( bench_repslabel[ p ] ); } return true; }
И щяс выложу public сами найдете и распределите! 1. Code
public OnPlayerConnect( playerid ) { Bit_Set( player_bench, playerid, false ); Bit_Set( player_disallow_rep, playerid, false ); ApplyAnimation( playerid, "benchpress", "null", 1, 0, 0, 0, 1, 0, 1 ); SetPVarInt( playerid, "player_bench_progress", _:CreateProgressBar( 550.000000, 166.000000, .color = 0x00F900FF ) ); bench_power[ playerid ] = TextDrawCreate(426.000000, 158.000000, "Power:"); TextDrawBackgroundColor(bench_power[ playerid ], 255); TextDrawFont(bench_power[ playerid ], 2); TextDrawLetterSize(bench_power[ playerid ], 0.400000, 1.800000); TextDrawColor(bench_power[ playerid ], -1); TextDrawSetOutline(bench_power[ playerid ], 0); TextDrawSetProportional(bench_power[ playerid ], 1); TextDrawSetShadow(bench_power[ playerid ], 1); bench_reps[ playerid ] = TextDrawCreate(426.000000, 203.000000, "PRES:"); TextDrawBackgroundColor(bench_reps[ playerid ], 255); TextDrawFont(bench_reps[ playerid ], 2); TextDrawLetterSize(bench_reps[ playerid ], 0.509999, 1.800000); TextDrawColor(bench_reps[ playerid ], -1); TextDrawSetOutline(bench_reps[ playerid ], 0); TextDrawSetProportional(bench_reps[ playerid ], 1); TextDrawSetShadow(bench_reps[ playerid ], 1); bench_repslabel[ playerid ] = TextDrawCreate(557.000000, 203.000000, "0"); TextDrawBackgroundColor(bench_repslabel[ playerid ], 255); TextDrawFont(bench_repslabel[ playerid ], 2); TextDrawLetterSize(bench_repslabel[ playerid ], 0.509999, 1.800000); TextDrawColor(bench_repslabel[ playerid ], -1); TextDrawSetOutline(bench_repslabel[ playerid ], 0); TextDrawSetProportional(bench_repslabel[ playerid ], 1); TextDrawSetShadow(bench_repslabel[ playerid ], 1); return true; }
2. Code
public OnPlayerDisconnect( playerid, reason ) { if( Bit_Get( player_bench, playerid ) == true ) { Bit_Set( bench_used, GetPVarInt( playerid, "player_current_bench" ), false ); removeBarBellToPlayer( playerid, getClosestBarBellEx( playerid ) ); } DestroyProgressBar( Bar:GetPVarInt( playerid, "player_bench_progress" ) ); TextDrawDestroy( bench_power[ playerid ] ); TextDrawDestroy( bench_reps[ playerid ] ); TextDrawDestroy( bench_repslabel[ playerid ] ); return true; }
3. Code
public OnPlayerKeyStateChange( playerid, newkeys, oldkeys ) { 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; } } } else if ( ( newkeys & KEY_SECONDARY_ATTACK ) && !( oldkeys & KEY_SECONDARY_ATTACK ) && ( Bit_Get( player_bench, playerid ) == true ) && ( IsPlayerAttachedObjectSlotUsed( playerid, BENCH_PRESS_INDEX ) ) ) { CallRemoteFunction( "OnPlayerExitBenchPress", "ii", playerid, GetPVarInt( playerid, "player_bench_reps" ) ); Bit_Set( player_bench, playerid, false ); ApplyAnimation( playerid, "benchpress", "gym_bp_getoff", 1, 0, 0, 0, 0, 0, 1 ); SetTimerEx( "removeBarBellToPlayer", 3000, 0, "ii", playerid, getClosestBarBellEx( playerid ) ); SetPVarInt( playerid, "player_bench_reps", 0 ); Bit_Set( bench_used, GetPVarInt( playerid, "player_current_bench" ), false ); TextDrawHideForPlayer( playerid, bench_power[ playerid ] ); TextDrawHideForPlayer( playerid, bench_reps[ playerid ] ); TextDrawHideForPlayer( playerid, bench_repslabel[ playerid ] ); KillTimer( GetPVarInt( playerid, "player_bench_timer" ) ); TextDrawSetString( bench_repslabel[ playerid ], "0" ); HideProgressBarForPlayer( playerid, Bar:GetPVarInt( playerid, "player_bench_progress" ) ); } else if ( ( newkeys & KEY_SPRINT ) && !( oldkeys & KEY_SPRINT ) && ( Bit_Get( player_bench, playerid ) == true ) && ( IsPlayerAttachedObjectSlotUsed( playerid, BENCH_PRESS_INDEX ) ) && ( Bit_Get( player_disallow_rep, playerid ) == false ) ) { SetProgressBarValue( Bar:GetPVarInt( playerid, "player_bench_progress" ), GetProgressBarValue( Bar:GetPVarInt( playerid, "player_bench_progress" ) ) + 5 ); UpdateProgressBar( Bar:GetPVarInt( playerid, "player_bench_progress" ), playerid ); if( GetProgressBarValue( Bar:GetPVarInt( playerid, "player_bench_progress" ) ) == 100 ) { switch( random( 2 ) ) { case 0: ApplyAnimation( playerid, "benchpress", "gym_bp_up_A", 1, 0, 0, 0, 1, 0, 1 ); case 1: ApplyAnimation( playerid, "benchpress", "gym_bp_up_B", 1, 0, 0, 0, 1, 0, 1 ); } Bit_Set( player_disallow_rep, playerid, true ); SetProgressBarValue( Bar:GetPVarInt( playerid, "player_bench_progress" ), 0 ); SetTimerEx( "allowPlayerRep", 2000, 0, "ii", playerid ); SetPVarInt( playerid, "player_bench_reps", GetPVarInt( playerid, "player_bench_reps" ) + 1 ); CallRemoteFunction( "OnPlayerBenchPress", "ii", playerid, GetPVarInt( playerid, "player_bench_reps" ) ); static s_string[ 3 ] ; format( s_string, sizeof s_string, "%i", GetPVarInt( playerid, "player_bench_reps" ) ); TextDrawSetString( bench_repslabel[ playerid ], s_string ); TextDrawShowForPlayer( playerid, bench_repslabel[ playerid ] ); } } return true; }
После этого добавляем public в любое место: Code
public updateBenchBar( clientid ) { new Bar:s_bar = Bar:GetPVarInt( clientid, "player_bench_progress" ) ; SetProgressBarValue( s_bar, GetProgressBarValue( s_bar ) - 8 ); UpdateProgressBar( s_bar, clientid ); } public allowPlayerRep( clientid ) { Bit_Set( player_disallow_rep, clientid, false ); ApplyAnimation( clientid, "benchpress", "gym_bp_down", 1, 0, 0, 0, 1, 0, 1 ); PlayerPlaySound( clientid, 1054, 0, 0, 0 ); } public removeBarBellToPlayer( clientid, barbell_id ) { SetCameraBehindPlayer( clientid ); ClearAnimations( clientid, 1 ); TogglePlayerControllable( clientid, 1 ); Bit_Set( player_bench, clientid, false ); RemovePlayerAttachedObject( clientid, BENCH_PRESS_INDEX ); barbell_objects[ barbell_id ] = CreateObject( 2913, barbell_pos[ barbell_id ][ 0 ], barbell_pos[ barbell_id ][ 1 ], barbell_pos[ barbell_id ][ 2 ], barbell_pos[ barbell_id ][ 3 ], barbell_pos[ barbell_id ][ 4 ], barbell_pos[ barbell_id ][ 5 ] ); } public attachBarBellToPlayer( clientid, barbell_id ) { SetPlayerAttachedObject( clientid, BENCH_PRESS_INDEX, 2913, 6); DestroyObject( barbell_id ); ShowProgressBarForPlayer( clientid, Bar:GetPVarInt( clientid, "player_bench_progress" ) ); } stock getClosestBarBellEx( clientid ) { for( new o; o != sizeof barbell_pos; ++ o ) if( IsPlayerInRangeOfPoint( clientid, 5.0, barbell_pos[ o ][ 0 ], barbell_pos[ o ][ 1 ], barbell_pos[ o ][ 2 ] ) ) return o; return false; } stock getClosestBarBell( clientid ) { for( new o; o != sizeof barbell_pos; ++ o ) if( IsPlayerInRangeOfPoint( clientid, 5.0, barbell_pos[ o ][ 0 ], barbell_pos[ o ][ 1 ], barbell_pos[ o ][ 2 ] ) ) return barbell_objects[ o ]; return false; }
Зайти и качаться - enter Качаться по стандартному gta sa - пробел! Урок by - 26_RUSSS Автор - admin Дата добавления - 09.08.2011 в 22:59:11
Jin Дата: Вторник, 09.08.2011, 23:29:54 | Сообщение # 2
Группа: Пользователи
Сообщений: 98
Code
C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(4) : fatal error 100: cannot read from file: "progress" Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase 1 Error.
4: #include <progress>
Сообщение Code
C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(4) : fatal error 100: cannot read from file: "progress" Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase 1 Error.
4: #include <progress>Автор - Jin Дата добавления - 09.08.2011 в 23:29:54
Сообщение Jin , читай сначала внимательно!!Автор - admin Дата добавления - 10.08.2011 в 00:28:22
Jin Дата: Среда, 10.08.2011, 00:40:54 | Сообщение # 4
Группа: Пользователи
Сообщений: 98
Да ч уже понял щас у мну вообще пишет не отправлять
Сообщение Да ч уже понял щас у мну вообще пишет не отправлять Автор - Jin Дата добавления - 10.08.2011 в 00:40:54
Сообщение Jin , кинь сюда мод!Автор - admin Дата добавления - 10.08.2011 в 22:57:25
Jin Дата: Среда, 10.08.2011, 23:27:16 | Сообщение # 6
Группа: Пользователи
Сообщений: 98
Добавлено (10.08.2011, 23:27) --------------------------------------------- Code
C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1060) : warning 219: local variable "player_bench" shadows a variable at a preceding level C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1060) : error 025: function heading differs from prototype C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1060) : error 021: symbol already defined: "Bit_Set" C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1061) : error 021: symbol already defined: "Bit_Set" C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1063) : error 021: symbol already defined: "ApplyAnimation" C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1065) : error 021: symbol already defined: "SetPVarInt" C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1067) : error 010: invalid function or declaration C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1076) : error 010: invalid function or declaration C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1085) : error 010: invalid function or declaration C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1093) : error 010: invalid function or declaration C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1118) : error 010: invalid function or declaration C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1120) : error 021: symbol already defined: "Bit_Set" C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1120) : error 017: undefined symbol "playerid" C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1121) : error 010: invalid function or declaration C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1124) : error 025: function heading differs from prototype C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1124) : error 021: symbol already defined: "DestroyProgressBar" C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1124) : error 010: invalid function or declaration C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1124) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase 17 Errors.
1060 Bit_Set( player_bench, playerid, false ); 1061 Bit_Set( player_disallow_rep, playerid, false ); 1063 ApplyAnimation( playerid, "benchpress", "null", 1, 0, 0, 0, 1, 0, 1 ); 1065 SetPVarInt( playerid, "player_bench_progress", _:CreateProgressBar( 550.000000, 166.000000, .color = 0x00F900FF ) ); 1067 bench_power[ playerid ] = TextDrawCreate(426.000000, 158.000000, "Power:"); 1076 bench_reps[ playerid ] = TextDrawCreate(426.000000, 203.000000, "Reps:"); 1085 bench_repslabel[ playerid ] = TextDrawCreate(557.000000, 203.000000, "0"); 1093 return true; 1118 if( Bit_Get( player_bench, playerid ) == true ) 1120 Bit_Set( bench_used, GetPVarInt( playerid, "player_current_bench" ), false ); 1121 removeBarBellToPlayer( playerid, getClosestBarBellEx( playerid ) ); 1124 DestroyProgressBar( Bar:GetPVarInt( playerid, "player_bench_progress" ) );
Сообщение отредактировал Jin - Среда, 10.08.2011, 23:29:37
Сообщение Добавлено (10.08.2011, 23:27) --------------------------------------------- Code
C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1060) : warning 219: local variable "player_bench" shadows a variable at a preceding level C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1060) : error 025: function heading differs from prototype C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1060) : error 021: symbol already defined: "Bit_Set" C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1061) : error 021: symbol already defined: "Bit_Set" C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1063) : error 021: symbol already defined: "ApplyAnimation" C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1065) : error 021: symbol already defined: "SetPVarInt" C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1067) : error 010: invalid function or declaration C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1076) : error 010: invalid function or declaration C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1085) : error 010: invalid function or declaration C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1093) : error 010: invalid function or declaration C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1118) : error 010: invalid function or declaration C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1120) : error 021: symbol already defined: "Bit_Set" C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1120) : error 017: undefined symbol "playerid" C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1121) : error 010: invalid function or declaration C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1124) : error 025: function heading differs from prototype C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1124) : error 021: symbol already defined: "DestroyProgressBar" C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1124) : error 010: invalid function or declaration C:\Documents and Settings\User\Рабочий стол\Новый pwn мода\Копия мода\Новая папка\lvdm.pwn(1124) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase 17 Errors.
1060 Bit_Set( player_bench, playerid, false ); 1061 Bit_Set( player_disallow_rep, playerid, false ); 1063 ApplyAnimation( playerid, "benchpress", "null", 1, 0, 0, 0, 1, 0, 1 ); 1065 SetPVarInt( playerid, "player_bench_progress", _:CreateProgressBar( 550.000000, 166.000000, .color = 0x00F900FF ) ); 1067 bench_power[ playerid ] = TextDrawCreate(426.000000, 158.000000, "Power:"); 1076 bench_reps[ playerid ] = TextDrawCreate(426.000000, 203.000000, "Reps:"); 1085 bench_repslabel[ playerid ] = TextDrawCreate(557.000000, 203.000000, "0"); 1093 return true; 1118 if( Bit_Get( player_bench, playerid ) == true ) 1120 Bit_Set( bench_used, GetPVarInt( playerid, "player_current_bench" ), false ); 1121 removeBarBellToPlayer( playerid, getClosestBarBellEx( playerid ) ); 1124 DestroyProgressBar( Bar:GetPVarInt( playerid, "player_bench_progress" ) );Автор - Jin Дата добавления - 10.08.2011 в 23:27:16
Сообщение Jin , инклуды все вставил?что в архиве?плюс скинь как ты делал!Автор - admin Дата добавления - 11.08.2011 в 09:03:54
MaXMuT Дата: Среда, 17.08.2011, 10:48:32 | Сообщение # 8
Группа: Пользователи
Сообщений: 90
Code
bench_reps[ playerid ] = TextDrawCreate(426.000000, 203.000000, "Reps:");
Я непонял немного :D У тебя пресс или репс? исправь.
Вернулся на форум.Пишите в личу,если кому надо помочь по скриптенгу( только на форуме,в скайпе не помогаю )
Сообщение Code
bench_reps[ playerid ] = TextDrawCreate(426.000000, 203.000000, "Reps:");
Я непонял немного :D У тебя пресс или репс? исправь.Автор - MaXMuT Дата добавления - 17.08.2011 в 10:48:32
Сообщение MaXMuT , ok исправил Автор - admin Дата добавления - 18.08.2011 в 04:46:07
[east_side]_trane Дата: Четверг, 18.08.2011, 21:52:02 | Сообщение # 10
Группа: Пользователи
Сообщений: 443
Круто воще... оч понравилось
Pawn скриптер Мои услуги по оптимизации
Сообщение Круто воще... оч понравилось Автор - [east_side]_trane Дата добавления - 18.08.2011 в 21:52:02
Загрузка страницы, займет меньше минуты...
Статистика Форума
Последнии темы
Читаемые темы
Лучшие пользователи
Новые пользователи