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

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

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

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

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

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

Niko™

Умник
Вот решил выложить спидометр, рылся в компе, нашел:D
Автор: хз
​
Специально для Dron_Turbo​
Скриншот:
ко всем new:

PHP:
new Text:ModelShow[MAX_PLAYERS];
new Text:SpeedShow[MAX_PLAYERS];
new Text:HealthShow[MAX_PLAYERS];
new Text:FuelShow[MAX_PLAYERS];
new Text:StatusShow[MAX_PLAYERS];
new Text:EngineShow[MAX_PLAYERS];
new PlayerText:privcar[MAX_PLAYERS];
new	SpeedoTimer;
new str1[64],str2[64],str3[64],str4[64],str5[64],str6[64];
ко всем forward'am:
PHP:
forward UpdateSpeedometr();
OnGameModeInit:
PHP:
SpeedoTimer = SetTimer("UpdateSpeedometr", 120, true);// Обновление спидометра
GameModeExit:
PHP:
KillTimer(SpeedoTimer);
ко всем stock'am:
PHP:
stock IsAPlane(carid){switch(GetVehicleModel(carid)){case 592,577,511,512,593,520,553,476,519,460,513,548,417,487,488,497,563,447,469:return true;}return false;}
stock IsANoSpeed(carid){switch(GetVehicleModel(carid)){case 441,448,449,450,462,464,465,481,501,509,510,537,538,564,569,570,590,591,594,606,607,608,610,611:return true;}return false;}
stock IsABoat(carid){switch(GetVehicleModel(carid)){case 472,473,493,595,484,430,452..454,446:return true;}return false;}
в OnPlayerConnect:

PHP:
ModelShow[playerid] = TextDrawCreate(520.000000, 360.000000, "_");
    TextDrawBackgroundColor(ModelShow[playerid], COLOR_BLACK);
    TextDrawLetterSize(ModelShow[playerid],0.259999,1.010000);
    TextDrawFont(ModelShow[playerid], 2);
    TextDrawColor(ModelShow[playerid], COLOR_WHITE);
    TextDrawSetOutline(ModelShow[playerid], 1);
    TextDrawSetProportional(ModelShow[playerid],1);
    TextDrawSetShadow(ModelShow[playerid],1);

 	FuelShow[playerid] = TextDrawCreate(520.000000, 380.000000, "_");
    TextDrawBackgroundColor(FuelShow[playerid], COLOR_BLACK);
    TextDrawLetterSize(FuelShow[playerid],0.259999,1.010000);
    TextDrawFont(FuelShow[playerid], 2);
    TextDrawColor(FuelShow[playerid], COLOR_WHITE);
    TextDrawSetOutline(FuelShow[playerid], 1);
    TextDrawSetProportional(FuelShow[playerid],1);
    TextDrawSetShadow(FuelShow[playerid],1);

    privcar[playerid] = CreatePlayerTextDraw(playerid, 525.000000, 280.000000, "_");
    PlayerTextDrawFont(playerid, privcar[playerid], TEXT_DRAW_FONT_MODEL_PREVIEW);
    PlayerTextDrawUseBox(playerid, privcar[playerid], 0);
    PlayerTextDrawTextSize(playerid, privcar[playerid], 105.0, 100.0);
    PlayerTextDrawSetPreviewModel(playerid, privcar[playerid], 411);
    PlayerTextDrawSetPreviewRot(playerid, privcar[playerid], -10.0, 0.0, -20.0,0.8);
    PlayerTextDrawBackgroundColor(playerid, privcar[playerid], 0xFFFFFF00);

	SpeedShow[playerid] = TextDrawCreate(520.000000, 370.000000,"~g~SPEED: ~w~0km/h");
	TextDrawBackgroundColor(SpeedShow[playerid],COLOR_BLACK);
	TextDrawLetterSize(SpeedShow[playerid],0.259999,1.010000);
	TextDrawFont(SpeedShow[playerid],2);
	TextDrawColor(SpeedShow[playerid],COLOR_WHITE);
	TextDrawSetOutline(SpeedShow[playerid],1);
	TextDrawSetProportional(SpeedShow[playerid],1);
	TextDrawSetShadow(SpeedShow[playerid],1);

	HealthShow[playerid] = TextDrawCreate(520.000000, 390.000000,"0%");
	TextDrawBackgroundColor(HealthShow[playerid],COLOR_BLACK);
	TextDrawLetterSize(HealthShow[playerid],0.259999,1.010000);
	TextDrawFont(HealthShow[playerid],2);
	TextDrawColor(HealthShow[playerid],COLOR_WHITE);
	TextDrawSetOutline(HealthShow[playerid],1);
	TextDrawSetProportional(HealthShow[playerid],1);
	TextDrawSetShadow(HealthShow[playerid],1);

	StatusShow[playerid] = TextDrawCreate(520.000000, 400.000000, "_");
	TextDrawBackgroundColor(StatusShow[playerid], COLOR_BLACK);
	TextDrawLetterSize(StatusShow[playerid],0.259999,1.010000);
	TextDrawFont(StatusShow[playerid], 2);
	TextDrawColor(StatusShow[playerid], COLOR_WHITE);
	TextDrawSetOutline(StatusShow[playerid], 1);
	TextDrawSetProportional(StatusShow[playerid],1);
	TextDrawSetShadow(StatusShow[playerid],1);

	EngineShow[playerid] = TextDrawCreate(520.000000, 410.000000, "_");
	TextDrawBackgroundColor(EngineShow[playerid], COLOR_BLACK);
	TextDrawLetterSize(EngineShow[playerid],0.259999,1.010000);
	TextDrawFont(EngineShow[playerid], 2);
	TextDrawColor(EngineShow[playerid], COLOR_WHITE);
	TextDrawSetOutline(EngineShow[playerid], 1);
	TextDrawSetProportional(EngineShow[playerid],1);
	TextDrawSetShadow(EngineShow[playerid],1);
в OnPlayerStateChange:

PHP:
new tacha = GetPlayerVehicleID(playerid);
	if(newstate == PLAYER_STATE_DRIVER)
	{
		if(PlayerRacing[playerid] == 0)
	 	{
	 		if(!IsAPlane(tacha) && !IsABoat(tacha) && !IsANoSpeed(tacha))
			{
   				TextDrawShowForPlayer(playerid,ModelShow[playerid]);
  				TextDrawShowForPlayer(playerid,SpeedShow[playerid]);
  				TextDrawShowForPlayer(playerid,HealthShow[playerid]);
  				TextDrawShowForPlayer(playerid,FuelShow[playerid]);
  				TextDrawShowForPlayer(playerid,StatusShow[playerid]);
  				TextDrawShowForPlayer(playerid,EngineShow[playerid]);
  				PlayerTextDrawSetPreviewModel(playerid,privcar[playerid], GetVehicleModel(tacha));
				PlayerTextDrawShow(playerid,privcar[playerid]);
			}
		}
	}
    else if(newstate == PLAYER_STATE_ONFOOT)
    {
 		if(!IsAPlane(tacha) && !IsABoat(tacha) && !IsANoSpeed(tacha))
		{
	        TextDrawHideForPlayer(playerid,ModelShow[playerid]);
        	TextDrawHideForPlayer(playerid,SpeedShow[playerid]);
        	TextDrawHideForPlayer(playerid,HealthShow[playerid]);
        	TextDrawHideForPlayer(playerid,FuelShow[playerid]);
        	TextDrawHideForPlayer(playerid,StatusShow[playerid]);
        	TextDrawHideForPlayer(playerid,EngineShow[playerid]);
        	PlayerTextDrawHide(playerid,privcar[playerid]);
        }
    }
к Пабликам:

PHP:
public UpdateSpeedometr()
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
	    if(IsPlayerInAnyVehicle(i))
	    {
	        new string[128];
	        new State = GetPlayerState(i);
	        new vehicleid = GetPlayerVehicleID(i);
	        new locked[32];
	        new Float:vehhel, vehh[20], vehs[20], vehe[20];
            if(IsLocked[GetPlayerVehicleID(i)] == 1) locked = "~g~VEHICLE: ~w~LOCK";
            else locked = "~g~VEHICLE: ~w~UNLOCK";
            GetVehicleHealth(GetPlayerVehicleID(i), vehhel);
            if(vehhel <= 500) vehh = "~r~";
            else vehh = "";
            if(Fuell[GetPlayerVehicleID(i)] <= 30) vehs = "~r~";
            else vehs = "";
            if(EngineState[i] == true) vehe = "~g~ENGINE: ~w~ON";
            else vehe = "~g~ENGINE: ~w~OFF";
            format(str1, sizeof(str1),"~g~SPEED: ~w~%d KM/H",SpeedVehicle(i));
            if(vehhel <= 300) format(str3, sizeof(str3),"~g~HEALTH: ~w~%s%.0f%",vehh,vehhel / 10); else format(str3, sizeof(str3),"~g~HEALTH: ~w~%s%.0f%",vehh,vehhel / 10);
            format(str2, sizeof(str2), "%s", locked);
            format(str6, sizeof(str6), "~g~MODEL: ~w~%s", VehicleNames[GetVehicleModel(GetPlayerVehicleID(i))-400]);
            format(str4, sizeof(str4), "~g~FUEL: ~w~%s%.0f", vehs,Fuell[GetPlayerVehicleID(i)]);
            format(str5, sizeof(str5), "%s", vehe);
			if(!IsAPlane(vehicleid) && !IsABoat(vehicleid) && !IsANoSpeed(vehicleid))
			{
				if(SpeedVehicle(i) != 0)
				{
					Fuell[vehicleid] -= 0.0050;
				}
			}
	        TextDrawSetString(FuelShow[i],str4);
			TextDrawSetString(HealthShow[i],str3);
			TextDrawSetString(SpeedShow[i],str1);
			TextDrawSetString(ModelShow[i],str6);
			TextDrawSetString(StatusShow[i],str2);
			TextDrawSetString(EngineShow[i],str5);
	    }
	}
}
 
Последнее редактирование:
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу