Jump to content

IIYAMA

Moderators
  • Posts

    6,063
  • Joined

  • Last visited

  • Days Won

    208

Everything posted by IIYAMA

  1. https://wiki.multitheftauto.com/wiki/DxDrawRectangle yes. But that one on the picture isn't a dx bar.
  2. IIYAMA

    Anti-Cheat Corner

    Cause mta files can be edited by smart people.
  3. local startX,startY,startZ = 0,0,0 local endX,endY,endZ = 0,0,0 local cameraStartHighed = 50 local progress = 0 local handled = false local renderFunction renderFunction = function() setCameraMatrix(startX,startY,startZ-(cameraStartHighed*progress), endX,endY,endZ) progress = progress+0.02 if progress >= 1 then setCameraTarget(localPlayer) progress = 0 removeEventHandler("onClientRender",root,renderFunction) handled = false end end local setCameraOnPlayerSpawn = function () local pX,pY,pZ = getElementPosition(localPlayer) startX,startY,startZ, endX,endY,endZ= pX,pY,pZ+cameraStartHighed, pX,pY,pZ setCameraMatrix(startX,startY,startZ, endX,endY,endZ) if not handled then addEventHandler("onClientRender",root,renderFunction) handled = true end progress = 0 end addEventHandler("onClientPlayerSpawn", localPlayer, setCameraOnPlayerSpawn) @Desaster thanks for testing. This will prevent it for triggering for everybody.
  4. local startX,startY,startZ = 0,0,0 local endX,endY,endZ = 0,0,0 local cameraStartHighed = 50 local progress = 0 local handled = false local renderFunction renderFunction = function() setCameraMatrix(source, startX,startY,startZ-(cameraStartHighed*progress), endX,endY,endZ) progress = progress+0.02 if progress >= 1 then setCameraTarget(localPlayer) progress = 0 removeEventHandler("onClientRender",root,renderFunction) handled = false end end local setCameraOnPlayerSpawn = function () local pX,pY,pZ = getElementPosition(localPlayer) startX,startY,startZ, endX,endY,endZ= pX,pY,pZ+cameraStartHighed, pX,pY,pZ setCameraMatrix(source, startX,startY,startZ, endX,endY,endZ) if not handled then addEventHandler("onClientRender",root,renderFunction) handled = true end progress = 0 end addEventHandler("onClientPlayerSpawn", root, setCameraOnPlayerSpawn) Try this, I just wrote it in 4 min, I didn't checked it with bugs and typo's....... etc ect ect.
  5. it is already there.... on a default admin pannel.
  6. Oh really? Apologies then, I thought it only have the output for the first function. Nevermind This page may help. https://forum.multitheftauto.com/viewtopic.php?f=91&t=39678
  7. resourceRoot gives the same result as this shit..... getResourceRootElement(getThisResource())......... resourceRoot is the output of those 2 functions.
  8. https://forum.multitheftauto.com/viewforum.php?f=145
  9. @.:HyPeX:. You sure there is no addCommandHandler with /win at serverside? Because that would explain a lot. A client addCommandHandler can't trigger something on serverside unless another function is sending it through. (which isn't there )
  10. if your topic wasn't called getRootElement() and if I can find your question out of this.... Then I can answer your questions..... Pls ask the question you have right now.
  11. Maybe you should take a look at the syntax of triggerClientEvent: YouGotMail = triggerClientEvent ( getRootElement(), name, element ) You are already sending it to all players, because you haven't filled in it's destination. And this is the trash for somebody who seriously is addicted too lua specifications. outputChatBox(type(getRootElement))-- returns > function outputChatBox(type(getRootElement2))-- returns > nil [b](typo)[/b] outputChatBox(type(root))-- returns > userdata root = getRootElement() Returns the root variable. The differed between root and getRootElement() is, that the one is just the out put of the function and the other one is the function it self. Functions are making the code slow, so I prefer root a both getRootElement(). (believe it or not, but it is very true) The result will not be high lagg, but the frames will go less smooth as before. old = getTickCount() for i=1,1000000 do root = getRootElement() end outputChatBox(getTickCount()-old) 99 ms old = getTickCount() for i=1,1000000 do root = root end outputChatBox(getTickCount()-old) 30 ms
  12. the much referred to the like, it should've been "i dont like that much..." what mixes me, is the structure You mean the way I attached the handler to the function? You can always set it back... Good luck!!
  13. what do you mean much addEventHandler ? there is just 1.
  14. Did I had replied on one of your other topics about loading objects? (I can remember a topic about that) Maybe you can splits the map data in 4/8/16 and send with a small delay the parts. So the client can already start building up the map.
  15. Nope, some things have to be done serverside. But this may give you a good start. addEventHandler("onClientVehicleCollision", root,-- typo OnClientVehicleCollision function (Attacker, force, part, X, Y, Z, NX, NY, NZ, HitElementForce, model) if getPedOccupiedVehicle( localPlayer ) == source then if avehicle and getElementType(avehicle) == "vehicle" then local Attacker = getVehicleController ( avehicle) --local lx, ly, lz = getElementPosition( vehicle ) --local ax, ay, az = getElementPosition( avehicle ) --local hit, x, y, z, elementHit, nx, ny, nz, mat, light, part, id = processLineOfSight ( ax, ay, az, lx, ly, lz ) --if localPlayer == FlagHolder then if part == 4 then end --end end end end) --[[ should be done serverside FlagHolder = Attacker setVehicleColor( uvehicle, 0, 255, 0 ) setVehicleColor( avehicle, 255, 0, 0 ) --triggerEvent("OnFlagChange", Attacker) outputChatBox("Your flag was stolen by ".. getPlayerName(Attacker), localPlayer, 255,255,255, true) else outputChatBox("You were hit by ".. getPlayerName(Attacker) .." be carefull!", localPlayer, 255,255,255, true) ]]
  16. then he better can try this: http://mta.dzek.eu/mmove/
  17. As glowdemon said, those values are for the offset between the elements. X and Y are for horizontal offset and the Z value are for changing the height between the elements. Google proudly presents.(dutch image> as = axes) We can better call it the distance/offset in 3D.
  18. You have ever take a look at this function? https://wiki.multitheftauto.com/wiki/Tr ... lientEvent and for showing the download: https://wiki.multitheftauto.com/wiki/Ge ... entHandles triggerLatentClientEvent (player,"lovely_function",10000,player,mapstring) local table = getLatentEventHandles ( player ) local handler = table[#table] if handler then outputChatBox(tostring(getLatentEventStatus( handler)["percentComplete"])) end --- etc.... Player won't be freeze, when you limit the bandwidth(to the value you want) and network traffic is not blocked. Next to that you can cancel the map transfer when you send the next map. https://wiki.multitheftauto.com/wiki/CancelLatentEvent
  19. I found some information about vehicle parts at this function a few months ago. https://wiki.multitheftauto.com/wiki/ProcessLineOfSight Not sure if those parts are sharing the same id, but I think they do.
  20. nope, only required when you call a function outside the function/if block. Try this: gMe = getLocalPlayer() function gravity() marker1 = createMarker (6009, 392, 10.800000190735, "corona", 2, 0, 0, 0, 0) object = createObject (1681, 6009.2998046875, 396.39999389648, 16.10000038147) end function MarkerHit ( hitPlayer, matchingDimension ) local vehicle = getPedOccupiedVehicle ( hitPlayer ) if hitPlayer ~= gMe then return end if source == marker1 then attachElements (vehicle, object, 0, 0, -5.5, 0, 0, 0) moveObject (object, 1999, 6009.2998046875, 490, 16.10000038147) setTimer(function () if isElement(vehicle) then detachElements (vehicle) -- you detach the elements from the object. So it should be the vehicle. end end,2000,1) end end addEventHandler( "onClientResourceStart", resourceRoot, gravity ) addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit ) vehicle = child. object = mother. (mother holds the child.)
  21. Try this: local Xr,Yr,Zr = getElementRotation(vehicle) if Xr > 90 and Xr < 270 and Yr > 90 and Yr < 270 then end
  22. But you didn't use from Json.
  23. Was that sarcasm? Nvm, enjoy that. No reply pls.
×
×
  • Create New...