Доступ к готовым решениям

Переход в группу "Пользователь"

300.00 ₽
Одноразовый платёж
Быстрый переход в группу "Пользователи", без надобности написания постов и ожидания.

Покупка дает возможность:
Быть полноправным участником форума
Нормальное копирование кода
Создавать темы
Скачивать файлы
Доступ к архиву Pawno-Info

Мануал Спидометр

Статус
В этой теме нельзя размещать новые ответы.

Ruslan_Catton

Умник
ко всем new
PHP:
new VehicleNames[212][] =
{
    "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel",
    "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus",
    "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam",
    "Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection",
    "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus",
    "Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie",
    "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral",
    "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "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", "Maverick", "Boxvillde", "Benson", "Mesa", "RC Goblin",
    "Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher", "Super GT",
    "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "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", "Hustler", "Intruder", "Primo",
    "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite",
    "Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratium",
    "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito",
    "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper",
    "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400",
    "News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
    "Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car",
    "Police Car", "Police Car", "Police Ranger", "Picador", "S.W.A.T", "Alpha",
    "Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville",
    "Tiller", "Utility Trailer"
};
new SpeedoTime[MAX_PLAYERS];
new Text:Textdraw[5][MAX_PLAYERS];
new PlayerText:Speed[7][MAX_PLAYERS];
в public OnPlayerDisconnect(playerid, reason)
PHP:
	KillTimer(SpeedoTime[playerid]);
	for(new i = 0; i < 7; i++) PlayerTextDrawDestroy(playerid, Speed[i][playerid]);
	for(new i = 0; i < 5; i++) TextDrawDestroy(Textdraw[i][playerid]);
в if(newstate == PLAYER_STATE_DRIVER) (вход в кар)
PHP:
		SpeedoTime[playerid] = SetTimer("UpdateSpeedometr", 200, 1);
        for(new i = 0; i < 7; i++) PlayerTextDrawShow(playerid, Speed[i][playerid]);
	    for(new i = 0; i < 5; i++) TextDrawShowForPlayer(playerid, Textdraw[i][playerid]);
в if(newstate == PLAYER_STATE_ONFOOT) (выход с кара)
PHP:
	    KillTimer(SpeedoTime[playerid]);
        for(new i = 0; i < 7; i++) PlayerTextDrawHide(playerid, Speed[i][playerid]);
		for(new i = 0; i < 5; i++) TextDrawHideForPlayer(playerid, Textdraw[i][playerid]);
в public OnPlayerConnect(playerid)
PHP:
LoadTextDraws(playerid);
в конец мода
PHP:
stock LoadTextDraws(playerid)
{
    Textdraw[0][playerid] = TextDrawCreate(640.799987, 324.557769, "usebox");
	TextDrawLetterSize(Textdraw[0][playerid], 0.000000, 8.643335);
	TextDrawTextSize(Textdraw[0][playerid], 456.399993, 0.000000);
	TextDrawAlignment(Textdraw[0][playerid], 1);
	TextDrawColor(Textdraw[0][playerid], 0);
	TextDrawUseBox(Textdraw[0][playerid], true);
	TextDrawBoxColor(Textdraw[0][playerid], 102);
	TextDrawSetShadow(Textdraw[0][playerid], 0);
	TextDrawSetOutline(Textdraw[0][playerid], 0);
	TextDrawFont(Textdraw[0][playerid], 0);

	Textdraw[1][playerid] = TextDrawCreate(460.000091, 340.977874, "SPEED:");
	TextDrawLetterSize(Textdraw[1][playerid], 0.449999, 1.600000);
	TextDrawAlignment(Textdraw[1][playerid], 1);
	TextDrawColor(Textdraw[1][playerid], -1);
	TextDrawSetShadow(Textdraw[1][playerid], 0);
	TextDrawSetOutline(Textdraw[1][playerid], 1);
	TextDrawBackgroundColor(Textdraw[1][playerid], 51);
	TextDrawFont(Textdraw[1][playerid], 2);
	TextDrawSetProportional(Textdraw[1][playerid], 1);

	Textdraw[2][playerid] = TextDrawCreate(565.599975, 324.557769, "usebox");
	TextDrawLetterSize(Textdraw[2][playerid], 0.000000, 8.588024);
	TextDrawTextSize(Textdraw[2][playerid], 561.200012, 0.000000);
	TextDrawAlignment(Textdraw[2][playerid], 1);
	TextDrawColor(Textdraw[2][playerid], 0);
	TextDrawUseBox(Textdraw[2][playerid], true);
	TextDrawBoxColor(Textdraw[2][playerid], 102);
	TextDrawSetShadow(Textdraw[2][playerid], 0);
	TextDrawSetOutline(Textdraw[2][playerid], 0);
	TextDrawFont(Textdraw[2][playerid], 0);

	Textdraw[3][playerid] = TextDrawCreate(640.800048, 323.562225, "usebox");
	TextDrawLetterSize(Textdraw[3][playerid], 0.000000, -1.201605);
	TextDrawTextSize(Textdraw[3][playerid], 456.399993, 0.000000);
	TextDrawAlignment(Textdraw[3][playerid], 1);
	TextDrawColor(Textdraw[3][playerid], 0);
	TextDrawUseBox(Textdraw[3][playerid], true);
	TextDrawBoxColor(Textdraw[3][playerid], 8388863);
	TextDrawSetShadow(Textdraw[3][playerid], 0);
	TextDrawSetOutline(Textdraw[3][playerid], 0);
	TextDrawFont(Textdraw[3][playerid], 0);

	Textdraw[4][playerid] = TextDrawCreate(640.999938, 413.664520, "usebox");
	TextDrawLetterSize(Textdraw[4][playerid], 0.000000, -1.161605);
	TextDrawTextSize(Textdraw[4][playerid], 456.399963, 0.000000);
	TextDrawAlignment(Textdraw[4][playerid], 1);
	TextDrawColor(Textdraw[4][playerid], 0);
	TextDrawUseBox(Textdraw[4][playerid], true);
	TextDrawBoxColor(Textdraw[4][playerid], 8388863);
	TextDrawSetShadow(Textdraw[4][playerid], 0);
	TextDrawSetOutline(Textdraw[4][playerid], 0);
	TextDrawFont(Textdraw[4][playerid], 0);
	
	Speed[0][playerid] = CreatePlayerTextDraw(playerid, 460.400054, 298.168884, "_");//namecar
	PlayerTextDrawLetterSize(playerid,Speed[0][playerid], 0.449999, 1.600000);
	PlayerTextDrawAlignment(playerid,Speed[0][playerid], 1);
	PlayerTextDrawColor(playerid,Speed[0][playerid], -1);
	PlayerTextDrawUseBox(playerid,Speed[0][playerid], true);
	PlayerTextDrawBoxColor(playerid,Speed[0][playerid], 0);
	PlayerTextDrawSetShadow(playerid,Speed[0][playerid], 0);
	PlayerTextDrawSetOutline(playerid,Speed[0][playerid], 1);
	PlayerTextDrawBackgroundColor(playerid,Speed[0][playerid], 51);
	PlayerTextDrawFont(playerid,Speed[0][playerid], 0);
	PlayerTextDrawSetProportional(playerid,Speed[0][playerid], 1);

	Speed[1][playerid] = CreatePlayerTextDraw(playerid, 459.599822, 370.844329, "_");//llllllllllllllllllllll
	PlayerTextDrawLetterSize(playerid,Speed[1][playerid], 0.449999, 1.600000);
	PlayerTextDrawAlignment(playerid,Speed[1][playerid], 1);
	PlayerTextDrawColor(playerid,Speed[1][playerid], -1);
	PlayerTextDrawSetShadow(playerid,Speed[1][playerid], 0);
	PlayerTextDrawSetOutline(playerid,Speed[1][playerid], 1);
	PlayerTextDrawBackgroundColor(playerid,Speed[1][playerid], 51);
	PlayerTextDrawFont(playerid,Speed[1][playerid], 1);
	PlayerTextDrawSetProportional(playerid,Speed[1][playerid], 1);

	Speed[2][playerid] = CreatePlayerTextDraw(playerid, 528.799804, 340.977752, "_");//spped
	Speed[3][playerid] = CreatePlayerTextDraw(playerid, 566.000000, 325.546691, "_");//fuel
	Speed[4][playerid] = CreatePlayerTextDraw(playerid, 566.199951, 386.279907, "_");//health
	Speed[5][playerid] = CreatePlayerTextDraw(playerid, 566.800109, 344.462280, "_");//engine
	Speed[6][playerid] = CreatePlayerTextDraw(playerid, 566.600097, 365.373321, "_");//lock
	for(new i = 2; i < 7; i++)
	{
		PlayerTextDrawLetterSize(playerid,Speed[i][playerid], 0.449999, 1.600000);
		PlayerTextDrawAlignment(playerid,Speed[i][playerid], 1);
		PlayerTextDrawColor(playerid,Speed[i][playerid], -1);
		PlayerTextDrawSetShadow(playerid,Speed[i][playerid], 0);
		PlayerTextDrawSetOutline(playerid,Speed[i][playerid], 1);
		PlayerTextDrawBackgroundColor(playerid,Speed[i][playerid], 51);
		PlayerTextDrawFont(playerid,Speed[i][playerid], 2);
		PlayerTextDrawSetProportional(playerid,Speed[i][playerid], 1);
    }
}
publics: UpdateSpeedometr(playerid)
{
    foreach(Player,i)
    {
        new string[128];
        new ExLock[10];
        new ExEngine[10];
        new Float:carhealth;
        new carid = GetPlayerVehicleID(i);
        GetVehicleHealth(carid,carhealth);
        if(IsLocked[carid] == 0) ExLock = "L:~r~OFF"; //меняем на своё
        else ExLock = "L:~g~ON";
        if(zavodis[playerid] == 0) ExEngine = "E:~r~OFF";//меняем на своё
        else
        {
            ExEngine = "E:~g~ON";
            Fuell[carid] -= 0.01;//меняем на своё
        }
        if(Fuell[carid] == 0.01)//меняем на своё
        {
            Fuell[carid] = 0.00;
            GetVehicleParamsEx(carid, engine, lights, alarm, doors, bonnet, boot, objective);
            EngineState[carid] = false;
            SetVehicleParamsEx(carid, false, lights, alarm, doors, bonnet, boot, objective);
            SendClientMessage(i, COLOR_RED, "В вашей машине закончился бензин!");
        }
        format(string, sizeof(string), "%s", ExLock);
        PlayerTextDrawSetString(playerid, Speed[6][i], string);
        format(string, sizeof(string), "%d", SpeedVehicle(i));
        PlayerTextDrawSetString(playerid, Speed[2][i], string);
        format(string, sizeof(string), "%s", VehicleNames[GetVehicleModel(carid)-400]);
        PlayerTextDrawSetString(playerid, Speed[0][i], string);
        format(string, sizeof(string), "%s", ExEngine);
        PlayerTextDrawSetString(playerid, Speed[5][i], string);
        format(string, sizeof(string), "H:%.0f", carhealth / 10);
        PlayerTextDrawSetString(playerid, Speed[4][i], string);
   	    switch(SpeedVehicle(playerid))
	    {
	        case 0..4: PlayerTextDrawSetString(playerid, Speed[1][i],"");
	        case 5..10: PlayerTextDrawSetString(playerid, Speed[1][i],"~w~~h~l");
	        case 11..25: PlayerTextDrawSetString(playerid, Speed[1][i],"~w~~h~ll");
	        case 26..35: PlayerTextDrawSetString(playerid, Speed[1][i],"~w~~h~lll");
	        case 36..70: PlayerTextDrawSetString(playerid, Speed[1][i],"~w~~h~llll");
	        case 71..85: PlayerTextDrawSetString(playerid, Speed[1][i],"~w~~h~lllll");
	        case 86..95: PlayerTextDrawSetString(playerid, Speed[1][i],"~w~~h~lllll~g~l");
	        case 96..105: PlayerTextDrawSetString(playerid, Speed[1][i],"~w~~h~lllll~g~ll");
	        case 106..115: PlayerTextDrawSetString(playerid, Speed[1][i],"~w~~h~lllll~g~lll");
	        case 116..120: PlayerTextDrawSetString(playerid, Speed[1][i],"~w~~h~lllll~g~llll");
	        case 121..125: PlayerTextDrawSetString(playerid, Speed[1][i],"~w~~h~lllll~g~lllll");
	        case 126..130: PlayerTextDrawSetString(playerid, Speed[1][i],"~w~~h~lllll~g~llllll");
	        case 131..140: PlayerTextDrawSetString(playerid, Speed[1][i],"~w~~h~lllll~g~llllll~y~~h~l");
	        case 141..145: PlayerTextDrawSetString(playerid, Speed[1][i],"~w~~h~lllll~g~llllll~y~~h~ll");
	        case 146..155: PlayerTextDrawSetString(playerid, Speed[1][i],"~w~~h~lllll~g~llllll~y~~h~lll");
	        case 156..160: PlayerTextDrawSetString(playerid, Speed[1][i],"~w~~h~lllll~g~llllll~y~~h~llll");
	        case 161..165: PlayerTextDrawSetString(playerid, Speed[1][i],"~w~~h~lllll~g~llllll~y~~h~lllll");
	        case 170..180: PlayerTextDrawSetString(playerid, Speed[1][i],"~w~~h~lllll~g~llllll~y~~h~lllll~r~~h~~h~l");
	        case 181..185: PlayerTextDrawSetString(playerid, Speed[1][i],"~w~~h~lllll~g~llllll~y~~h~lllll~r~~h~~h~ll");
	        case 186..190: PlayerTextDrawSetString(playerid, Speed[1][i],"~w~~h~lllll~g~llllll~y~~h~lllll~r~~h~~h~lll");
	        case 191..195: PlayerTextDrawSetString(playerid, Speed[1][i],"~w~~h~lllll~g~llllll~y~~h~lllll~r~~h~~h~llll");
	        case 196..200: PlayerTextDrawSetString(playerid, Speed[1][i],"~w~~h~lllll~g~llllll~y~~h~lllll~r~~h~~h~lllll");
	        case 201..230: PlayerTextDrawSetString(playerid, Speed[1][i],"~w~~h~lllll~g~llllll~y~~h~lllll~r~~h~~h~llllll");
	    }
   	    if(Fuell[carid] > 150.0)//меняем на своё
	    {
		    format(string, sizeof(string), "F:~g~%.0f", Fuell[carid]);//меняем на своё
		    PlayerTextDrawSetString(playerid, Speed[3][i], string);
		}
		else if(Fuell[carid] > 50.0 && Fuell[carid] < 150.0)//меняем на своё
		{
		    format(string, sizeof(string), "F:~y~%.0f", Fuell[carid]);//меняем на своё
		    PlayerTextDrawSetString(playerid, Speed[3][i], string);
		}
		else if(Fuell[carid] < 50.0)//меняем на своё
		{
		    format(string, sizeof(string), "F:~r~%.0f", Fuell[carid]);//меняем на своё
		    PlayerTextDrawSetString(playerid, Speed[3][i], string);
		}
    }
    return true;
}
Скрин самого спидометра

Если что не так пишите исправлю.
 
Последнее редактирование:
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу