Jump to content

McDeKi

Members
  • Posts

    55
  • Joined

  • Last visited

Everything posted by McDeKi

  1. Last post. https://forum.multitheftauto.com/viewto ... 2&start=15
  2. Hello, I've made a simple resource, which allows create dx edit box. Video: Functions: createEditBox( string/int id, float( 0 - 1 ) x, float( 0 - 1 ) y, float( 0 - 1 ) width, float( 0 - 1 ) height, bool visible, string text, bool mask, int maxLength, string font text, bool space, int type, function color( r, g, b, a ), bool rectangle, function rectangleColor ( r, g, b, a ), float scaleText, bool clip, int ms ( how many miliseconds have to pass to delete text with backspace), bool helpText , string helpText, function helpTextColor( r, g, b, a ), bool helpTextOff, float helpTextScale, string helpTextFont, bool postGUI, bool carret, function carretColor( r, g, b ), bool specialCharacters, bool clickable ) --//Creates new dxEditBox changeText( id, text ) --//Changes text changeVisibility( id, bool ) --//Changes visibility of edit box clickable( id, bool ) --//Is edit box clickable getText( id ) --//Gets text setPosition( id, x, y ) --//Sets position of edit box setSize( id, width, height ) --//... deleteEditBox( id ) --//Deletes edit box isActive( id ) --//Is edit box clicked Examples: exports.dxEditBox:createEditBox( "1", 0.2, 0.2, 0.20, 0.07, true, "", false, 25, "arial", false, 0, { 0, 0, 0, 180 }, true, { 255, 255, 255, 180 }, 2, true, 60, true, "Simple box 1", { 0, 0, 0, 40 }, true, 3, "arial", true, true, {0, 114, 210}, false ) exports.dxEditBox:createEditBox( "2", 0.3, 0.31, 0.25, 0.07, true, "", true, 25, "arial", false, 0, { 0, 0, 0, 180 }, true, { 0, 205, 0, 180 }, 3, true, 60, true, "Passworded box", { 0, 0, 0, 150 }, true, 3, "arial", true, true, {0, 0, 0}, false ) exports.dxEditBox:createEditBox( "3", 0.4, 0.41, 0.30, 0.07, true, "", false, 25, "arial", false, 1, { 255, 255, 255, 180 }, true, { 0, 0, 0, 180 }, 2, true, 60, true, "Numbers only", { 255, 255, 255, 40 }, true, 3, "arial", true, true, {255, 255, 255}, false ) exports.dxEditBox:createEditBox( "4", 0.55, 0.51, 0.23, 0.07, true, "", false, 25, "arial", true, 0, { 0, 0, 0, 180 }, true, { 0, 114, 210, 180 }, 2, true, 60, true, "Special char.", { 255, 255, 255, 130 }, true, 3, "arial", true, true, {255, 255, 255}, true ) exports.dxEditBox:createEditBox( "5", 0.7, 0.61, 0.25, 0.1, true, "", false, 25, "pricedown", false, 0, { 0, 0, 0, 180 }, true, { 255, 255, 255, 80 }, 2, true, 60, true, "Custom param.", { 0, 0, 0, 40 }, true, 2.5, "default", true, true, {0, 0, 0}, false ) Download: https://community.multitheftauto.com/ind ... s&id=10804
  3. As you mentioned its possible with dxSetShaderValue and fmod http://http.developer.nvidia.com/Cg/fmod.html
  4. Hello, I've made a simple example for you: http://www9.zippyshare.com/v/21401775/file.html I've used this tank, you have to download it, otherwise you wont see any effect. http://www.gamemodding.net/en/gta-san-a ... shing.html You can change texture by passing their name in: local nazwaTextury = "superpershing_track"
  5. Nice, but you forgot to mention that these weapons slide when player aims. http://bugs.mtasa.com/view.php?id=8055
  6. Bone_attach is already onClientPreRender( I've changed it to onClientRender, but it didnt change anything).
  7. Hey, I've noticed that when the player is aiming the rotation of objects attached with bone_attach ( latest one ) is delayed. aiming: the rotation/postion is delayed normal rotation: everything works fine local r = 0 function s2() if r >= 360 then r = 0 end r = r + 20 setPedCameraRotation( localPlayer, -r ) end local w = false function s() w = not w if w then addEventHandler('onClientRender', root, s2) else removeEventHandler('onClientRender', root, s2) end end addCommandHandler("ro", s) function s3() if r >= 360 then r = 0 end r = r + 20 x,y = getElementRotation(localPlayer) setElementRotation( localPlayer, x, y, r) end local wr = false function s4() wr = not wr if wr then addEventHandler('onClientRender', root, s3) else removeEventHandler('onClientRender', root, s3) end end addCommandHandler('po', s4) I've used this code for testing. I've tried: -setting player rotation to object rotation - didnt work -attachElements ( the rotation and postion still were delayed ) -getting postion of muzzle ( getPedWeaponMuzzlePosition ) and passing it instead of getPedBonePosition - didnt work -setCameraTarget ( the rotation still was delayed ) -setPedCameraRotation ( the rotation still was delayed ) -setCameraTarget + setCameraMatrix - didnt work very well, still was delayed I think the problem is setElementRotation / setElementPosition Its very big problem for me, cus I wanted to make a custom clothes for peds and the flashlight for weapons, but as you can see the rotation goes weird when the camera is being moved. Any help will be greatly appreciated Edit: Also I've tried SAMP's bone attach and everything worked fine :C
  8. attachElements doesnt support bones, even with offsets.
  9. Hello, Is there any alternative to bone_attach, because bone_attach doesnt support all bones which are included in getPedBonePosition ( 34: BONE_LEFTWRIST 35: BONE_LEFTHAND 36: BONE_LEFTTHUMB and others ), also it seems to be sluggish, especially while changing the position of camera ( object flies in the air ).
  10. Download stops at 0B - 21.42 MB. I think there is something wrong with port 22005.
  11. Nvm, it doesnt work with CJ skin.
  12. Hello, I wanted to attach object to spine with bone_attach resource. function Obiekt(ID) local element = createObject(ID,0,0,0,0,0,0,true) exports.bone_attach:attachElementToBone(element, source, 3, 0, -0.25, 0, 85, 0, 0) outputChatBox(ID) return true end addEvent("TymczasowyPrzedmiot", true) addEventHandler("TymczasowyPrzedmiot", root, Obiekt ) It works fine with other bones, but if I attach it to BONE_SPINE1 object is invisible.
  13. Hello. I've got array with items ( inventory ). The problem is when I have two elements with the same values but with different indexes. --//Pseudo code Inventory[1][6] = "Apple" Inventory[5][4] = "Apple" lua allocates those elements in the same place in memory, inventory[1][6] = "Apple" and Inventory[5][4] = "Apple" has the same space (table: 21D2E2A8) First item: Second item:
  14. McDeKi

    GTA SA Nodes

    Im not sure, but maybe you can use this resource http://crystalmv.net84.net/pages/script ... editor.php
  15. Well, my inventory has 40 slots (max) and the string can be long for 159 chars, due to inventory is in format: X,Y,ID|X,Y,ID
  16. What then? Should I send inventory to server for example when I add new item or change position of it?
  17. It isnt working --//Zapis przedmiotow\\-- function zapiszEkwipunek() local PrzedmiotyDoZapisania = {} for k,v in pairs( Plecak )do for i=1, wysokoscY do if not (Plecak[k][i] == false) then table.insert(PrzedmiotyDoZapisania, k..","..i..","..Plecak[k][i].id) end end end return PrzedmiotyDoZapisania end As I said it works when the resource stop function zamienNaString() triggerServerEvent("ZapiszPrzedmioty", getLocalPlayer(), table.concat(zapiszEkwipunek(), "|")) end addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()), zamienNaString)
  18. No errors, the event is not triggered to server from client
  19. It doesnt matter it works with onClientResourceStop function zamienNaString() triggerServerEvent("ZapiszPrzedmioty", getLocalPlayer(), table.concat(zapiszEkwipunek(), "|")) end addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()), zamienNaString)
×
×
  • Create New...