(FS) Спидометр (LINKINPARK)

Описание: Готовые решения скриптов, filterScript
Модератор: SJplayer

LILUS M
Автор темы, Старшина
Старшина
Аватара
LILUS M
Автор темы, Старшина
Старшина
Сообщения: 136
Зарегистрирован: 2 мая 2013
С нами: 10 лет 10 месяцев

#1 LILUS » 2 января 2015, 15:33

Автор: LINKINPARK

Изображение


Код: Выделить всё

#include a_samp

new
    Float: L_Pos[ 7 ],
     Text: mysp [ 14 ],
     Text: player_text [ MAX_PLAYERS ] ;

public OnFilterScriptInit()
{
    new
        count_ 
[ 14 ] = { 0, 20, ... }, format_ [ 4 ],
        color_red, color_green, Float: color_text = 100 ;
    for ( new i ; i != 14 ; ++ i )
    {
        L_Pos[ 3 ] = 320 - L_Pos [ 2 ] ;
        L_Pos [ 0 ] = 79.5 + ( 65.0 * floatsin ( L_Pos[ 3 ], degrees ) ),
            L_Pos [ 1 ] = 380.0 + ( 55.0 * floatcos ( L_Pos[ 3 ] , degrees ) ) ;
        format ( format_, 4, "%i", count_[ i ] ) ;
        mysp [ i ] = TextDrawCreate ( L_Pos [ 0 ], L_Pos [ 1 ], format_ ) ;
        TextDrawAlignment ( mysp[ i ],),
        color_red = floatround ( ( 100 - color_text ) * 2.55 ), color_green = floatround ( color_text * 2.55 ) ;
        TextDrawColor ( mysp[ i ], ( color_red * 0x1000000 ) + ( color_green * 0x10000 ) + 0xFF ) ;
        TextDrawSetOutline ( mysp [ i ], 1 ),
        TextDrawBackgroundColor ( mysp [ i ], 0x00000001 ),
        TextDrawSetProportional ( mysp [ i ], 1 ),
        TextDrawSetShadow ( mysp[ i ], 0 ),
        TextDrawFont ( mysp[ i ], 2 ) ,
        TextDrawLetterSize ( mysp[ i ], 0.3, 1.1 ) ;
        L_Pos [ 2 ] += 20.0, color_text -= 7.14 ;
    }
    print("--- Speedometer by: LINKINPARK ---");
    return 1;
}
public OnFilterScriptExit()
{
    for ( new i ; i != 14 ; ++ i )
        TextDrawDestroy ( mysp [ i ] ) ;
    return 1;
}
public OnPlayerConnect ( playerid )
{
    player_text [ playerid ] = TextDrawCreate( 0.0, 0.0, "." ) ;
    return 1 ;
}
public OnPlayerDisconnect ( playerid, reason )
{
    TextDrawDestroy ( player_text [ playerid ] ) ;
    return 1 ;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if ( newstate == PLAYER_STATE_DRIVER )
        for ( new i; i != 14 ; ++ i )
            TextDrawShowForPlayer ( playerid, mysp [ i ] ) ;
    else
    
{
        for ( new i ; i != 14 ; ++ i )
            TextDrawHideForPlayer ( playerid, mysp [] ) ;
        TextDrawHideForPlayer ( playerid, player_text [ playerid ] ) ;
    }
    return 1;
}
public OnPlayerUpdate(playerid)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER )
    {
        GetVehicleVelocity ( GetPlayerVehicleID ( playerid ), L_Pos [ 0 ], L_Pos [ 1 ], L_Pos [ 2 ] ) ;
        L_Pos [ 4 ] = floatsqroot ( floatpower( L_Pos [ 0 ], 2 ) + floatpower ( L_Pos [ 1 ], 2 ) +
            floatpower ( L_Pos [ 2 ], 2 ) ) * 180 ;
        L_Pos[ 6 ] = 320 - L_Pos [ 4 ] ;
        if( L_Pos[ 6 ] < 50 ) L_Pos[ 6 ] = 50 ;
        TextDrawHideForPlayer ( playerid, player_text [ playerid ] ), TextDrawDestroy ( player_text [ playerid ] ) ;
        L_Pos [ 4 ] = 83.5 + ( 55.0 * floatsin ( L_Pos[ 6 ], degrees ) ),
            L_Pos [ 5 ] = 360.0 + (45.0 * floatcos ( L_Pos[ 6 ] , degrees ) ) ;
        player_text [ playerid ] = TextDrawCreate( L_Pos [ 4 ], L_Pos [ 5 ], "." ) ;
        TextDrawFont ( player_text [ playerid ], 1 ) ;
        TextDrawLetterSize ( player_text [ playerid ], 0.890000, 3.299999 ) ;
        TextDrawColor ( player_text [ playerid ], 0xF87C21AA ) ;
        TextDrawSetOutline ( player_text [ playerid ], 0 ) ;
        TextDrawSetShadow ( player_text [ playerid ], 0);
        TextDrawShowForPlayer ( playerid, player_text [ playerid ] ) ;
    }
    return 1;
}


  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Скрипты / FS»

Кто сейчас на форуме (по активности за 5 минут)

Сейчас этот раздел просматривают: 8 гостей