number = number+1 setElementData(spalteGuiText[number],"usedItem","sleep") guiSetVisible(spalteGuiImage[number],true) guiSetText(spalteGuiText[number],"Лечь спать") guiLabelSetColor (spalteGuiText[number],255,255,255) setElementData(spalteGuiText[number],"markedMenuItem",false)
После находим
if itemName == "repairvehicle" then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("repairVehicle",getLocalPlayer(),getElementData(col,"parent")) disableMenu() return end
И добавляем
if itemName == "sleep" then sleepBackground = guiCreateStaticImage(0,0,1,1,"images/sleep.jpg",true) playSound("sounds/sleep.mp3") setElementData(getLocalPlayer(),"sleep",100) setTimer(destroyElement,60000,1,sleepBackground) disableMenu() return end
Открываем : survivorSystem_client.lua И где хотите вставляете
function checkSleeping() if getElementData(getLocalPlayer(),"logedin") then if getElementData(getLocalPlayer(),"sleep") <= 20 then toggleControl ( "sprint", false ) else toggleControl ( "sprint", true ) end end end setTimer(checkSleeping,1400,0)
Создаём свой новый файл sleep.lua И в него вставляем данный код
function checkSleep() local value = getElementData(getLocalPlayer(),"sleep") local current = -0.5 if getElementData(getLocalPlayer(),"logedin") then setElementData(getLocalPlayer(),"sleep",value+current) end end setTimer(checkSleep,60000,0)
Готово! http://resource-mta.3dn.ru/ - лучшие ресурсы у нас