Вопросы

Дарвин
Свой человек

Здравствуйте Ув.Скриптеры PAWNO-RUS, при смене спидометра наткнулся на ошибку с работой спидометра.

При зажигании должна светится кнопка что автомобиль завёлся но она не загорается.

Прошу помочь ибо весь мозг сломал. Заранее спасибо!

p.s даже не знаю что скидывать.

 

Спойлер

forward UpdateSpeedometr(playerid);
public UpdateSpeedometr(playerid)
{
	if(PI[playerid][pAFK] >= 3 && GetPlayerState(playerid) != 2) return 1;
	new vehicleid = GetPlayerVehicleID(playerid);
	if(IsAPlane(vehicleid)==1 || IsABoat(vehicleid)==1 || IsAMoped(vehicleid)==1 || IsAVel(vehicleid)==1) return 1;
    new str[100];
    new speed = SpeedVehicle(playerid)/2;
    
	format(str, sizeof(str),"%d",speed);
	PlayerTextDrawSetString(playerid,SpeedPlayerText[playerid][1],str);
	
	format(str, sizeof(str),"%d‡.",Fuel[vehicleid]);
	PlayerTextDrawSetString(playerid,SpeedPlayerText[playerid][6],str);

	new Float:health, heal;
    GetVehicleHealth(GetPlayerVehicleID(playerid), health);
    
    heal = floatround(health);
	format(str, sizeof(str),"%d%",heal/10);
	PlayerTextDrawSetString(playerid,SpeedPlayerText[playerid][5],str);

    if(IsVehicleDrivingBackwards(vehicleid)) format(str,sizeof(str),"~r~R");
    else
    {
        switch(SpeedVehicle(playerid)/2)
        {
	 		case 0: format(str,sizeof(str),"N");
	   		case 1..40: format(str,sizeof(str),"1");
		    case 41..60: format(str,sizeof(str),"2");
	   		case 61..80: format(str,sizeof(str),"3");
		    case 81..100: format(str,sizeof(str),"4");
		    case 101..119: format(str,sizeof(str),"5");
		    case 120..200: format(str,sizeof(str),"6");
		    default: format(str,sizeof(str),"6");
	   	}
    }
	PlayerTextDrawSetString(playerid,SpeedPlayerText[playerid][7],str);
	switch(SpeedVehicle(playerid)/2)
	{
	    case 0: format(str,sizeof(str),"~r~I");
	    case 1..2: format(str,sizeof(str),"~g~I~r~I~g~I");
	    case 3..4: format(str,sizeof(str),"~g~II~r~I~g~II");
	    case 5..6: format(str,sizeof(str),"~g~III~r~I~g~III");
	    case 7..8: format(str,sizeof(str),"~g~IIII~r~I~g~IIII");
	    case 9..10: format(str,sizeof(str),"~g~IIIII~r~I~g~IIIII");
	    case 11..12: format(str,sizeof(str),"~g~IIIIII~r~I~g~IIIIII");
	    case 13..14: format(str,sizeof(str),"~g~IIIIIII~r~I~g~IIIIIII");
	    case 15..16: format(str,sizeof(str),"~g~IIIIIIII~r~I~g~IIIIIIII");
	    case 17..18: format(str,sizeof(str),"~g~IIIIIIIII~r~I~g~IIIIIIIII");
	    case 19..20: format(str,sizeof(str),"~g~IIIIIIIIII~r~I~g~IIIIIIIIII");
	    case 21..22: format(str,sizeof(str),"~g~IIIIIIIIIII~r~I~g~IIIIIIIIIII");
	    case 23..27: format(str,sizeof(str),"~g~IIIIIIIIIIII~r~I~g~IIIIIIIIIIII");
	    case 30..39: format(str,sizeof(str),"~g~IIIIIIIIIIIII~r~I~g~IIIIIIIIIIIII");
	    case 40..49: format(str,sizeof(str),"~g~IIIIIIIIIIIIII~r~I~g~IIIIIIIIIIIIII");
	    case 50..59: format(str,sizeof(str),"~g~IIIIIIIIIIIIIII~r~I~g~IIIIIIIIIIIIIII");
	    case 60..69: format(str,sizeof(str),"~g~IIIIIIIIIIIIIIII~r~I~g~IIIIIIIIIIIIIIII");
	    case 70..79: format(str,sizeof(str),"~g~IIIIIIIIIIIIIIIIII~r~I~g~IIIIIIIIIIIIIIIIII");
	    case 80..99: format(str,sizeof(str),"~g~IIIIIIIIIIIIIIIIIII~r~I~g~IIIIIIIIIIIIIIIIIII");
	    case 100..114: format(str,sizeof(str),"~g~IIIIIIIIIIIIIIIIIIII~r~I~g~IIIIIIIIIIIIIIIIIIII");
	    case 115..150: format(str,sizeof(str),"~g~IIIIIIIIIIIIIIIIIIIII~r~I~g~IIIIIIIIIIIIIIIIIIIII");
	    default: format(str,sizeof(str),"~g~IIIIIIIIIIIIIIIIIIIIII~r~I~g~IIIIIIIIIIIIIIIIIIIIII");
	}
	PlayerTextDrawSetString(playerid,SpeedPlayerText[playerid][0],str);
	//
	if(IsPlayerInRangeOfPoint(playerid,1000.0,212.3771,1107.2368,11.8931)) format(str,sizeof(str),"‚. APˆAMAC");
	else if(IsPlayerInRangeOfPoint(playerid,800.0,2276.9167,-2250.7302,21.9398)) format(str,sizeof(str),"‚. ”„®‘†");
	else if(IsPlayerInRangeOfPoint(playerid,550.0,1890.0614,2049.2754,15.8676)) format(str,sizeof(str),"Œ‚T. €AT‘PEBO");
	else if(IsPlayerInRangeOfPoint(playerid,550.0,-275.7231,-1322.1150,40.8400)) format(str,sizeof(str),"Œ‚¦. €YCAE‹O");
    else format(str,sizeof(str),"H…„E‚OPOƒCKA• O—‡AC¦’");
	PlayerTextDrawSetString(playerid,SpeedPlayerText[playerid][8],str);


	if(isLocked[GetPlayerVehicleID(playerid)] == true)
	{
	    PlayerTextDrawColor(playerid, SpeedPlayerText[playerid][4], 0xE3C722FF);
	    PlayerTextDrawShow(playerid, SpeedPlayerText[playerid][4]);
	}
	else
	{
	    PlayerTextDrawColor(playerid, SpeedPlayerText[playerid][4], 0xFA1818FF);
	    PlayerTextDrawShow(playerid, SpeedPlayerText[playerid][4]);
	}
	if(Engine[GetPlayerVehicleID(playerid)] == false)
	{
	    PlayerTextDrawColor(playerid, SpeedPlayerText[playerid][2], 0xFA1818FF);
	    PlayerTextDrawShow(playerid, SpeedPlayerText[playerid][2]);
	}
	else
	{
	    PlayerTextDrawColor(playerid, SpeedPlayerText[playerid][2], 0x1CAD0FFF);
	    PlayerTextDrawShow(playerid, SpeedPlayerText[playerid][2]);
	}

	if(Lights[GetPlayerVehicleID(playerid)] == false)
	{
	    PlayerTextDrawColor(playerid, SpeedPlayerText[playerid][3], 0xFA1818FF);
	    PlayerTextDrawShow(playerid, SpeedPlayerText[playerid][3]);
	}
	else
	{
	    PlayerTextDrawColor(playerid, SpeedPlayerText[playerid][3], 0x1CAD0FFF);
	    PlayerTextDrawShow(playerid, SpeedPlayerText[playerid][3]);
	}
	//
	return 1;
}

 

 

Отредактировано пользователем odosenok

Поделиться сообщением


Ссылка на сообщение

2 ответа на этот вопрос

  • 0
SCRIPTMAN
Великий Гуру

Вот участок кода, который за это отвечает:

if(Engine[GetPlayerVehicleID(playerid)] == false)
	{
	    PlayerTextDrawColor(playerid, SpeedPlayerText[playerid][2], 0xFA1818FF);
	    PlayerTextDrawShow(playerid, SpeedPlayerText[playerid][2]);
	}
	else
	{
	    PlayerTextDrawColor(playerid, SpeedPlayerText[playerid][2], 0x1CAD0FFF);
	    PlayerTextDrawShow(playerid, SpeedPlayerText[playerid][2]);
	}

Проверь, правильно ли указано название TD, который нужно менять.

И проверь, вообще, работает ли проверка, замени свой код на этот и скажи, что напишет в чат, и напишет ли вообще.

if(Engine[GetPlayerVehicleID(playerid)] == false)
	{
	    PlayerTextDrawColor(playerid, SpeedPlayerText[playerid][2], 0xFA1818FF);
	    PlayerTextDrawShow(playerid, SpeedPlayerText[playerid][2]);
		SendClientMessage(playerid, -1, "Транспорт заведен! TD не меняется");
	}
	else
	{
	    PlayerTextDrawColor(playerid, SpeedPlayerText[playerid][2], 0x1CAD0FFF);
	    PlayerTextDrawShow(playerid, SpeedPlayerText[playerid][2]);
        SendClientMessage(playerid, -1, "Транспорт заглушен! TD не меняется");
	}

 

Поделиться сообщением


Ссылка на сообщение
  • 0
Дарвин
Свой человек

@SCRIPTMAN, Здравствуйте. При старте двигателя пишется что транспорт заглушён и при заглушке тоже самое

Поделиться сообщением


Ссылка на сообщение
Гость
Эта тема закрыта для публикации ответов.
  • Последние посетители   0 пользователей онлайн

    Ни одного зарегистрированного пользователя не просматривает данную страницу

  • Похожий контент

    • patrickk
      От patrickk
      Всем привет, решил написать dm сервер и довольно хорошим получился, даже на голову выше Goat dm. Оставил не решенную проблему тем что  у меня есть 4 локации с rp run и cj run ну а как добавить cj бег на те локации не знаю и как эта система работает. Надеюсь мне помогут знающие люди
    • Samolet
      От Samolet
      Здраствуйте, cоздаю копию Arizona на ОМП, опен мультиплеер, загрузил и подключил бд, но сервер не хочет вот лог :[2026-10-20T21:03:32+0300] [Info] Log file reloaded. Starting open.mp server (1.5.8.3079) from commit c6759bd8d265171ae3d86598895a23d5a8d92a3b Loading component $CAPI.so Successfully loaded component C-API (1.5.8.3079) with UID 10467dd8d4c56fc6 Loading component LegacyConfig.so Successfully loaded component LegacyConfig (1.5.8.3079) with UID 24ef6216838f9ffc Loading component NPCs.so Successfully loaded component NPCs (1.5.8.3079) with UID 3d0e59e87f4e90bc Loading component Recordings.so Successfully loaded component Recordings (1.5.8.3079) with UID 871144d399f5f613 Loading component Checkpoints.so Successfully loaded component Checkpoints (1.5.8.3079) with UID 44a937350d611dde Loading component TextDraws.so Successfully loaded component TextDraws (1.5.8.3079) with UID 9b5dc2b1d15c992a Loading component Pawn.so Successfully loaded component Pawn (1.5.8.3079) with UID 78906cd9f19c36a6 Loading component GangZones.so Successfully loaded component GangZones (1.5.8.3079) with UID b3351d11ee8d8056 Loading component Actors.so Successfully loaded component Actors (1.5.8.3079) with UID c81ca021eae2ad5c Loading component Pickups.so Successfully loaded component Pickups (1.5.8.3079) with UID cf304faa363dd971 Loading component Dialogs.so Successfully loaded component Dialogs (1.5.8.3079) with UID 44a111350d611dde Loading component Objects.so Successfully loaded component Objects (1.5.8.3079) with UID 59f8415f72da6160 Loading component Console.so Successfully loaded component Console (1.5.8.3079) with UID bfa24e49d0c95ee4 Loading component TextLabels.so Successfully loaded component TextLabels (1.5.8.3079) with UID a0c57ea80a009742 Loading component Variables.so Successfully loaded component Variables (1.5.8.3079) with UID 75e121848bc01fa2 Loading component Databases.so Successfully loaded component Databases (1.5.8.3079) with UID 80092e7eb5821a96 Loading component LegacyNetwork.so Successfully loaded component RakNetLegacyNetwork (1.5.8.3079) with UID ea9799fd79cf8442 Loading component CustomModels.so Successfully loaded component CustomModels (1.5.8.3079) with UID 15e3cb1e7c77ffff Loading component Menus.so Successfully loaded component Menus (1.5.8.3079) with UID 621e219eb97ee0b2 Loading component Vehicles.so Successfully loaded component Vehicles (1.5.8.3079) with UID 3f1f62ee9e22ab19 Loading component Classes.so Successfully loaded component Classes (1.5.8.3079) with UID 8cfb3183976da208 Loading component Timers.so Successfully loaded component Timers (1.5.8.3079) with UID 2ad8124c5ea257a3 Loaded 22 component(s) from /home/gs113492/components Executing Server Config... [2026-10-20T21:03:33+0300] [Info] Loading plugin: crashdetect.so [2026-10-20T21:03:33+0300] [Info] CrashDetect plugin 4.19 [2026-10-20T21:03:33+0300] [Info] Loading plugin: mapandreas.so [2026-10-20T21:03:33+0300] [Info] Loading plugin: streamer.so [2026-10-20T21:03:33+0300] [Info] *** Streamer Plugin v2.9.4 by Incognito loaded *** [2026-10-20T21:03:33+0300] [Info] Loading plugin: sscanf.so [2026-10-20T21:03:33+0300] [Info] [2026-10-20T21:03:33+0300] [Info] =============================== [2026-10-20T21:03:33+0300] [Info] sscanf plugin loaded. [2026-10-20T21:03:33+0300] [Info] Version: 2.8.3 [2026-10-20T21:03:33+0300] [Info] (c) 2018 Alex "Y_Less" Cole [2026-10-20T21:03:33+0300] [Info] =============================== [2026-10-20T21:03:33+0300] [Info] Loading plugin: TOTP.so [2026-10-20T21:03:33+0300] [Info] TOTP plugin v1.0.1 by Games loaded. [2026-10-20T21:03:33+0300] [Info] Loading plugin: mysql_static.so [2026-10-20T21:03:33+0300] [Info] >> plugin.mysql: R39-6 successfully loaded. [2026-10-20T21:03:33+0300] [Info] Loading plugin: libpawn_json.so [2026-10-20T21:03:34+0300] [Error] Function not registered: YSF_SetTickRate [2026-10-20T21:03:34+0300] [Error] Function not registered: PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] Run time error 19: "File or function is not found" [2026-10-20T21:03:34+0300] [Info] [debug] PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] YSF_SetTickRate [2026-10-20T21:03:34+0300] [Error] File or function is not found [2026-10-20T21:03:34+0300] [Error] Function not registered: PC_RegAlias [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_GetWriteOffset [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_Reset [2026-10-20T21:03:34+0300] [Error] Function not registered: PR_RegHandler [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_Delete [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_New [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_ResetReadPointer [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_SetWriteOffset [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_IgnoreBits [2026-10-20T21:03:34+0300] [Error] Function not registered: PR_Init [2026-10-20T21:03:34+0300] [Error] Function not registered: PR_SendRPC [2026-10-20T21:03:34+0300] [Error] Function not registered: PR_SendPacket [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_WriteValue [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_GetNumberOfBytesUsed [2026-10-20T21:03:34+0300] [Error] Function not registered: BS_ReadValue [2026-10-20T21:03:34+0300] [Error] Function not registered: PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] Run time error 19: "File or function is not found" [2026-10-20T21:03:34+0300] [Info] [debug] PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] BS_ReadValue [2026-10-20T21:03:34+0300] [Info] [debug] BS_GetNumberOfBytesUsed [2026-10-20T21:03:34+0300] [Info] [debug] BS_WriteValue [2026-10-20T21:03:34+0300] [Info] [debug] PR_SendPacket [2026-10-20T21:03:34+0300] [Info] [debug] PR_SendRPC [2026-10-20T21:03:34+0300] [Info] [debug] PR_Init [2026-10-20T21:03:34+0300] [Info] [debug] BS_IgnoreBits [2026-10-20T21:03:34+0300] [Info] [debug] BS_SetWriteOffset [2026-10-20T21:03:34+0300] [Info] [debug] BS_ResetReadPointer [2026-10-20T21:03:34+0300] [Info] [debug] BS_New [2026-10-20T21:03:34+0300] [Info] [debug] BS_Delete [2026-10-20T21:03:34+0300] [Info] [debug] PR_RegHandler [2026-10-20T21:03:34+0300] [Info] [debug] BS_Reset [2026-10-20T21:03:34+0300] [Info] [debug] BS_GetWriteOffset [2026-10-20T21:03:34+0300] [Info] [debug] PC_RegAlias [2026-10-20T21:03:34+0300] [Error] File or function is not found [2026-10-20T21:03:34+0300] [Info] [debug] Run time error 19: "File or function is not found" [2026-10-20T21:03:34+0300] [Info] [debug] PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] YSF_SetTickRate [2026-10-20T21:03:34+0300] [Error] File or function is not found [2026-10-20T21:03:34+0300] [Info] [debug] Run time error 19: "File or function is not found" [2026-10-20T21:03:34+0300] [Info] [debug] PC_Init [2026-10-20T21:03:34+0300] [Info] [debug] BS_ReadValue [2026-10-20T21:03:34+0300] [Info] [debug] BS_GetNumberOfBytesUsed [2026-10-20T21:03:34+0300] [Info] [debug] BS_WriteValue [2026-10-20T21:03:34+0300] [Info] [debug] PR_SendPacket [2026-10-20T21:03:34+0300] [Info] [debug] PR_SendRPC [2026-10-20T21:03:34+0300] [Info] [debug] PR_Init [2026-10-20T21:03:34+0300] [Info] [debug] BS_IgnoreBits [2026-10-20T21:03:34+0300] [Info] [debug] BS_SetWriteOffset [2026-10-20T21:03:34+0300] [Info] [debug] BS_ResetReadPointer [2026-10-20T21:03:34+0300] [Info] [debug] BS_New [2026-10-20T21:03:34+0300] [Info] [debug] BS_Delete [2026-10-20T21:03:34+0300] [Info] [debug] PR_RegHandler [2026-10-20T21:03:34+0300] [Info] [debug] BS_Reset [2026-10-20T21:03:34+0300] [Info] [debug] BS_GetWriteOffset [2026-10-20T21:03:34+0300] [Info] [debug] PC_RegAlias [2026-10-20T21:03:34+0300] [Info] Legacy Network started on ***.**.**.***:2717. Помогите пожалуйста
       
    • defender_375
      От defender_375
      я зделал все что нужно по етой инструкции и запустил нажал Load а там красная ошибка что делать?
       
      Map Construction - программа для построения мапинга КР и др.
       
      Установка:
       
      Файлы background.txd, editor.exe, GTAINTERFACE.dll, newton.dll скопируйте в папку с игрой. Пример: C:\Program Files\GTA Criminal Russia
      Файл gta3.img скопируйте в папку с игрой\models с заменой. Пример: C:\Program Files\GTA Criminal Russia\models
      Файл water.dat скопируйте в папку с игрой\data с заменой. Пример: C:\Program Files\GTA Criminal Russia\data
       
      Для использования в Map Construction объекты 0.3e, установите в папку с игрой samp 0.3e
      Скачать MC можно тут