Jump to content

Mr.Loki

Members
  • Posts

    667
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by Mr.Loki

  1. Yeah but it does all the hard work for you so u just gotta know how to use the exports.
  2. Mr.Loki

    Admin logo

    oh god... local tag = dxCreateTexture("Duty/Fejleszto_Duty.png") function Fejleszto_Duty() for _,player in pairs(getElementsByType'player')do if getElementData(player, "adminduty") then dxDrawImageOnElement(player,tag,20,2.3) -- adjust 2.3 to how high you want the image ofer the player end end addEventHandler("onClientPreRender", root, Fejleszto_Duty) -- this is a custom function and must be declared in your code function dxDrawImageOnElement(TheElement,Image,distance,height,width,R,G,B,alpha) local x, y, z = getElementPosition(TheElement) local x2, y2, z2 = getElementPosition(localPlayer) local distance = distance or 20 local height = height or 1 local width = width or 1 local checkBuildings = checkBuildings or true local checkVehicles = checkVehicles or false local checkPeds = checkPeds or false local checkObjects = checkObjects or true local checkDummies = checkDummies or true local seeThroughStuff = seeThroughStuff or false local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false local ignoredElement = ignoredElement or nil if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then local sx, sy = getScreenFromWorldPosition(x, y, z+height) if(sx) and (sy) then local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distanceBetweenPoints < distance) then dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255)) end end end end
  3. Mr.Loki

    Admin logo

    post your full code
  4. Mr.Loki

    Admin logo

    What errors are in the debug?
  5. Mr.Loki

    Admin logo

    @Zsoltisz getPedBonePosition returns 3 values (x,y,z) it does not return the player. Your code specifies a "targetPlayer" which I'm guessing is the player so i think that you should use that. local tag = dxCreateTexture("Duty/Fejleszto_Duty.png") function Fejleszto_Duty() adminszolis = getElementData(targetPlayer, "adminduty") if (exports.StarMTA_core:Fejleszto(targetPlayer) == true and adminszolis == true or exports.StarMTA_core:Fejleszto(thePlayer) == true) then dxDrawImageOnElement(targetPlayer,tag) end end addEventHandler("onClientPreRender", root, Fejleszto_Duty) try this.
  6. Mr.Loki

    Admin logo

    follow click on the function @aka Blue "getPedBonePosition" just said to go to the wiki where it explains how to get the bone position so that u can use that position to place the picture at that bone location. you have to use the ID not the name of the bone so "BONE_HEAD2" ID is 6 so local hX, hY, hZ = getPedBonePosition(player, 6)
  7. Rather than deleting the topic you should share your fixes with everyone. You may just help someone who might have also had the same problem.
  8. The best resource for the attacking peds imo is slothbot https://community.multitheftauto.com/index.php?p=resources&s=details&id=672
  9. Oh sorry I read that post wrong my bad.
  10. A little note. To cache a file is to store it for later use and faster loading. Setting cache to false means that it will not be downloaded and saved.
  11. Mr.Loki

    help

    function cout(thePlayer) local id = tonumber(getElementData(thePlayer,"ids")) for x=1 , 10 do if x == id then outputChatBox("yes") -- فی المکان end end end addCommandHandler("cout",cout) A for loop uses "do" not then try this
  12. You can also set the player weapon to fist then disable weapon switching and fire control so they never their weapons in hand
  13. Mr.Loki

    help

    The [source] is just the key in the table to find the attacker for the player that was killed. If it was [attacker] then the player who killed someone could use the 911 cmd to get his self wanted.
  14. because that script is client side and isObjectInACLGroup is a server only function what i did was move the command to the server-side and used an event to trigger "Superman.cmdSuperman"
  15. what site and what text on the site are you trying to get?
  16. Remove playerSource from the function and just use source because in your code the playerSource arg is actually the clickedElement. You can just use addEvent("vehPanel",true) addEventHandler("vehPanel",root,function(clickedElement) local posX, posY, posZ = getElementPosition( clickedElement ) local vehSphere = createColSphere( posX, posY, posZ, 5) if(isElementWithinColShape ( source, vehSphere )) then triggerClientEvent("panelRender",source, clickedElement) end end) because the source is the element that triggered the event.
  17. No, please read the wiki. serverside applies to all weapons clientside applies to custom weapons created with createWeapon which is a client only function
  18. dont use spawnPlayer use setElementInterior
  19. oops i meant just remove the 4th arg in setPedAnimation sorry i was testing it
  20. change: setPedAnimation ( player, "ped", "IDLE_tired", 200 ) to : setPedAnimation ( player, "ped", "IDLE_tired" )
  21. ok then this should work addEvent("switchToNormal",true) addEventHandler("switchToNormal",root,function(target) ped = target setPedAnimation ( ped, "ped", "IDLE_tired", 200 ) setTimer (setPedAnimation,1500,1,ped) setElementData(ped, "tired", false) triggerClientEvent(ped, "sayInformation", root, "en", "You can go now.") end)
  22. Mr.Loki

    help

    because this is clientsided it needs to be triggered from the server for all players to see it
  23. try this addEvent("switchToNormal",true) addEventHandler("switchToNormal",root,function(target) setPedAnimation ( target, "ped", "IDLE_tired", 200 ) setTimer (setPedAnimation,1500,1,target) setElementData(target, "tired", false) triggerClientEvent(target, "sayInformation", root, "en", "You can go now.") end)
×
×
  • Create New...