(FS) Отображение названия автомобиля с моделью

Готовые решения скриптов, filterScript

Модератор: SJplayer

Аватара
Автор темы
Layk M
Прапорщик
Прапорщик
Сообщения: 158
Репутация: 19
С нами: 5 лет 3 месяца

(FS) Отображение названия автомобиля с моделью

Сообщение #1 Layk » 18 октября 2017, 22:30

Изображение

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

#include <a_samp>

new PlayerText:BMShomy0[MAX_PLAYERS];
new PlayerText:BMShomy1[MAX_PLAYERS];
new PlayerText:BMShomy2[MAX_PLAYERS];

new VehicleFriendlyNames[212][] = {
    {"Landstalker"},{"Bravura"},{"Buffalo"},{"Linerunner"},{"Perrenial"},{"Sentinel"},
    {"Dumper"},{"Firetruck"},{"Trashmaster"},{"Stretch"},{"Manana"},{"Infernus"},{"Voodoo"},
    {"Pony"},{"Mule"},{"Cheetah"},{"Ambulance"},{"Leviathan"},{"Moonbeam"},{"Esperanto"},{"Taxi"},
    {"Washington"},{"Bobcat"},{"Mr. Whoopee"},{"BF. Injection"},{"Hunter"},{"Premier"},{"Enforcer"},
    {"Securicar"},{"Banshee"},{"Predator"},{"Bus"},{"Rhino"},{"Barracks"},{"Hotknife"},{"Article Trailer"},
    {"Previon"},{"Coach"},{"Cabbie"},{"Stallion"},{"Rumpo"},{"RC Bandit"},{"Romero"},{"Packer"},{"Monster"},
    {"Admiral"},{"Squalo"},{"Seasparrow"},{"Pizzaboy"},{"Tram"},{"Article Trailer 2"},{"Turismo"},{"Speeder"},
    {"Reefer"},{"Tropic"},{"Flatbed"},{"Yankee"},{"Caddy"},{"Solair"},{"Berkley's RC Van"},{"Skimmer"},
    {"PCJ-600"},{"Faggio"},{"Freeway"},{"RC Baron"},{"RC Raider"},{"Glendale"},{"Oceanic"},{"Sanchez"},
    {"Sparrow"},{"Patriot"},{"Quad"},{"Coastguard"},{"Dinghy"},{"Hermes"},{"Sabre"},{"Rustler"},{"ZR-350"},
    {"Walton"},{"Regina"},{"Comet"},{"BMX"},{"Burrito"},{"Camper"},{"Marquis"},{"Baggage"},{"Dozer"},
    {"Maverick"},{"News Chopper"},{"Rancher"},{"FBI Rancher"},{"Virgo"},{"Greenwood"},{"Jetmax"},{"Hotring"},
    {"Sandking"},{"Blista Compact"},{"Police Maverick"},{"Boxville"},{"Benson"},{"Mesa"},{"RC Goblin"},
    {"Hotring Racer A"},{"Hotring Racer B"},{"Bloodring Banger"},{"Rancher"},{"Super GT"},{"Elegant"},
    {"Journey"},{"Bike"},{"Mountain Bike"},{"Beagle"},{"Cropdust"},{"Stunt"},{"Tanker"},{"Roadtrain"},
    {"Nebula"},{"Majestic"},{"Buccaneer"},{"Shamal"},{"Hydra"},{"FCR-900"},{"NRG-500"},{"HPV1000"},
    {"Cement Truck"},{"Tow Truck"},{"Fortune"},{"Cadrona"},{"FBI Truck"},{"Willard"},{"Forklift"},
    {"Tractor"},{"Combine"},{"Feltzer"},{"Remington"},{"Slamvan"},{"Blade"},{"Freight"},{"Streak"},
    {"Vortex"},{"Vincent"},{"Bullet"},{"Clover"},{"Sadler"},{"Firetruck LA"},{"Hustler"},{"Intruder"},
    {"Primo"},{"Cargobob"},{"Tampa"},{"Sunrise"},{"Merit"},{"Utility"},{"Nevada"},{"Yosemite"},{"Windsor"},
    {"Monster A"},{"Monster B"},{"Uranus"},{"Jester"},{"Sultan"},{"Stratum"},{"Elegy"},{"Raindance"},
    {"RC Tiger"},{"Flash"},{"Tahoma"},{"Savanna"},{"Bandito"},{"Freight Flat"},{"Streak Carriage"},
    {"Kart"},{"Mower"},{"Dunerider"},{"Sweeper"},{"Broadway"},{"Tornado"},{"AT-400"},{"DFT-30"},{"Huntley"},
    {"Stafford"},{"BF-400"},{"Newsvan"},{"Tug"},{"Article Trailer 3"},{"Emperor"},{"Wayfarer"},{"Euros"},{"Mobile Hotdog"},
    {"Club"},{"Freight Carriage"},{"Trailer 3"},{"Andromada"},{"Dodo"},{"RC Cam"},{"Launch"},{"Police Car (LSPD)"},
    {"Police Car (SFPD)"},{"Police Car (LVPD)"},{"Police Ranger"},{"Picador"},{"S.W.A.T Van"},{"Alpha"},
    {"Phoenix"},{"Glendale"},{"Sadler"},{"Luggage Trailer A"},{"Luggage Trailer B"},{"Stair Trailer"},
    {"Boxville"},{"Farm Plow"},{"Utility Trailer"}
};

stock GetVehicleFriendlyName(vehicleid)
{
    new GVFNstring[56];
    format(GVFNstring, sizeof(GVFNstring), VehicleFriendlyNames[GetVehicleModel(vehicleid)-400]);
    return GVFNstring;
}
stock GetVehicleSpeed(vehicleid)
{
    new Float:xPos[3];
    GetVehicleVelocity(vehicleid, xPos[0], xPos[1], xPos[2]);
    return floatround(floatsqroot(xPos[0] * xPos[0] + xPos[1] * xPos[1] + xPos[2] * xPos[2]) * 170.00);
}

public OnPlayerConnect(playerid)
{
    BMShomy0[playerid] = CreatePlayerTextDraw(playerid, 480.941009, 317.916717, "New Textdraw");
    PlayerTextDrawLetterSize(playerid, BMShomy0[playerid], 0.449999, 1.600000);
    PlayerTextDrawTextSize(playerid, BMShomy0[playerid], 159.058807, 114.916671);
    PlayerTextDrawAlignment(playerid, BMShomy0[playerid], 1);
    PlayerTextDrawColor(playerid, BMShomy0[playerid], -1);
    PlayerTextDrawUseBox(playerid, BMShomy0[playerid], true);
    PlayerTextDrawBoxColor(playerid, BMShomy0[playerid], 0);
    PlayerTextDrawSetShadow(playerid, BMShomy0[playerid], 0);
    PlayerTextDrawSetOutline(playerid, BMShomy0[playerid], 1);
    PlayerTextDrawFont(playerid, BMShomy0[playerid], 5);
    PlayerTextDrawSetProportional(playerid, BMShomy0[playerid], 1);

    BMShomy1[playerid] = CreatePlayerTextDraw(playerid, 517.646972, 402.500000, "Speed: 250km/h");
    PlayerTextDrawLetterSize(playerid, BMShomy1[playerid], 0.326705, 1.255833);
    PlayerTextDrawAlignment(playerid, BMShomy1[playerid], 1);
    PlayerTextDrawColor(playerid, BMShomy1[playerid], -1);
    PlayerTextDrawSetShadow(playerid, BMShomy1[playerid], 0);
    PlayerTextDrawSetOutline(playerid, BMShomy1[playerid], 1);
    PlayerTextDrawBackgroundColor(playerid, BMShomy1[playerid], 51);
    PlayerTextDrawFont(playerid, BMShomy1[playerid], 2);
    PlayerTextDrawSetProportional(playerid, BMShomy1[playerid], 1);

    BMShomy2[playerid] = CreatePlayerTextDraw(playerid, 518.646911, 337.000030, "Infernus");
    PlayerTextDrawLetterSize(playerid, BMShomy2[playerid], 0.326705, 1.255833);
    PlayerTextDrawAlignment(playerid, BMShomy2[playerid], 1);
    PlayerTextDrawColor(playerid, BMShomy2[playerid], -1);
    PlayerTextDrawSetShadow(playerid, BMShomy2[playerid], 0);
    PlayerTextDrawSetOutline(playerid, BMShomy2[playerid], 1);
    PlayerTextDrawBackgroundColor(playerid, BMShomy2[playerid], 51);
    PlayerTextDrawFont(playerid, BMShomy2[playerid], 2);
    PlayerTextDrawSetProportional(playerid, BMShomy2[playerid], 1);

    return 1;
}
public OnPlayerUpdate(playerid)
{
    if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new vid = GetPlayerVehicleID(playerid);
        new Float:fPos[3], Float:fSpeed;
        new speed[128];
        new model[128];
        GetVehicleVelocity(GetPlayerVehicleID(playerid), fPos[0], fPos[1], fPos[2]);
        fSpeed = floatsqroot(floatpower(fPos[0], 2) + floatpower(fPos[1], 2) + floatpower(fPos[2], 2)) * 200;
        new Float:alpha = 320 - fSpeed;
        if(alpha < 60) alpha = 60;
        PlayerTextDrawShow(playerid, BMShomy0[playerid]);
        PlayerTextDrawShow(playerid, BMShomy1[playerid]);
        PlayerTextDrawShow(playerid, BMShomy2[playerid]);
        format(speed,sizeof(speed), "Speed: %dkm/h", GetVehicleSpeed(vid));
        PlayerTextDrawSetString(playerid, BMShomy1[playerid], speed);
        format(model,sizeof(model), "%s", GetVehicleFriendlyName(vid));
        PlayerTextDrawSetString(playerid, BMShomy2[playerid], model);
        PlayerTextDrawSetPreviewModel(playerid, BMShomy0[playerid], GetVehicleModel( GetPlayerVehicleID(playerid) ));
        PlayerTextDrawSetPreviewRot(playerid, BMShomy0[playerid], 0.000000, 0.000000, 30.000000, 1.000000);
        PlayerTextDrawSetPreviewVehCol(playerid, BMShomy0[playerid], -1, -1);
        PlayerTextDrawBackgroundColor(playerid, BMShomy0[playerid], 0x00000000);
    }
    else
    
{
        PlayerTextDrawHide(playerid, BMShomy0[playerid]);
        PlayerTextDrawHide(playerid, BMShomy1[playerid]);
        PlayerTextDrawHide(playerid, BMShomy2[playerid]);
    }
Изображение

! ! !


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

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

Кто сейчас на форуме

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