Jump to content

Fist

Members
  • Posts

    433
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Fist

  1. did you even paste function isPedAiming() from wiki in same script as you pasted that code what i wrote down?
  2. "onClientPlayerJoin" -- event "onClientPlayerQuit" -- event "onClientRender" -- event getPlayerName -- function guiGetScreenSize -- function dxDrawText -- function
  3. http://prntscr.com/hm4dji still render size is same for it
  4. yeah i already have that on too, but gas size starts with really big size, and if someone is on edge that object won't render until he moves closer to center and he won't see gas effect in that place and he won't be able to tell if he's in it or not.
  5. @IIYAMA so i tried with object, all works fine but when you move far away from object it stops rendering it, is there a way to prevent this? I tried doing setElementStreamable(obj,false) but that doesn't work visually, i guess it just stays there but not visually for client. Tried even placing a huge .col file neither worked.
  6. yep it's more or less last one what you mentioned. I tried with dx but that eats way too much fps, gonna use an object then.
  7. huh? marker creation ( for just testing ) addCommandHandler("marker",function(source) local x,y,z = getElementPosition(source); local wall = createMarker(x,y,z,"cylinder",100,255,255,255,200,root); setMarkerSize(wall,100) -- tried resizing it with this maybe that would've changed render size with markers size together, but nope. setElementDimension(wall,getElementDimension(source)); end) here's shader applying a texture to marker. addEventHandler("onClientResourceStart",resourceRoot,function() local wallshader = dxCreateShader("shader/zone.fx"); local walltexture = dxCreateTexture("images/wall.png"); dxSetShaderValue(wallshader,"MarkerSkin",walltexture); engineApplyShaderToWorldTexture(wallshader,"cj_w_grad"); end);
  8. i'm just trying to create pubg zone indicator, if anyone knows a workaround, i would be glad to hear it.
  9. client: function togglePlayerControl(weapon) toggleControl("fire", false) if isPedAiming(localPlayer) then toggleControl("fire", true) end end addEventHandler ( "onClientRender", root, togglePlayerControl)
  10. It's not just for DirectX Drawing functions intended. It's also intended for instant response. For example, you can also use a timer, but minimum value that updates it each time is 50 miliseconds, of course, 50 miliseconds from instant response ain't much but timers also eat more performance which on other hand onClientRender event doesn't. Telling from experience.
  11. change eventhandler from "onClientResourceStart" to "onClientRender"
  12. hello, i have problem with making marker bigger, visually it all works fine. But when player moves screen when it goes out of default marker size it stops rendering marker and disappears until player moves screen back to default size. This is a problem because i need marker really big just for visuals. it's like rendering size just stays the same, but marker's size changes.
  13. Fist

    setElementData

    ty this idea works fine.
  14. Fist

    setElementData

    omg, you didn't understand it. Whatever, just close this topic if anyone can. Doesn't look like someone can understand what i meant. lol
  15. Fist

    setElementData

    that won't work anyway if i use it on same element data, even adding more variables in it because element data's name stays the same. It will just overwrite it for every single item. I tried by making name a table which stores unique id or something like that but u can't pass tables in name.
  16. Fist

    setElementData

    so i've been making pubg inventory, for pubg gamemode what i'm working on. Inventory works perfectly, only thing is that how items are saved, i'm using setElementData and then i use predefined table where all item names are in, and then compare that table with player's element data that has and if he does have them then display them in inventory. But that's not the thing i need help with. I need help with making few items unique, what i mean by that is for example Helmet, that item has more properties to it, so it goes like that setElementData(player,"Helmet",{amount,armor}, works fine too, but problem is in that, armor value changes for each item of helmet, and making them all the same value when are stacked together, i know it's because of that i use same name for them but i can't find other solution. I tried many other ways doing it. still couldn't find a way to do it. So if anyone has any ideas, please let me know. By the way, sorry about ban explanation, not that good at English.
  17. getGroundPosition It is required that the point is near enough to the local player so that it's within the area where collision data is loaded. If this is not the case, an incorrect position will be returned
  18. then you're pretty limited, kinda confused why you're asking for suggestions of what maps to export if you only do what are already converted to SA.
  19. how about PUBG (Player Unknown's Battleground) ? I'm not sure if map is too big or not, haven't played that game but since i started making pubg gm on mta would love to see that map on gta. Just googled, size of the map is 8x8km. Doesn't sound that big and ain't much with poly, 'cause most of the map is covered just with fields.
  20. well if it just does that then it explains why fixing that didn't help. I could try removing and adding attachments to players like every second but idk how that would work, i guess i can try and we'll see how it looks.
  21. couldn't it be because timer for resuming that coroutine is each second?
  22. how i could do that without like adding iprint everywhere on the script?
  23. there is no errors indeed and works well, but still attached bones sometimes unattaches and stays in mid air for some time and then attaches back to player.
  24. ty man, can't tell you if it works tho, 'cause you can't really tell it instantly. Will put it on server and will see how it goes.
  25. Can anyone help me with bone_attach throwing out this error, and sometimes it unattaches every element from player and freezes in mid air and stays there for small amount of time and then attaches back to its player. ERROR: bone_attach\attach_func.lua:113: cannot resume dead coroutine [string "?"] attPed = {}; attBone = {}; attX = {}; attY = {}; attZ = {}; attRX = {}; attRY = {}; attRZ = {}; function attachElementToBone(element, ped, bone, x, y, z, rx, ry, rz) if (not isElement(element) and isElement(ped)) then return false; end if (getElementType(ped) ~= "ped" and getElementType(ped) ~= "player") then return false; end local bone = tonumber(bone); if (not bone or bone < 1 or bone > 20) then return false; end local x,y,z,rx,ry,rz = tonumber(x) or 0,tonumber(y) or 0,tonumber(z) or 0,tonumber(rx) or 0,tonumber(ry) or 0,tonumber(rz) or 0; attPed[element] = ped; attBone[element] = bone; attX[element] = x; attY[element] = y; attZ[element] = z; attRX[element] = rx; attRY[element] = ry; attRZ[element] = rz; if setElementCollisionsEnabled then setElementCollisionsEnabled(element, false); end if script_serverside then triggerClientEvent("boneAttach_attach", root, element, ped, bone, x, y, z, rx, ry, rz); end return true; end function detachElementFromBone(element) if (not element) then return false; end if (not attPed[element]) then return false; end clearAttachmentData(element); if setElementCollisionsEnabled then setElementCollisionsEnabled(element, true); end if (script_serverside) then triggerClientEvent("boneAttach_detach", root, element); end return true; end function isElementAttachedToBone(element) if (not element) then return false; end return isElement(attPed[element]); end function getElementBoneAttachmentDetails(element) if not isElementAttachedToBone(element) then return false; end return attPed[element], attBone[element], attX[element], attY[element], attZ[element], attRX[element], attRY[element], attRZ[element]; end function setElementBonePositionOffset(element,x,y,z) local ped,bone,ox,oy,oz,rx,ry,rz = getElementBoneAttachmentDetails(element); if (not ped) then return false; end return attachElementToBone(element, ped, bone, x, y, z, rx, ry, rz); end function setElementBoneRotationOffset(element,rx,ry,rz) local ped,bone,x,y,z,ox,oy,oz = getElementBoneAttachmentDetails(element); if (not ped) then return false; end return attachElementToBone(element, ped, bone, x, y, z, rx, ry, rz); end if (not script_serverside) then function getBonePositionAndRotation(ped, bone) local bone = tonumber(bone); if (not bone or bone < 1 or bone > 20) then return false; end if (not isElement(ped)) then return false; end if (getElementType(ped) ~= "player" and getElementType(ped) ~= "ped") then return false; end if (not isElementStreamedIn(ped)) then return false; end local x,y,z = getPedBonePosition(ped, bone_0[bone]); local rx,ry,rz = getEulerAnglesFromMatrix(getBoneMatrix(ped, bone)); return x,y,z,rx,ry,rz; end end function clearAttachmentData(element) attPed[element] = nil; attBone[element] = nil; attX[element] = nil; attY[element] = nil; attZ[element] = nil; attRX[element] = nil; attRY[element] = nil; attRZ[element] = nil; end addEventHandler(script_serverside and "onElementDestroy" or "onClientElementDestroy", root, function() if (not attPed[source]) then return; end clearAttachmentData(source); end); function forgetNonExistingPeds() local checkedcount = 0; while true do for i,v in pairs(attPed) do if not isElement(v) then clearAttachmentData(i); end checkedcount = checkedcount + 1; if (checkedcount >= 1000) then coroutine.yield(); checkedcount = 0; end end coroutine.yield(); end end clearing_nonexisting_peds = coroutine.create(forgetNonExistingPeds); setTimer(function() coroutine.resume(clearing_nonexisting_peds) end, 1000, 0);
×
×
  • Create New...