Jump to content

AngelAlpha

Members
  • Posts

    186
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by AngelAlpha

  1. попробуй вот так local startJob = createPickup(-1819, -1615, 23.1, 3, 1275, 0) local blipJobStart = createBlip ( -1819, -1615, 23, 53, 1, 255, 0, 0, 255, 0, 1000) local skin = 0 local skinJob = 27 local jobActive = false local money = 0 local sum = 0 local score = 0 local markers = {} local blips = {} function jobTake(thePlayer) if (thePlayer) then setPedAnimation(thePlayer, 'sword', 'sword_4', -1, true) outputChatBox('копаете...', thePlayer, 255, 255, 255, false) setTimer ( function() setPedAnimation(thePlayer, false) outputChatBox('Вы скололи руду, отнесите её в ангар', thePlayer, 255, 255, 0, false) destroyElement(markers[thePlayer]) destroyElement(blips[thePlayer]) createMarkerDrop() score = math.random(56, 100) end, 5000, 1) end end addEventHandler('onMarkerHit', resourceRoot, jobTake) function jobDrop(thePlayer) if (thePlayer) then outputChatBox('бросаете...', thePlayer, 255, 255, 255, false) setPedAnimation(thePlayer, 'sword', 'sword_4', -1, true) setTimer( function() sum = sum + score setPedAnimation(thePlayer, false) outputChatBox('Идите за рудой', thePlayer, 255, 255, 0, false) outputChatBox('Ты принёс '..score..'кг. Всего: '..sum..'кг.', thePlayer, 255, 255, 0, false) destroyElement(markers[thePlayer]) destroyElement(blips[thePlayer]) createMarkerTake() end, 1000, 1) end end addEventHandler('onMarkerHit', resourceRoot, jobDrop) function createMarkerDrop(thePlayer) markers[thePlayer] = createMarker ( -1865.732, -1622.147, 20.9, 'cylinder', 2, 255, 0, 0, 255, resourceRoot) blips[thePlayer] = createBlip ( -1865.732, -1622.147, 21.904, 0, 2, 255, 0, 0, 255, 0, 1000, resourceRoot) setElementVisibleTo(markers[thePlayer], thePlayer, true) setElementVisibleTo(blips[thePlayer], thePlayer, true) end function createMarkerTake(thePlayer) markers[thePlayer] = createMarker ( -1806.709, -1649.031, 22.8, 'cylinder', 2, 255, 0, 0, 255, resourceRoot) blips[thePlayer] = createBlip ( -1806.709, -1649.031, 24.018, 0, 2, 255, 0, 0, 255, 0, 1000, resourceRoot) setElementVisibleTo(markers[thePlayer], thePlayer, true) setElementVisibleTo(blips[thePlayer], thePlayer, true) addEvent ("jobTake", true) end function createMarkerStartJob(thePlayer) if (thePlayer) then --local skin = 0 if(jobActive == false ) then outputChatBox('Вы устроились шахтёром', thePlayer, 255, 255, 0, false) createMarkerTake() skin = getElementModel(thePlayer) outputChatBox(''..skin..'', thePlayer, 255, 255, 0, false) setPlayerSkin(thePlayer, 27) jobActive = true elseif (jobActive == true) then money = sum*5 outputChatBox('Вы уволились с работы шахтёра и заработали: '..money..'$.', thePlayer, 255, 0, 100, false) destroyElement(markers[thePlayer]) destroyElement(blips[thePlayer]) -- destroyElement(blipJobDrop) -- destroyElement(blipJobTake) givePlayerMoney(thePlayer, money) setPlayerSkin(thePlayer, skin) sum=0 score=0 jobActive = false skin=0 end end end --bindKey('n', 'down', createMarkerTake) --addCommandHandler ( "start", jobTake ) --addEventHandler('onMarkerHit', markerJobStart, createMarkerStartJob) addEventHandler('onPickupHit', startJob, createMarkerStartJob)
  2. local screenX, screenY = guiGetScreenSize() local px, py = screenX/1920, screenY/1080 local sizeX, sizeY = 345*px, 90*py local posX, posY = screenX - sizeX - 20*px, 10*py local prevHP = 0 local width = 130*px local speedAnim = 0.5 addEventHandler ("onClientRender", root, function() local curHP = getElementHealth(localPlayer) if prevHP ~= curHP then -- prevHP = curHP if prevHP < curHP then prevHP = math.min(curHP, prevHP + speedAnim) else prevHP = math.max(curHP, prevHP - speedAnim) end end dxDrawRectangle(posX+171*px, posY+46*py, width*(prevHP/getPedMaxHealth(localPlayer)), 6*py, tocolor(230,78,78,230)) end) function getPedMaxHealth(ped) assert(isElement(ped) and (getElementType(ped) == "ped" or getElementType(ped) == "player"), "Bad argument @ 'getPedMaxHealth' [Expected ped/player at argument 1, got " .. tostring(ped) .. "]") local stat = getPedStat(ped, 24) local maxhealth = 100 + (stat - 569) / 4.31 return math.max(1, maxhealth) end getPedMaxHealth это функция с вики. Чтобы менять скорость анимации меняй speedAnim
  3. value[4] is array {50, 150,50}, you need value[5]
  4. Попробуй полностью мта и гта полностью переустановить
  5. попробуй эту функцию getPedSimplestTask
  6. Try to set min mta version in meta
  7. пробовал писать разработчикам некста?
  8. Ты зашел в обычную мта или на какой то из этих проектов?
  9. устанавливай дождь вручную setRainLevel
  10. dbConnection return nil, check data conection to mysql
  11. -- Client triggerServerEvent ("WalkStyle", localPlayer, 55, true) -- Server addEvent ("WalkStyle", true) addEventHandler ("WalkStyle", root, function (style, forAll) if not forAll then setPedWalkingStyle(source, style) else for i, v in ipairs (getElementsByType("player")) do setPedWalkingStyle(v, style) end end end) если надо будет применять только для 1 игрока, true на false в тригере поменяй на клиенте
  12. AngelAlpha

    help

    check dbConnect function in db. Maybe wrong data
  13. Предположим переменной базы данных будет db и таблица в это бд будет называться admins local result = dbPoll(dbQuery(db, "SELECT * FROM admins WHERE name = ?", getPlayerName(player)), -1)[1]["is_admin"] if not result then print ("Запись не найдена") return end
  14. setTimer(function() for i, player in ipairs(getElementsByType("player")) do if getPlayerTeam (player) then setPlayerVoiceBroadcastTo(player, getTeamPlayers(player)) end end end, 1150, 0)
  15. Ты не можешь сервер запустить?
  16. Если у тебя есть CS:GO Skin Changer, то выключай его когда запускаешь мта
  17. AngelAlpha

    /me BUG

    addCommandHandler ("me", function(pl, _, ...) local message = table.concat({...}, " ") if message:gsub(" ", "") == "" then outputChatBox ("#77ba50Usage:#FFFFFF /me [text]", pl, 255, 0, 0, true) return end local pos1 = Vector3 (getElementPosition(pl)) for i, v in ipairs (getElementsByType("player")) do local pos2 = Vector3 (getElementPosition(v)) if getDistanceBetweenPoints3D (pos1, pos2) <= 20 then -- 20 - this range outputChatBox ("*** "..getPlayerName(pl).." "..message, v, 255, 200, 0, true) end end end) Try this code
  18. просто перенеси функцию с сервера на клиент
  19. marker1 = createMarker(2094.8940429688,-838.72570800781,52.3, "corona", 1.5, 230, 251, 3, 153) function event(el) if getElementType(el) ~= "player" then return end if el ~= localPlayer then return end -- function open a window end addEventHandler("onClientMarkerHit", resourceRoot, event)
×
×
  • Create New...