Jump to content

arer

Members
  • Posts

    8
  • Joined

  • Last visited

Details

  • Gang
    Groves

arer's Achievements

Newbie

Newbie (4/54)

0

Reputation

  1. Thanks all it works very fine But how to fill getPositionFromElementOffset good in script to set for example X coordinate as (player front facing angle)+0.5?? function getPositionFromElementOffset(element,offX,offY,offZ) local m = getElementMatrix ( element ) -- Get the matrix local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] -- Apply transform local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z -- Return the transformed point end bindKey( "w", "down", function () if getKeyState( "lshift" ) == true then local px,py,pz=getElementPosition(localPlayer) local x,y,z = getPositionFromElementOffset(localPlayer, px, py, pz) setElementPosition(localPlayer, x, y, z) end end ) It's throwing away my character on some far away coordinates.
  2. I think this is on client side. Im looking for something like this: https://github.com/lpiob/MTA-XyzzyRP/blob/master/resources/[XyzzyRP]/lss-core/anims_c.lua But this script is made for some gamemode and is not working for me.
  3. Hi. My question is how to make this script: When i press LSHIFT and later click W (LSHIFT+W at the same time), player is changing position on X+0.05 The same thing with LSHIFT+S - change position to X-0.05 And.. Repeat this way with Lshift+A, Lshift+D to Y coordinate. bindKey( "lshift", "both", function (player) if getKeyState("lshift") == true then local px,py,pz=getElementPosition(player) setElementPosition(player, px+0.05, py, pz) elseif getKeyState("lshift") == false then local px,py,pz=getElementPosition(player) setElementPosition(player, px-0.05, py, pz) end end ) I have tried this but it is not working..
  4. Could you please help me with this? I make this on server side: function styl(playerSource) triggerClientEvent(playerSource, "styl", playerSource) setPedWalkingStyle(playerSource, styl) end and this is triggering from client script: function selectStyle() local item = guiGridListGetSelectedItem(grid) if item == -1 then return end local styl = guiGridListGetItemData(grid, item, 1) local styl_text = guiGridListGetItemText(grid, item, 1) outputChatBox("Zmieniasz swój styl chodzenia na: "..styl_text) addEventHandler("styl", localPlayer, selectStyle) hideStylePanel() end Not working
  5. Hi. I observed bad thing - when someone changes walking style, only he can see this. Everyone see "strongman" walking style for everyone. How to fix synchronisation of this? I have this script: local window local showed = false local styles = { {"Normal", 0}, {"Woman", 129}, {"Woman2", 133}, } function createStylePanel() if showed then return end local sw, sh = guiGetScreenSize() window = guiCreateWindow(sw/1.4, sh/4, sw/4.5, sh/2, "Style", false) grid = guiCreateGridList(0, 0.06, 1, 0.75, true, window) col1 = guiGridListAddColumn(grid, "Styl chodzenia", 0.9) button1 = guiCreateButton(0, 0.82, 1, 0.07, "Ustaw styl", true, window) addEventHandler("onClientGUIClick", button1, selectStyle, false) addEventHandler("onClientGUIDoubleClick", grid, selectStyle, false) button2 = guiCreateButton(0, 0.9, 1, 0.07, "Zamknij", true, window) addEventHandler("onClientGUIClick", button2, hideStylePanel, false) showCursor(true) showed = true for i,v in ipairs(styles) do local row = guiGridListAddRow(grid) guiGridListSetItemText(grid, row, col1, v[1], false, false) guiGridListSetItemData(grid, row, col1, v[2], false, false) end end addCommandHandler("ws", createStylePanel) function hideStylePanel() removeEventHandler("onClientGUIClick", button1, selectStyle, false) removeEventHandler("onClientGUIDoubleClick", grid, selectStyle, false) removeEventHandler("onClientGUIClick", button2, hideStylePanel, false) destroyElement(window) showCursor(false) showed = false end function selectStyle() local item = guiGridListGetSelectedItem(grid) if item == -1 then return end local styl = guiGridListGetItemData(grid, item, 1) local styl_text = guiGridListGetItemText(grid, item, 1) outputChatBox("Zmieniasz swój styl chodzenia na: "..styl_text) setPedWalkingStyle(localPlayer, styl) hideStylePanel() end
  6. Yeah, it's working now! Very thank you!
  7. Very thank you! There is error getting in line 13 when im using /toggle_col: "attempt to call global 'setElementCollidableWith' (a nil value)
  8. Hi. I have a question how to make players going through each other? I made something but this is not working. function on(el,en) for k,v in ipairs(getElementsByType("player")) do --setElementCollisionsEnabled(v, false) setElementCollidableWith(v, v, false) end end function off(el,en) for k,v in ipairs(getElementsByType("player")) do --setElementCollisionsEnabled(v, true) setElementCollidableWith(v, v, true) end end addCommandHandler ( "k", on ) addCommandHandler ( "k2", off )
×
×
  • Create New...