Jump to content

IIYAMA

Moderators
  • Posts

    6,097
  • Joined

  • Last visited

  • Days Won

    218

Everything posted by IIYAMA

  1. IIYAMA

    Anti-Cheat Corner

    Mods>Deathmatch>Resources and some servers have a folder called AntiCheat just wondering why they have that when MTA already has it I use anti cheat to kill laggers when they got timed out. Mta doesn't have much things against player lagg to be honest. (except for freeze players) The only thing I can think about is, to prevent corrupted admins being abusing their powers.
  2. If you don't know how an event or function works. There is this page to help you with finding out what the source is, etc. addEventHandler("onElementModelChange", root, function (oldModel,newModel) if newModel == 425 and getElementType(source) == "vehicle" then --425 is the model of the hunter local rotX, rotY, rotZ = getElementRotation(source) -- source is the variable of the vehicle setElementRotation(source,rotX,rotY+10,0) -- always define all required fields. end end)
  3. You can also use: https://wiki.multitheftauto.com/wiki/SetElementRotation For that sample with the bugged car.
  4. Try this(fill in the location) local x,y,z = 0,0,0 -- fill in addEventHandler("onElementModelChange", root, function (oldModel,newModel) if newModel == 425 and getElementType(source) == "vehicle" then --425 = hunter setElementPosition(source,x,y,z) end end)
  5. np.
  6. getElementPosition getElementsByType("player",root,true) processLineOfSight getPedBonePosition setControlState addEventHandler("onClientRender",root,functionVariable) getElementHealth getElementRotation setElementRotation getScreenFromWorldPosition getWorldFromScreenPosition Note you can't use: setPedAimTarget You can try these things, But the aim, I simply don't know.
  7. and restart didn't had any result?
  8. Hoi, Als je rechten op een verkeerde manier beperkt voor moderator, dan beperk je ze ook voor hogere ranken. Probeer te achter halen wat je bij moderator op false heb gezet. Knip dit uit moderator en plak dit in supermoderator, vervolgens zet je wat op "false" staat terug op "true". Het op false zetten van rechten heeft geen zin, omdat als ze niet ingevuld staan toch geen rechten hebben (behalve als ze in de rank daar onder wel rechten hebben). Ranken maken gebruik van elkaars instellingen. user > moderator (moderator gebruikt user) moderator > supermoderator (supermoderator gebruikt moderator) supermoderator > admin (......) Groet, IIYAMA
  9. jesus..... I thought it was just a xp bar. Not tested. Probably a typo/bug. But you can try it and give a call when it doesn't work. Client local x,y = guiGetScreenSize() local playerXP = 0 local maxPlayerXP = 100000 local colour = tocolor(187, 0, 0, 150) local colourBlack = tocolor(0, 0, 0,255) local startX,startY = x*0.80,y*0.30 -- 0.80 = 80% Left , 0.30 = 30% Down local endX,endY = x*0.90,y*0.33 -- 0.90 = 90% Left , 0.33 = 33% Down local dxW,dxH = endX-startX,endY-startY -- different between the start and the end addEventHandler("onClientRender",root, function() local factor = playerXP/maxPlayerXP -- create a factor. Sample 80 / 100 = 0.8 (80%) dxDrawRectangle(startX,startY, dxW,dxH, colourBlack) -- colour the frame with the colour black. dxDrawRectangle(startX,startY, dxW*factor,dxH, colour) -- overflow the frame with another colour. end) addEvent("newXP",true) addEventHandler("newXP",root, function() playerXP = playerXP+100 if playerXP > maxPlayerXP then -- to prevent a bugged bar, you never know….. maxPlayerXP = playerXP *100 end end) Server --- server --- addEventHandler("onPlayerWasted",root, function (ammo,attacker) if attacker and getElementType(attacker) == "player" then triggerClientEvent(attacker,"newXP",attacker) end end) Good luck.
  10. https://wiki.multitheftauto.com/wiki/DxDrawRectangle yes. But that one on the picture isn't a dx bar.
  11. IIYAMA

    Anti-Cheat Corner

    Cause mta files can be edited by smart people.
  12. 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.
  13. 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.
  14. it is already there.... on a default admin pannel.
  15. 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
  16. resourceRoot gives the same result as this shit..... getResourceRootElement(getThisResource())......... resourceRoot is the output of those 2 functions.
  17. https://forum.multitheftauto.com/viewforum.php?f=145
  18. @.: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 )
  19. 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.
  20. 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
  21. Advanced_Bumping, (signature)
  22. 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!!
  23. what do you mean much addEventHandler ? there is just 1.
  24. 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.
  25. 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) ]]
×
×
  • Create New...