Поиск
 
 

Результаты :
 


Rechercher Расширенный поиск

Аккаунты | Вирты | Все сервера CRMP-RP

Вс Авг 14, 2016 12:15 am автор Прародитель форума

Рекомендуем отличную группу по продаже виртов на серверах CRMP RP. Быстрая доставка, хорошие отзывы, активные продавцы, не дорогие цены.
https://vk.com/donate_crmp_rp

Комментарии: 0

Последние темы
» интерьер мэрии
Сб Авг 27, 2016 2:49 am автор Прародитель форума

» интерьер фсб
Сб Авг 27, 2016 2:38 am автор Прародитель форума

» колесо обозрение
Чт Авг 25, 2016 2:40 am автор Прародитель форума

» система установки мигалки
Чт Авг 25, 2016 2:36 am автор Прародитель форума

» салон гопкар
Чт Авг 25, 2016 2:32 am автор Прародитель форума

» выдыхание пара
Чт Авг 25, 2016 2:29 am автор Прародитель форума

» онлайн рекорд
Чт Авг 25, 2016 2:25 am автор Прародитель форума

» сгорание колес
Чт Авг 25, 2016 2:22 am автор Прародитель форума

» система викторины
Чт Авг 25, 2016 2:19 am автор Прародитель форума


новая система спидометра

Перейти вниз

новая система спидометра

Сообщение автор Прародитель форума в Вс Авг 14, 2016 8:26 am

Особенности спидометра:
Индикатор поворотников.
Индикатор фар
Индикатор двигателя
Индикатор дверей автомобиля
Ну и конечно же бензин, скорость, и полоска скорости.



Код:
Ко всем переменным(приношу извинения что не сделал так: Textdraw[11];)
new PlayerText:Textdraw0[MAX_PLAYERS];
new PlayerText:Textdraw1[MAX_PLAYERS];
new PlayerText:Textdraw2[MAX_PLAYERS];
new PlayerText:Textdraw3[MAX_PLAYERS];
new PlayerText:Textdraw41[MAX_PLAYERS];
new PlayerText:Textdraw5[MAX_PLAYERS];
new PlayerText:Textdraw6[MAX_PLAYERS];
new PlayerText:Textdraw7[MAX_PLAYERS];
new PlayerText:Textdraw8[MAX_PLAYERS];
new PlayerText:Textdraw9[MAX_PLAYERS];
new PlayerText:Textdraw10[MAX_PLAYERS];
В OnPlayerConnect:
PlayerTextDrawHide(playerid,Textdraw0[playerid]); PlayerTextDrawHide(playerid,Textdraw1[playerid]); PlayerTextDrawHide(playerid,Textdraw2[playerid]);
PlayerTextDrawHide(playerid,Textdraw3[playerid]); PlayerTextDrawHide(playerid,Textdraw41[playerid]);PlayerTextDrawHide(playerid,Textdraw5[playerid]);PlayerTextDrawHide(playerid,Textdraw6[playerid]);PlayerTextDrawHide(playerid,Textdraw7[playerid]);PlayerTextDrawHide(playerid,Textdraw8[playerid]);PlayerTextDrawHide(playerid,Textdraw9[playerid]);PlayerTextDrawHide(playerid,Textdraw10[playerid]);


Textdraw0[playerid] = CreatePlayerTextDraw(playerid, 637.199951, 346.459991, "usebox");
PlayerTextDrawLetterSize(playerid, Textdraw0[playerid], -0.020799, 6.435197);
PlayerTextDrawTextSize(playerid, Textdraw0[playerid], 453.999816, 28.373331);
PlayerTextDrawAlignment(playerid, Textdraw0[playerid], 1);
PlayerTextDrawColor(playerid, Textdraw0[playerid], 0);
PlayerTextDrawUseBox(playerid, Textdraw0[playerid], true);
PlayerTextDrawBoxColor(playerid, Textdraw0[playerid], 102);
PlayerTextDrawSetShadow(playerid, Textdraw0[playerid], 0);
PlayerTextDrawSetOutline(playerid, Textdraw0[playerid], 0);
PlayerTextDrawFont(playerid, Textdraw0[playerid], 0);
Textdraw1[playerid] = CreatePlayerTextDraw(playerid, 507.999816, 348.693206, "46 KM/H");
PlayerTextDrawLetterSize(playerid, Textdraw1[playerid], 0.449999, 1.600000);
PlayerTextDrawAlignment(playerid, Textdraw1[playerid], 1);
PlayerTextDrawColor(playerid, Textdraw1[playerid], -1);
PlayerTextDrawSetShadow(playerid, Textdraw1[playerid], 0);
PlayerTextDrawSetOutline(playerid, Textdraw1[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, Textdraw1[playerid], 51);
PlayerTextDrawFont(playerid, Textdraw1[playerid], 2);
PlayerTextDrawSetProportional(playerid, Textdraw1[playerid], 1);
Textdraw2[playerid] = CreatePlayerTextDraw(playerid, 476.000183, 368.853088, "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIII");
PlayerTextDrawLetterSize(playerid, Textdraw2[playerid], 0.449999, 1.600000);
PlayerTextDrawAlignment(playerid, Textdraw2[playerid], 1);
PlayerTextDrawColor(playerid, Textdraw2[playerid], -2139062017);
PlayerTextDrawSetShadow(playerid, Textdraw2[playerid], 0);
PlayerTextDrawSetOutline(playerid, Textdraw2[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, Textdraw2[playerid], 51);
PlayerTextDrawFont(playerid, Textdraw2[playerid], 1);
PlayerTextDrawSetProportional(playerid, Textdraw2[playerid], 1);
Textdraw3[playerid] = CreatePlayerTextDraw(playerid, 464.800079, 409.173278, "ВЃAPВ‘");
PlayerTextDrawLetterSize(playerid, Textdraw3[playerid], 0.296400, 1.876266);
PlayerTextDrawAlignment(playerid, Textdraw3[playerid], 1);
PlayerTextDrawColor(playerid, Textdraw3[playerid], -1);
PlayerTextDrawSetShadow(playerid, Textdraw3[playerid], 0);
PlayerTextDrawSetOutline(playerid, Textdraw3[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, Textdraw3[playerid], 51);
PlayerTextDrawFont(playerid, Textdraw3[playerid], 2);
PlayerTextDrawSetProportional(playerid, Textdraw3[playerid], 1);
Textdraw41[playerid] = CreatePlayerTextDraw(playerid, 638.000000, 410.673339, "usebox");
PlayerTextDrawLetterSize(playerid, Textdraw41[playerid], 0.000000, 1.674442);
PlayerTextDrawTextSize(playerid, Textdraw41[playerid], 454.000000, 0.000000);
PlayerTextDrawAlignment(playerid, Textdraw41[playerid], 1);
PlayerTextDrawColor(playerid, Textdraw41[playerid], 0);
PlayerTextDrawUseBox(playerid, Textdraw41[playerid], true);
PlayerTextDrawBoxColor(playerid, Textdraw41[playerid], 102);
PlayerTextDrawSetShadow(playerid, Textdraw41[playerid], 0);
PlayerTextDrawSetOutline(playerid, Textdraw41[playerid], 0);
PlayerTextDrawFont(playerid, Textdraw41[playerid], 0);
Textdraw5[playerid] = CreatePlayerTextDraw(playerid, 517.600097, 409.173370, "В€AMOK");
PlayerTextDrawLetterSize(playerid, Textdraw5[playerid], 0.289198, 1.853865);
PlayerTextDrawAlignment(playerid, Textdraw5[playerid], 1);
PlayerTextDrawColor(playerid, Textdraw5[playerid], -1);
PlayerTextDrawSetShadow(playerid, Textdraw5[playerid], 0);
PlayerTextDrawSetOutline(playerid, Textdraw5[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, Textdraw5[playerid], 51);
PlayerTextDrawFont(playerid, Textdraw5[playerid], 2);
PlayerTextDrawSetProportional(playerid, Textdraw5[playerid], 1);
Textdraw6[playerid] = CreatePlayerTextDraw(playerid, 574.399841, 409.173339, "ƒB…‚ATE‡’");
PlayerTextDrawLetterSize(playerid, Textdraw6[playerid], 0.226799, 1.921066);
PlayerTextDrawAlignment(playerid, Textdraw6[playerid], 1);
PlayerTextDrawColor(playerid, Textdraw6[playerid], -1);
PlayerTextDrawSetShadow(playerid, Textdraw6[playerid], 0);
PlayerTextDrawSetOutline(playerid, Textdraw6[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, Textdraw6[playerid], 51);
PlayerTextDrawFont(playerid, Textdraw6[playerid], 2);
PlayerTextDrawSetProportional(playerid, Textdraw6[playerid], 1);
Textdraw7[playerid] = CreatePlayerTextDraw(playerid, 475.199951, 349.439910, "<");
PlayerTextDrawLetterSize(playerid, Textdraw7[playerid], 0.449999, 1.600000);
PlayerTextDrawAlignment(playerid, Textdraw7[playerid], 1);
PlayerTextDrawColor(playerid, Textdraw7[playerid], -1);
PlayerTextDrawSetShadow(playerid, Textdraw7[playerid], 0);
PlayerTextDrawSetOutline(playerid, Textdraw7[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, Textdraw7[playerid], 51);
PlayerTextDrawFont(playerid, Textdraw7[playerid], 1);
PlayerTextDrawSetProportional(playerid, Textdraw7[playerid], 1);
Textdraw8[playerid] = CreatePlayerTextDraw(playerid, 606.399475, 349.439849, ">");
PlayerTextDrawLetterSize(playerid, Textdraw8[playerid], 0.449999, 1.600000);
PlayerTextDrawAlignment(playerid, Textdraw8[playerid], 1);
PlayerTextDrawColor(playerid, Textdraw8[playerid], -1);
PlayerTextDrawSetShadow(playerid, Textdraw8[playerid], 0);
PlayerTextDrawSetOutline(playerid, Textdraw8[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, Textdraw8[playerid], 51);
PlayerTextDrawFont(playerid, Textdraw8[playerid], 1);
PlayerTextDrawSetProportional(playerid, Textdraw8[playerid], 1);
Textdraw9[playerid] = CreatePlayerTextDraw(playerid, 476.000152, 368.853515, "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIII");
PlayerTextDrawLetterSize(playerid, Textdraw9[playerid], 0.449999, 1.600000);
PlayerTextDrawAlignment(playerid, Textdraw9[playerid], 1);
PlayerTextDrawColor(playerid, Textdraw9[playerid], -1);
PlayerTextDrawSetShadow(playerid, Textdraw9[playerid], 0);
PlayerTextDrawSetOutline(playerid, Textdraw9[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, Textdraw9[playerid], 51);
PlayerTextDrawFont(playerid, Textdraw9[playerid], 1);
PlayerTextDrawSetProportional(playerid, Textdraw9[playerid], 1);
Textdraw10[playerid] = CreatePlayerTextDraw(playerid, 463.199920, 386.773376, "TOŒ‡…BO:");
PlayerTextDrawLetterSize(playerid, Textdraw10[playerid], 0.449999, 1.600000);
PlayerTextDrawAlignment(playerid, Textdraw10[playerid], 1);
PlayerTextDrawColor(playerid, Textdraw10[playerid], -1);
PlayerTextDrawSetShadow(playerid, Textdraw10[playerid], 0);
PlayerTextDrawSetOutline(playerid, Textdraw10[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, Textdraw10[playerid], 51);
PlayerTextDrawFont(playerid, Textdraw10[playerid], 2);
PlayerTextDrawSetProportional(playerid, Textdraw10[playerid], 1);
В OnPlayerDisconnect:
PlayerTextDrawDestroy(playerid,Textdraw0[playerid]); PlayerTextDrawDestroy(playerid,Textdraw1[playerid]); PlayerTextDrawDestroy(playerid,Textdraw2[playerid]);
PlayerTextDrawDestroy(playerid,Textdraw3[playerid]); PlayerTextDrawDestroy(playerid,Textdraw41[playerid]);PlayerTextDrawDestroy(playerid,Textdraw5[playerid]);PlayerTextDrawDestroy(playerid,Textdraw6[playerid]);PlayerTextDrawDestroy(playerid,Textdraw7[playerid]);PlayerTextDrawDestroy(playerid,Textdraw8[playerid]);PlayerTextDrawDestroy(playerid,Textdraw9[playerid]);PlayerTextDrawDestroy(playerid,Textdraw10[playerid]);
В Конец мода:
CALLBACK: SpeedoUpdate()
{
foreach(Player,i)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
{
new string[50],status[32],statusL[32],Left[32],Right[32],statusD[32],vehicleid = GetPlayerVehicleID(i);
if(VehicleInfo[vehicleid][pEngineStatus] == 1) status = "~g~ѓB…‚ATE‡’";//Двигатель
else status = "~w~ѓB…‚ATE‡’";
if(VehicleInfo[vehicleid][pLightsStatus] == 1) statusL = "~b~ЃAP‘";//Фары
else statusL = "~w~ЃAP‘";
if(CarInfo[GetRealID(vehicleid)][cLock] == 1) statusD = "~y~€AMOK";
else statusD = "~w~€AMOK";
if(VehInfo[vehicleid][vLeftBlink] == 0) Left = "~w~<";
else Left = "~y~<";
if(VehInfo[vehicleid][vRightBlink] == 0) Right = "~w~>";
else Right = "~y~>";
PlayerTextDrawShow(i,Textdraw0[i]); PlayerTextDrawShow(i,Textdraw1[i]); PlayerTextDrawShow(i,Textdraw2[i]);
PlayerTextDrawShow(i,Textdraw3[i]); PlayerTextDrawShow(i,Textdraw41[i]);PlayerTextDrawShow(i,Textdraw5[i]);PlayerTextDrawShow(i,Textdraw6[i]);PlayerTextDrawShow(i,Textdraw7[i]);PlayerTextDrawShow(i,Textdraw8[i]);PlayerTextDrawShow(i,Textdraw9[i]);PlayerTextDrawShow(i,Textdraw10[i]);
format(string,sizeof(string),"%d KM/H",GetPlayerSpeed(i));//Скорость
PlayerTextDrawSetString(i,Textdraw1[i],string);
format(string,sizeof(string),"TOЊ‡…BO: %d ‡.",Gas[vehicleid]);//Бензин
PlayerTextDrawSetString(i,Textdraw10[i],string);
format(string,sizeof(string),"%s",status);
PlayerTextDrawSetString(i,Textdraw6[i],string);
format(string,sizeof(string),"%s",statusL);
PlayerTextDrawSetString(i,Textdraw3[i],string);
format(string,sizeof(string),"%s",statusD);
PlayerTextDrawSetString(i,Textdraw5[i],string);
format(string,sizeof(string),"%s",Left);
PlayerTextDrawSetString(i,Textdraw7[i],string);
format(string,sizeof(string),"%s",Right);
PlayerTextDrawSetString(i,Textdraw8[i],string);
switch(SpeedVehicle(i)){
case 0..1: PlayerTextDrawSetString(i,Textdraw9[i], "~w~");
case 2..10: PlayerTextDrawSetString(i,Textdraw9[i], "~w~II");
case 11..20: PlayerTextDrawSetString(i,Textdraw9[i], "~w~III");
case 21..30: PlayerTextDrawSetString(i,Textdraw9[i], "~w~IIIII");
case 31..40: PlayerTextDrawSetString(i,Textdraw9[i], "~w~IIIIIIII");
case 41..50: PlayerTextDrawSetString(i,Textdraw9[i], "~w~IIIIIIIII");
case 51..60: PlayerTextDrawSetString(i,Textdraw9[i], "~w~IIIIIIIIIIII");
case 61..70: PlayerTextDrawSetString(i,Textdraw9[i], "~w~IIIIIIIIIIIIII");
case 71..80: PlayerTextDrawSetString(i,Textdraw9[i], "~w~IIIIIIIIIIIIIIII");
case 81..90: PlayerTextDrawSetString(i,Textdraw9[i], "~w~IIIIIIIIIIIIIIIIIII");
case 91..120: PlayerTextDrawSetString(i,Textdraw9[i],"~w~IIIIIIIIIIIIIIIIIIIIII");
default: PlayerTextDrawSetString(i,Textdraw9[i], "~w~IIIIIIIIIIIIIIIIIIIIIIIIIIIIIII");}
}
if(!IsPlayerInAnyVehicle(i))
{
PlayerTextDrawHide(i,Textdraw0[i]); PlayerTextDrawHide(i,Textdraw1[i]); PlayerTextDrawHide(i,Textdraw2[i]);
PlayerTextDrawHide(i,Textdraw3[i]); PlayerTextDrawHide(i,Textdraw41[i]);PlayerTextDrawHide(i,Textdraw5[i]);
PlayerTextDrawHide(i,Textdraw6[i]);PlayerTextDrawHide(i,Textdraw7[i]);PlayerTextDrawHide(i,Textdraw8[i]);PlayerTextDrawHide(i,Textdraw9[i]);PlayerTextDrawHide(i,Textdraw10[i]);
}
}
return true;
}
В OnGameModeinit:
SetTimer("SpeedoUpdate",100,1);
Если будет ругаться на SpeedVehicle, то добавим сток в конец мода:
stock SpeedVehicle(playerid, bool:return_km=true)
{
new Float:x, Float:y, Float:z;
if(IsPlayerInAnyVehicle(playerid)) {
new veh = GetPlayerVehicleID(playerid);
GetVehicleVelocity(veh, x, y, z);
}else GetPlayerVelocity(playerid, x, y, z);
return return_km?floatround(floatsqroot(x*x+y*y+z*z)*195):floatround(floatsqroot(x*x+y*y+z*z)*121);

[Вы должны быть зарегистрированы и подключены, чтобы видеть эту ссылку]
[Вы должны быть зарегистрированы и подключены, чтобы видеть эту ссылку]
[Вы должны быть зарегистрированы и подключены, чтобы видеть эту ссылку]

автор:amstor

Прародитель форума
Прародитель форума

Сообщения : 67
Очки : 2514
Репутация : 0
Дата регистрации : 2016-08-13

Посмотреть профиль http://allforcrmp.forum2x2.ru

Вернуться к началу Перейти вниз

Вернуться к началу


 
Права доступа к этому форуму:
Вы не можете отвечать на сообщения