Jump to content

Hoffmann

Members
  • Posts

    65
  • Joined

  • Last visited

Everything posted by Hoffmann

  1. As far as I know, you have to combine two shaders in order to display it in preview properly.
  2. Could you show the part of code where startJailTimer is called?
  3. Уже сообщил разработчикам МТА о твоей проблеме. Это нельзя оставлять без ответа. Ждем!
  4. I expected the era of ffs-like gamemodes would have ended in 2016. Seems like I was wrong. I don't want to be annoying here, but lobby and toptimes look far too identical to ffs-gaming.
  5. Hoffmann

    Pages

    I guess you want to display only 5 elements from table somewhere(on some page), right? The way you can do it is: local elements = {{411, "Infernus"}, {546, "Intruder"}, {429, "Banshee"}, {541, "Bullet"}, {531, "Tractor"}} local startIndex = 3 -- index to start with local numberOfElements = 2 local fiveElements = {} for idx = startIndex, startIndex + numberOfElements - 1 do outputChatBox(elements[idx][2]) -- for example, print names of vehicles in table from index 3 and select 2 elements that are next end The code above will output: Banshee Bullet
  6. addEventHandler("onPedWasted", pedElement, function(_, killer) setPlayerWantedLevel(killer, 3) end) addEventHandler("onPlayerWasted", getRootElement(), function(_, killer) setPlayerWantedLevel(killer, 3) end) Read more about onPedWasted and onPlayerWasted events here https://wiki.multitheftauto.com/wiki/OnPedWasted and https://wiki.multitheftauto.com/wiki/OnPlayerWasted
  7. Note: For remote players, you have to use setPedAimTarget before setPedLookAt.
  8. I don't really like the idea of making wheels with huge customization options as vehicle components because of big .dff file size. You could make unlimited number of wheels as if they were objects. In this way you have to make regular wheels invisible (setVehicleComponentVisible). Then, inside onClientRender or even better onClientPreRender event you have to copy the position and rotation of default wheels(getVehicleComponentPosition and getVehicleComponentRotation) and set it as the position and rotation for your objects that will represent your wheels. Later, you will want this to be synchronized between other players. onClientElementStreamIn and onClientElementStreamOut events might help. On the other hard, if you'd like to do this with in-build components, shaders could be used to apply different textures on wheel's parts. And all the components are made separately, but it's stuff related to modeling.
  9. Если уж на то пошло, то fadeCamera(player, true) в серверном скрипте. Если сервер freeroam, то попробуй запустить ресурс play, в котором прописаны спавны.
  10. function darmanKardan (thePlayer, command, player) local taraf = getPlayerFromName(player) if player then setElementData(taraf,"healrequest", pending) outputChatBox("#00ff00The doctor is willing to heal you. Do you accept?", taraf, 255, 255, 255, true) else outputChatBox("#ff0000Syntax: /heal <Name>", thePlayer, 255, 255, 255, true) end end addCommandHandler("heal", darmanKardan) function acceptHeal (thePlayer, command) local requestStatus = getElementData(thePlayer, "healrequest") if (requestStatus == "pending") then setElementData(player,"healrequest", unpending) setElementHealth(player, 100) outputChatBox("#00ff00You have been healed by the doctor.", thePlayer, 255, 255, 255, true) else outputChatBox("#ff0000[Error]: #ffffffYou have no pending request.", thePlayer, 255, 255, 255, true) end end addCommandHandler("aheal", acceptHeal) The equality operator == is missing in line 14. This code should work
  11. Is render target destroyed every time onClientMarkerHit event is triggered? Did you test it with new markers?
  12. It won't look as cool as this decision.
  13. The onClientRender event and some basic math are decision if you want to make movements smoother
  14. Seems like those scripts are leaked.
  15. You could get vehicle's rotation with getElementRotation function and set wheels' rotation with setVehicleComponentRotation for each frame in onClientRender event so wheels will stay straight relative to your vehicle.
  16. Which error? Also make sure you can't encode the file while the resource is running.
  17. Hoffmann

    set skin

    Probably this is what you wanna do: local validSkins = {29, 30, 100, 101, 102, 104, 106, 107, 108, 109, 110, 114, 115, 116, 118, 144, 165, 173, 174, 175, 280, 283, 285, 286, 287, 294} function spawnOnJoin() local rndSkin = validSkins[math.random(0,#validSkins)] -- get random valid skin from the table spawnPlayer(source, 0,0, 5, 0, rndSkin) -- spawn a player when he joins the server fadeCamera(source, true) setCameraTarget(source, source) end end addEventHandler("onPlayerJoin", root, spawnOnJoin)
  18. onVehicleExplode is a serverside event though. Use onClientVehicleExplode instead.
  19. Function attached to event onVehicleExplode has no parameters. And source is an element that the event is originated from and it's predefined. I suppose it's just a fragment of full code. I can't see veh4 table and Bfim4 element declarations. Moreover, using outputChatBox for source element in this case doesn't make sense because source is actually a vehicle. Try this code and reply if it's working. function blowveh4 () --if (veh4[source]) and isElement(veh4[source]) then destroyElement (source) setElementVisibleTo ( Bfim4, source, false ) outputChatBox("#ff0000Mission failled, your vehicle blow", root ,0,0,0,true) --else --end end addEventHandler ( "onVehicleExplode", getRootElement(), blowveh4 )
  20. Any serverside .lua script. Learn how to script and ask only if you have question related to scripting problem.
  21. You have to disable the default /me command and write new one. Try this code: addEventHandler("onPlayerChat", root, function(message, type) if type == 1 then -- if action message cancelEvent() -- prevent from sending it into chatbox local actionMessage = string.gsub(getPlayerName(source), "#%x%x%x%x%x%x", "").." "..message outputChatBox(actionMessage, root, 255, 255, 255, false) end end
  22. Clientside events hideinventory and showinventory are missed. I don't see them in your code.
×
×
  • Create New...