Jump to content

IIYAMA

Moderators
  • Posts

    6,063
  • Joined

  • Last visited

  • Days Won

    209

Everything posted by IIYAMA

  1. Slothbot is bedoeld om bots iets te laten doen. (lopen/shieten/springen) Niet om tegen te praten lol Je kan dan beter gewoon een ped neerzetten, desnoods met de map editor.
  2. IIYAMA

    Lower Windows

    You can try those new functions I have never seen before: https://wiki.multitheftauto.com/wiki/Se ... ntPosition https://wiki.multitheftauto.com/wiki/Se ... entVisible
  3. Can you make a screenshot?
  4. Try to change it to that: setPedCameraRotation(myPed, -findRotation(math.cos(_i)*(radius-width)+posX, math.sin(_i)*(radius-width)+posY, -1375.30627, -234.72827)) Always remember that the ped rotation is the opposite of the camera rotation. So that's why I did: -
  5. setPedRotation doesn't work well when controlstate "forwards" is on. setPedCameraRotation <
  6. Well if you want that, you have to use trigonometric functions/math to create points around your main point. To create a kind of path or a dynamic path. Except I am not going to burn my fingers on that.
  7. myPed = createPed(23,-1375.30627, -234.72827, 14.14844) setElementRotation(myPed,0,0,0) setPedControlState(myPed,"forwards",true) local rotationSpeed = 45 function pedRotate() local rx,ry,rz = getElementRotation(myPed) --setElementPosition (myPed, -1375.30627, -234.72827, 14.14844, false) rz = rz+rotationSpeed if rz <= 360 then setPedCameraRotation (myPed,-rz) else setPedCameraRotation (myPed,0) end end addEventHandler( "onClientResourceStart",resourceRoot, function() setTimer(pedRotate,500,0) end) Works perfectly.
  8. IIYAMA

    Check Water

    https://wiki.multitheftauto.com/wiki/GetPedBonePosition https://wiki.multitheftauto.com/wiki/Te ... ainstWater good luck.
  9. I will test it myself over 6 hours. Also use: resourceRoot instead of root or getRootElement() (which I also forgot to change) I was that evening not very clear in my head....
  10. The "while" loops are very laggy when you don't use them careful. The loop at line 48 will never be broken?
  11. AFAIK you also can see that I wrote a wrong variable. Always check people their code, before testing it. Also check your debugscript(/debugscript 3) then you would also know why it isn't working. Try this: myPed = createPed(23,-1375.30627, -234.72827, 14.14844) setElementRotation(myPed,0,0,0) setPedControlState(myPed,"forwards",true) local rotationSpeed = 15 function pedRotate() local rx,ry,rz = getElementRotation(myPed) --setElementPosition (myPed, -1375.30627, -234.72827, 14.14844, false) rz = rz+rotationSpeed if rz <= 360 then setPedCameraRotation (myPed,-rz) else setPedCameraRotation (myPed,0) end end addEventHandler( "onClientResourceStart", root, function() setTimer(pedRotate,500,0) end)
  12. Next time explain better. I am still not sure what you mean. myPed = createPed(23,-1375.30627, -234.72827, 14.14844) setElementRotation(myPed,0,0,0) setPedControlState(myPed,"forwards",true) local rotationSpeed = 0.04 function pedRotate() local rx,ry,rz = getElementRotation(myPed) --setElementPosition (myPed, -1375.30627, -234.72827, 14.14844, false) rz = rz+rotationSpeed if rz <= 360 then setPedCameraRotation (ped,-rz) else setPedCameraRotation (ped,0) end end addEventHandler( "onClientResourceStart", root, function() addEventHandler("onClientRender",root,pedRotate) end)
  13. myPed = createPed(23,-1375.30627, -234.72827, 14.14844) setElementRotation(myPed,0,0,0) local k = 0 function pedRotate() if k+15 <= 360 then --setElementVelocity(myPed,1,1,1) k = k + 15 else k = 0 end local rx,ry,rz = getElementRotation(myPed) setElementRotation(myPed,rx,ry,k) end addEventHandler( "onClientResourceStart", getRootElement(), function() setTimer(pedRotate,500,0) end)
  14. I am not sure what your gui looks like, but if moving the gui is a problem. Then you have to calculate the offset. https://wiki.multitheftauto.com/wiki/GuiGetPosition
  15. Edited(see last post)
  16. addEvent("onKasszaKirablasa", true) addEventHandler("onKasszaKirablasa", getRootElement(), function () exports.global:giveMoney(source, math.random(30000,70000)) end ) Because you don't send parameters, you only send the source.
  17. setElementHealth(getElementHealth(localPlayer)+2) setElementHealth(localPlayer,getElementHealth(localPlayer)+2) Check debug!!! -_-" It should give the warning element expected at argument 1, but it is giving a number.
  18. So please help me anyone? I know this is an old topic but I need it .. We did, but you didn't listen.
  19. By using setCameraMatrix You can try this: local x, y, z, lx, ly, lz = 0,0,0,0,0,0 local antiCameraBugHandler = false local stopCameraBugFunction stopCameraBugFunction = function() if getElementHealth(localPlayer) > 0 then removeEventHandler("onClientRender",stopCameraBugFunction) antiCameraBugHandler = false setCameraTarget (localPlayer) else setCameraMatrix (x, y, z, lx, ly, lz) end end addEventHandler("onClientPlayerWasted",localPlayer, function() if not antiCameraBugHandler then x, y, z, lx, ly, lz = getCameraMatrix () antiCameraBugHandler = true addEventHandler("onClientRender",stopCameraBugFunction) end end)
  20. What about use a table? local adminsOnline = {} local rankedFun = function () local players = getElementsByType("player") local rankedPlayers = {} -- save here all players with ranks. for i=1,#players do local player = players[i] if hasObjectPermissionTo ( player, "command.mute", true ) then rankedPlayers[#rankedPlayers+1] = player end end if #adminsOnline ~= #rankedPlayers then -- check if the amount has changed, if changed update the grid. triggerClientEvent (root,"theyAreRanked",root,rankedPlayers) adminsOnline = rankedPlayers elseif #rankedPlayers > 0 then for i=1,#rankedPlayers do local newRanked = rankedPlayers[i] for j=#adminsOnline,1,-1 do if adminsOnline[j] == newRanked then table.remove(adminsOnline,j) end end end if #adminsOnline > 0 then triggerClientEvent (root,"theyAreRanked",root,rankedPlayers) adminsOnline = rankedPlayers end end end addEventHandler( "onPlayerLogin", root, rankedFun ) addEventHandler( "onPlayerLogout", root, rankedFun ) addEventHandler( "onResourceStart",resourceRoot,rankedFun)
  21. local cameraElements= getElementsByType("camera") local firstArray = next(cameraElements) if firstArray then local camera = cameraElements[firstArray] local posX = getElementData(camera,"posX") -- etc. end
  22. You sure about that? local vehicles = getElementsByType("vehicle") for i=1, #vehicles do local vehicle = vehicles[i] setElementVelocity ( vehicle,0,0, 30 ) end setTimer(function() local vehicles = getElementsByType("vehicle") for i=1, #vehicles do local vehicle = vehicles[i] setElementVelocity ( vehicle,0,0, -30 ) end end,1000,1) If you have low hp and you get rammed by a falling hunter?
  23. Note: Check if there is a controller, it can be none.
  24. And don't say to me that this has nothing to do with it, because this how you animate things.......
×
×
  • Create New...