-
Posts
667 -
Joined
-
Last visited
-
Days Won
4
Everything posted by Mr.Loki
-
Yeah but it does all the hard work for you so u just gotta know how to use the exports.
-
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
-
What errors are in the debug?
-
@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.
-
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)
-
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.
- 1 reply
-
- 1
-
The best resource for the attacking peds imo is slothbot https://community.multitheftauto.com/index.php?p=resources&s=details&id=672
-
Oh sorry I read that post wrong my bad.
-
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.
-
You can also set the player weapon to fist then disable weapon switching and fire control so they never their weapons in hand
-
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"
-
ah ok, well i can't help ya there lol
-
what site and what text on the site are you trying to get?
-
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.
-
setVehicleColor setTimer
-
No, please read the wiki. serverside applies to all weapons clientside applies to custom weapons created with createWeapon which is a client only function
-
dont use spawnPlayer use setElementInterior
-
oops i meant just remove the 4th arg in setPedAnimation sorry i was testing it
-
change: setPedAnimation ( player, "ped", "IDLE_tired", 200 ) to : setPedAnimation ( player, "ped", "IDLE_tired" )
-
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)
-
because this is clientsided it needs to be triggered from the server for all players to see it
-
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)