Добро пожаловать на Pro Pawn - Портал о PAWN-скриптинге.
Показано с 1 по 4 из 4
  1. #1
    Аватар для Nurick
    Пользователь

    Статус
    Оффлайн
    Регистрация
    19.04.2014
    Адрес
    Уфа, Россия
    Сообщений
    319
    Репутация:
    52 ±

    Спидометр(нет отображения)

    Делал спидометр, но нет никакого отображения, то есть сажусь в транспорт выводит TextDraw спидометра но функция SpeedVehicle( playerid ) не хочет отображаться

    PHP код:
    new speedometer_timerMAX_PLAYERS ]; 
    PHP код:
        if( oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER )
        {
            for( new 
    srsr != sizeofspeedometer ); sr++ ) PlayerTextDrawShowplayeridspeedometerplayerid ][ sr ] );
            
    speedometer_timerplayerid ] = SetTimerEx"SpeedometerUpdatePlayer"100true"i"playerid );
        }
        else
        {
            for( new 
    srsr != sizeofspeedometer ); sr++ ) PlayerTextDrawHideplayeridspeedometerplayerid ][ sr ] );
            
    KillTimerspeedometer_timerplayerid ] );
        } 
    PHP код:
    forward SpeedometerUpdatePlayerplayerid ); 
    PHP код:
    public SpeedometerUpdatePlayerplayerid )
    {
        switch( 
    SpeedVehicleplayerid ) )
        {
            case 
    .. 1PlayerTextDrawSetStringplayeridspeedometerplayerid ][ ], "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIII" );
            case 
    .. 20PlayerTextDrawSetStringplayeridspeedometerplayerid ][ ], "~g~III" );
            case 
    21 .. 40PlayerTextDrawSetStringplayeridspeedometerplayerid ][ ], "~g~IIIIII" );
            case 
    41 .. 60PlayerTextDrawSetStringplayeridspeedometerplayerid ][ ], "~g~IIIIIIIII" );
            case 
    61 .. 80PlayerTextDrawSetStringplayeridspeedometerplayerid ][ ], "~g~IIIIIIIII~y~III" );
            case 
    81 .. 100PlayerTextDrawSetStringplayeridspeedometerplayerid ][ ], "~g~IIIIIIIII~y~IIIIII" );
            case 
    101 .. 120PlayerTextDrawSetStringplayeridspeedometerplayerid ][ ], "~g~IIIIIIIII~y~IIIIIIIII" );
            case 
    121 .. 140PlayerTextDrawSetStringplayeridspeedometerplayerid ][ ], "~g~IIIIIIIII~y~IIIIIIIII~r~III" );
            case 
    141 .. 160PlayerTextDrawSetStringplayeridspeedometerplayerid ][ ], "~g~IIIIIIIII~y~IIIIIIIII~r~IIIIII" );
            case 
    161 .. 180PlayerTextDrawSetStringplayeridspeedometerplayerid ][ ], "~g~IIIIIIIII~y~IIIIIIIII~r~IIIIIIIII" );
            case 
    181 .. 195PlayerTextDrawSetStringplayeridspeedometerplayerid ][ ], "~g~IIIIIIIII~y~IIIIIIIII~r~IIIIIIIIIIIII" );
        }

    PHP код:
    stock SpeedVehicleplayerid )
    {
        new 
    FloatVelocity];
        if( 
    IsPlayerInAnyVehicleplayerid ) ) GetVehicleVelocityGetPlayerVehicleIDplayerid ), Velocity], Velocity], Velocity] );
        else 
    GetVehicleVelocityplayeridVelocity], Velocity], Velocity] );
        return 
    floatroundfloatsqroot( ( Velocity] * Velocity] ) + ( Velocity] * Velocity] ) + ( Velocity] * Velocity] ) ) * 195 );


  2. #2
    Аватар для L0ndl3m
    Пользователь

    Статус
    Оффлайн
    Регистрация
    19.10.2013
    Адрес
    Ярославль
    Сообщений
    1,366
    Репутация:
    774 ±
    Код:
    GetVehicleVelocity( playerid, Velocity[ 0 ], Velocity[ 1 ], Velocity[ 2 ] );
    ???

    - - - Добавлено - - -

    PHP код:
    if( oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER 
    на
    PHP код:
    if (newstate == PLAYER_STATE_DRIVER 
    И вместо else:
    PHP код:
    else if (oldstate == PLAYER_STATE_DRIVER

  3. Пользователь сказал cпасибо:
    Nurick (13.06.2016)
  4. #3
    Аватар для Nurick
    Пользователь

    Статус
    Оффлайн
    Регистрация
    19.04.2014
    Адрес
    Уфа, Россия
    Сообщений
    319
    Репутация:
    52 ±
    Всё равно такой же эффект, сажусь в ТС открываются все боксы спидометра но не функционирует stock SpeedVehicle( playerid )
    Нет отображения этого индикатора:
    PHP код:
    switch( SpeedVehicleplayerid ) ) 
        { 
            case 
    .. 1PlayerTextDrawSetStringplayeridspeedometerplayerid ][ ], "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIII" ); 
            case 
    .. 20PlayerTextDrawSetStringplayeridspeedometerplayerid ][ ], "~g~III" ); 
            case 
    21 .. 40PlayerTextDrawSetStringplayeridspeedometerplayerid ][ ], "~g~IIIIII" ); 
            case 
    41 .. 60PlayerTextDrawSetStringplayeridspeedometerplayerid ][ ], "~g~IIIIIIIII" ); 
            case 
    61 .. 80PlayerTextDrawSetStringplayeridspeedometerplayerid ][ ], "~g~IIIIIIIII~y~III" ); 
            case 
    81 .. 100PlayerTextDrawSetStringplayeridspeedometerplayerid ][ ], "~g~IIIIIIIII~y~IIIIII" ); 
            case 
    101 .. 120PlayerTextDrawSetStringplayeridspeedometerplayerid ][ ], "~g~IIIIIIIII~y~IIIIIIIII" ); 
            case 
    121 .. 140PlayerTextDrawSetStringplayeridspeedometerplayerid ][ ], "~g~IIIIIIIII~y~IIIIIIIII~r~III" ); 
            case 
    141 .. 160PlayerTextDrawSetStringplayeridspeedometerplayerid ][ ], "~g~IIIIIIIII~y~IIIIIIIII~r~IIIIII" ); 
            case 
    161 .. 180PlayerTextDrawSetStringplayeridspeedometerplayerid ][ ], "~g~IIIIIIIII~y~IIIIIIIII~r~IIIIIIIII" ); 
            case 
    181 .. 195PlayerTextDrawSetStringplayeridspeedometerplayerid ][ ], "~g~IIIIIIIII~y~IIIIIIIII~r~IIIIIIIIIIIII" ); 
        } 
    PHP код:
        speedometerplayerid ][ ] = CreatePlayerTextDrawplayerid449.375000354.083312"_" );
        
    PlayerTextDrawLetterSizeplayeridspeedometerplayerid ][ ], 0.4499991.600000 );
        
    PlayerTextDrawTextSizeplayeridspeedometerplayerid ][ ], 618.750000, -6.416663 );
        
    PlayerTextDrawColorplayeridspeedometerplayerid ][ ], 0x000000AA );
        
    PlayerTextDrawFontplayeridspeedometerplayerid ][ ], );
        
    PlayerTextDrawAlignmentplayeridspeedometerplayerid ][ ], );
        
    PlayerTextDrawUseBoxplayeridspeedometerplayerid ][ ], );
        
    PlayerTextDrawBoxColorplayeridspeedometerplayerid ][ ], 0x15171980 );
        
    PlayerTextDrawSetShadowplayeridspeedometerplayerid ][ ], ); 
    - - - Добавлено - - -


  5. #4
    Аватар для Nurick
    Пользователь

    Статус
    Оффлайн
    Регистрация
    19.04.2014
    Адрес
    Уфа, Россия
    Сообщений
    319
    Репутация:
    52 ±
    Задам тут же вопрос, вообще правильная формула скорости? или не правильна подсчитана она у меня:
    PHP код:
    stock SpeedVehicleplayerid )
    {
        new 
    FloatVelocity], vehicleid GetPlayerVehicleIDplayerid );
        if( 
    IsPlayerInAnyVehicleplayerid ) )
        {
            
    GetVehicleVelocityvehicleidVelocity], Velocity], Velocity] );
        }
        return 
    floatroundfloatsqroot( ( Velocity] * Velocity] ) + ( Velocity] * Velocity] ) + ( Velocity] * Velocity] ) ) * 195 );


 

 

Информация о теме

Пользователи, просматривающие эту тему

Эту тему просматривают: 1 (пользователей: 0 , гостей: 1)

Ваши права

  • Вы не можете создавать новые темы
  • Вы не можете отвечать в темах
  • Вы не можете прикреплять вложения
  • Вы не можете редактировать свои сообщения
  •