Jump to content

Yashann

Members
  • Posts

    63
  • Joined

  • Last visited

Everything posted by Yashann

  1. Есть ли такая функция что бы прикрепить к машине миниган? ну или встроить)
  2. Не мог бы ты мне по подробнее рассказать об различных условиях) как их ставить и связывать?) ну или просто ссылку где это написано) на английском желательно)
  3. Спасибо но в следующий раз я постараюсь сам разобраться а то чуствую что уже на голову сожусь)
  4. function migalca() car = createVehicle ( 451,2484.2724609375, -1665.3690185547, 13.34375, 0, 0, 0 ) setVehicleLightState ( car, 0, 1 ) end addEventHandler ( "onResourceStart", resourceRoot, migalca ) Вот это совсем по стандарту function migalca() car = createVehicle ( 451,2484.2724609375, -1665.3690185547, 13.34375, 0, 0, 0 ) setTimer ( function() setVehicleLightState ( car, 0, 1 ) end, 5000, 1 ) end addEventHandler ( "onResourceStart", resourceRoot, migalca ) Это уже с таймером а вот пытался замкнуть но не зная через что замкнуть так сказать незя) Хотя вчера экзамен по инфе на 4 сдал спокойно) а тут я полный нуб... пытался через if then else так понимаю что полная бессмыслица если брать циклы то без основы они тоже пока бесполезны... просто сруктуру или пример) и всё)
  5. Бьюсь об стенку ну ни хрена не понимаю как сделать что бы они мигали... Ставишь одно, горит одна фара, другое, другая фара а как их замкнуть? Пожалуйста помогите) я жадно съем всё что вы посоветуете) TheNormalnij спасибо за функции
  6. Помогите пожалуйста написать скрипт что бы при включении сирены на полицейской машине мигали и фары автомобиля) подскажите функции и структуру) я просто учусь и всё запоминаю) Заранее спасибо)
  7. Спасибо но мне нужно заменить не один объект а много....
  8. Помогите пожалуйста составить скрипт на замену txd dff и col файлов) Заранее благодарен)
  9. Большое вам спасибо! Всё понятно теперь!)
  10. Не могу не как понять одну строчку...как её подстраивать под свой скрипт? addEventHandler для меня загадка века Вот это прочитано но ни хрена не понято https://wiki.multitheftauto.com/index.ph ... entHandler
  11. Как вычислить координаты GUI окон? Есть какой то плагин или програмка, или функция, или скрипт? Заранее благодарен)
  12. Спасибо перепишу) так действительно удобнее!
  13. Что нужно дописать что бы при выходе игрока из машины сохранялась его последняя волна? Server addEvent ( "onPlayerRadioSwitch", true ) addEventHandler ( "onPlayerRadioSwitch", getRootElement (), function ( vehicle ) for k, v in ipairs ( getElementsByType ( "player" ) ) do if getPedOccupiedVehicle ( v ) == vehicle and v ~= source then triggerClientEvent ( v, "switchRadioChannel", v ) end end end ) Client local xml = xmlLoadFile ( "settings.xml" ) local nodeColor = xmlFindChild ( xml, "color", 0 ) local nodeFont = xmlFindChild ( xml, "font", 0 ) local nodeRealism = xmlFindChild ( xml, "realism", 0 ) local nodeStations = xmlFindChild ( xml, "stations", 0 ) local label = guiCreateLabel ( 0, 0, 1, 0.1, "Radio Off", true ) guiLabelSetColor ( label, xmlNodeGetAttribute ( nodeColor, "r" ), xmlNodeGetAttribute ( nodeColor, "g" ), xmlNodeGetAttribute ( nodeColor, "b" ) ) guiLabelSetHorizontalAlign ( label, "center" ) guiSetFont ( label, xmlNodeGetValue ( nodeFont ) ) guiSetVisible ( label, false ) addEventHandler ( "onClientResourceStart", getResourceRootElement (), function () showPlayerHudComponent ( "radio", false ) setElementData ( getLocalPlayer (), "liveradio.radio", 0 ) for k, v in ipairs ( getElementsByType ( "vehicle" ) ) do setElementData ( v, "liveradio.radio0", false ) setElementData ( v, "liveradio.radio1", false ) setElementData ( v, "liveradio.radio2", false ) setElementData ( v, "liveradio.radio3", false ) end end ) addEventHandler ( "onClientResourceStop", getResourceRootElement (), function () showPlayerHudComponent ( "radio", true ) end ) addEventHandler ( "onClientPlayerVehicleEnter", getLocalPlayer (), function ( vehicle, seat ) setRadioChannel ( 0 ) setElementData ( getLocalPlayer (), "liveradio.seat", seat ) if sound then if isElement ( sound ) then destroyElement ( sound ) end end if xmlNodeGetAttribute ( nodeRealism, "enabled" ) == "true" then if getElementData ( vehicle, "liveradio.radio0" ) then setElementData ( getLocalPlayer (), "liveradio.radio", getElementData ( vehicle, "liveradio.radio0" ) ) else for k, v in ipairs ( xmlNodeGetChildren ( nodeStations ) ) do setElementData ( getLocalPlayer (), "liveradio.radio", k ) end setElementData ( getLocalPlayer (), "liveradio.radio", math.random ( getElementData ( getLocalPlayer (), "liveradio.radio" ) ) ) setElementData ( vehicle, "liveradio.radio0", getElementData ( getLocalPlayer (), "liveradio.radio" ) ) setElementData ( vehicle, "liveradio.radio1", getElementData ( getLocalPlayer (), "liveradio.radio" ) ) setElementData ( vehicle, "liveradio.radio2", getElementData ( getLocalPlayer (), "liveradio.radio" ) ) setElementData ( vehicle, "liveradio.radio3", getElementData ( getLocalPlayer (), "liveradio.radio" ) ) end else if getElementData ( vehicle, "liveradio.radio" .. seat ) then setElementData ( getLocalPlayer (), "liveradio.radio", getElementData ( vehicle, "liveradio.radio" .. seat ) ) else for k, v in ipairs ( xmlNodeGetChildren ( nodeStations ) ) do setElementData ( getLocalPlayer (), "liveradio.radio", k ) end setElementData ( getLocalPlayer (), "liveradio.radio", math.random ( getElementData ( getLocalPlayer (), "liveradio.radio" ) ) ) setElementData ( vehicle, "liveradio.radio" .. seat, getElementData ( getLocalPlayer (), "liveradio.radio" ) ) end end local nodeStation = xmlFindChild ( nodeStations, "station", getElementData ( vehicle, "liveradio.radio" .. seat ) - 1 ) if nodeStation then local radioName = xmlNodeGetAttribute ( nodeStation, "name" ) local radioURL = xmlNodeGetAttribute ( nodeStation, "URL" ) sound = playSound ( radioURL ) guiSetText ( label, radioName ) guiSetVisible ( label, true ) if isTimer ( timerLabel ) then killTimer ( timerLabel ) end timerLabel = setTimer ( guiSetVisible, 5000, 1, label, false ) else guiSetText ( label, "Radio Off" ) guiSetVisible ( label, true ) setElementData ( getLocalPlayer (), "liveradio.radio", 0 ) if isTimer ( timerLabel ) then killTimer ( timerLabel ) end timerLabel = setTimer ( guiSetVisible, 5000, 1, label, false ) end timerVehicle = setTimer ( function ( vehicle ) if isPedInVehicle ( getLocalPlayer () ) == false or getPedOccupiedVehicle ( getLocalPlayer () ) ~= vehicle or getElementHealth ( getLocalPlayer () ) <= 0 then if sound then if isElement ( sound ) then destroyElement ( sound ) end end killTimer ( timerVehicle ) guiSetVisible ( label, false ) setElementData ( getLocalPlayer (), "liveradio.radio", 0 ) end end , 50, 0, vehicle ) end ) addEventHandler ( "onClientPlayerRadioSwitch", getLocalPlayer (), function ( station ) if station ~= 0 then cancelEvent () end if xmlNodeGetAttribute ( nodeRealism, "enabled" ) ~= "true" or getElementData ( getLocalPlayer (), "liveradio.seat" ) == 0 or getPedOccupiedVehicle ( getLocalPlayer () ) == false then if station == 1 then setElementData ( getLocalPlayer (), "liveradio.radio", getElementData ( getLocalPlayer (), "liveradio.radio" ) + 1 ) elseif station == 12 then setElementData ( getLocalPlayer (), "liveradio.radio", getElementData ( getLocalPlayer (), "liveradio.radio" ) - 1 ) if getElementData ( getLocalPlayer (), "liveradio.radio" ) == -1 then for k, v in ipairs ( xmlNodeGetChildren ( nodeStations ) ) do setElementData ( getLocalPlayer (), "liveradio.radio", k ) end end end if sound then if isElement ( sound ) then destroyElement ( sound ) end end if getPedOccupiedVehicle ( getLocalPlayer () ) then setElementData ( getPedOccupiedVehicle ( getLocalPlayer () ), "liveradio.radio" .. getElementData ( getLocalPlayer (), "liveradio.seat" ), getElementData ( getLocalPlayer (), "liveradio.radio" ) ) end local nodeStation = xmlFindChild ( nodeStations, "station", getElementData ( getLocalPlayer (), "liveradio.radio" ) - 1 ) if nodeStation then local radioName = xmlNodeGetAttribute ( nodeStation, "name" ) local radioURL = xmlNodeGetAttribute ( nodeStation, "URL" ) sound = playSound ( radioURL ) guiSetText ( label, radioName ) guiSetVisible ( label, true ) if isTimer ( timerLabel ) then killTimer ( timerLabel ) end timerLabel = setTimer ( guiSetVisible, 5000, 1, label, false ) else guiSetText ( label, "Radio Off" ) guiSetVisible ( label, true ) setElementData ( getLocalPlayer (), "liveradio.radio", 0 ) if isTimer ( timerLabel ) then killTimer ( timerLabel ) end timerLabel = setTimer ( guiSetVisible, 5000, 1, label, false ) end if xmlNodeGetAttribute ( nodeRealism, "enabled" ) == "true" and getPedOccupiedVehicle ( getLocalPlayer () ) then setElementData ( getPedOccupiedVehicle ( getLocalPlayer () ), "liveradio.radio0", getElementData ( getLocalPlayer (), "liveradio.radio" ) ) setElementData ( getPedOccupiedVehicle ( getLocalPlayer () ), "liveradio.radio1", getElementData ( getLocalPlayer (), "liveradio.radio" ) ) setElementData ( getPedOccupiedVehicle ( getLocalPlayer () ), "liveradio.radio2", getElementData ( getLocalPlayer (), "liveradio.radio" ) ) setElementData ( getPedOccupiedVehicle ( getLocalPlayer () ), "liveradio.radio3", getElementData ( getLocalPlayer (), "liveradio.radio" ) ) triggerServerEvent ( "onPlayerRadioSwitch", getLocalPlayer (), getPedOccupiedVehicle ( getLocalPlayer () ) ) end end end ) addEventHandler ( "onClientVehicleStartExit", getRootElement (), function ( player ) if player == getLocalPlayer () then if sound then if isElement ( sound ) then destroyElement ( sound ) end end if isTimer ( timerVehicle ) then killTimer ( timerVehicle ) end guiSetVisible ( label, false ) setElementData ( player, "liveradio.radio", 0 ) end end ) addEvent ( "switchRadioChannel", true ) addEventHandler ( "switchRadioChannel", getLocalPlayer (), function () if sound then if isElement ( sound ) then destroyElement ( sound ) end end local nodeStation = xmlFindChild ( nodeStations, "station", getElementData ( getPedOccupiedVehicle ( getLocalPlayer () ), "liveradio.radio0" ) - 1 ) if nodeStation then local radioName = xmlNodeGetAttribute ( nodeStation, "name" ) local radioURL = xmlNodeGetAttribute ( nodeStation, "URL" ) sound = playSound ( radioURL ) guiSetText ( label, radioName ) guiSetVisible ( label, true ) setElementData ( getLocalPlayer (), "liveradio.radio", getElementData ( getPedOccupiedVehicle ( getLocalPlayer () ), "liveradio.radio0" ) ) if isTimer ( timerLabel ) then killTimer ( timerLabel ) end timerLabel = setTimer ( guiSetVisible, 5000, 1, label, false ) else guiSetText ( label, "Radio Off" ) guiSetVisible ( label, true ) setElementData ( getLocalPlayer (), "liveradio.radio", 0 ) if isTimer ( timerLabel ) then killTimer ( timerLabel ) end timerLabel = setTimer ( guiSetVisible, 5000, 1, label, false ) end end ) Помогите пожалуйста!) Заранее благодарен!
  14. model = { [490 ]=true } -- сюда вноси ид модели машины function car () createVehicle(490, -1616.40002, 750.09998, -4.9, 0, 0, 0) createVehicle(490, -1612.5, 750, -4.9, 0, 0, 0) createVehicle(490, -1608.90002, 749.90002, -4.9, 0, 0, 0) createVehicle(490, -1604.69995, 749.90002, -4.9, 0, 0, 0) createVehicle(490, -1601.30005, 749.90002, -4.9, 0, 0, 0) createVehicle(490, -1597.5, 749.90002, -4.9, 0, 0, 0) createVehicle(490, -1590.69995, 749.79999, -4.9, 0, 0, 0) createVehicle(490, -1594.30005, 749.79999, -4.9, 0, 0, 0) for _, vehicle in ipairs ( getElementsByType("vehicle") ) do -- замечу что атачить блип будет только уже на созданные авто на карте можешь создать их хоть в map editore хоть функцией create главное что бы они были при запуске скрипта, т.е. если они появятся после запуска скрипта то блипов не будет соотвественно if model [getElementModel(vehicle)] then -- проверяем на наличие моделей среди машин createBlipAttachedTo( vehicle, 11) -- атачим блип к этим моделям setVehicleDamageProof(source, true) end end end addEventHandler ( "onResourceStart", resourceRoot, car ) function carr ( thePlayer, seat, jacked ) if model [getElementModel(source)] and seat==0 then -- проверяем посадку игрока именно в нашу модель тс accname = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accname, aclGetGroup ( "TCT" ) ) then outputChatBox ("Рабочее авто: Вы заступили на дежурство!", thePlayer, 0,255,0) else cancelEvent() end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), carr ) Полностью исправленная версия
  15. Возможно ли заменить текстуры неба если да то как? Подскажите функцию)
  16. Всё разобрался...Ещё раз спасибо!
  17. Не прошло и минуты как опять возникла загадка) Сделала как вы написали запускаю скрипт и каждой машины штук по 100 в одном месте....лаги жуткие...вот model = { [490 ]=true } -- сюда вноси ид модели машины function car () for _, vehicle in ipairs ( getElementsByType("vehicle") ) do -- замечу что атачить блип будет только уже на созданные авто на карте можешь создать их хоть в map editore хоть функцией create главное что бы они были при запуске скрипта, т.е. если они появятся после запуска скрипта то блипов не будет соотвественно createVehicle(490, -1616.40002, 750.09998, -4.9, 0, 0, 0) createVehicle(490, -1612.5, 750, -4.9, 0, 0, 0) createVehicle(490, -1608.90002, 749.90002, -4.9, 0, 0, 0) createVehicle(490, -1604.69995, 749.90002, -4.9, 0, 0, 0) createVehicle(490, -1601.30005, 749.90002, -4.9, 0, 0, 0) createVehicle(490, -1597.5, 749.90002, -4.9, 0, 0, 0) createVehicle(490, -1590.69995, 749.79999, -4.9, 0, 0, 0) createVehicle(490, -1594.30005, 749.79999, -4.9, 0, 0, 0) if model [getElementModel(vehicle)] then -- проверяем на наличие моделей среди машин createBlipAttachedTo( vehicle, 11) -- атачим блип к этим моделям end end end addEventHandler ( "onResourceStart", resourceRoot, car ) function carr ( thePlayer, seat, jacked ) if model [getElementModel(source)] and seat==0 then -- проверяем посадку игрока именно в нашу модель тс accname = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accname, aclGetGroup ( "Admin" ) ) then outputChatBox ("Рабочее авто: Вы заступили на дежурство!", thePlayer, 0,255,0) setVehicleDamageProof(source, true) else cancelEvent() end end end addEventHandler ( "onVehicleStartEnter", getRootElement(), carr ) Может я что то не правильно понял?
  18. большое спасибо буду учиться)
  19. function car () avto = createVehicle ( 432, 2042.107, 1529.086, 10.49, 0, 0, 0) createBlipAttachedTo( avto, 11) setVehicleDamageProof(avto, true) addEventHandler("onVehicleStartEnter",avto , carr ) end addEventHandler ( "onResourceStart", resourceRoot, car ) function carr ( thePlayer, seat, jacked ) accname = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accname, aclGetGroup ( "Admin" ) ) then outputChatBox ("#ffffffРабочее авто: #00ff00Вы заступили на дежурство!", thePlayer, 0,255,0,true) else cancelEvent() end end Исправил) но вопрос остаётся открытым! Как их размножить?
  20. И ещё вопрос) как размножить технику не повторяя при этом раз по 10 один и то же код?
  21. function car () avto = createVehicle ( 432, 2007.1811, 1544.51, 13.117, 0, 0, 0) setVehicleDamageProof(avto, true) addEventHandler("onVehicleStartEnter",avto , carr ) end addEventHandler ( "onResourceStart", resourceRoot, car ) function carr ( thePlayer, seat, jacked ) accname = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accname, aclGetGroup ( "TCT" ) ) then createBlipAttachedTo( avto, 11,thePlayer ) else cancelEvent() end end Знаю что тут так много ошибок что волосы дыбом) но помогите исправить) пожалуйста) так сказать мой первый ужас в студию)
×
×
  • Create New...