Jump to content

GTX

Members
  • Posts

    1,273
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by GTX

  1. Why did you put 0, 0, 0 in setElementPosition? setElementPosition(source, tonumber(x), tonumber(y), tonumber(z))
  2. GTX

    not work

    Use guiSetVisible instead of guiSetAlpha. local Alpha = guiGetVisible(GUIEditor.gridlist[1]) guiSetVisible(GUIEditor.gridlist[1], not Alpha)
  3. Then the slots are empty.
  4. GTX

    not work

    Maybe check variables again. It's local Alpha = guiGetAlpha(GUIEditor.gridlist[1]) guiSetAlpha(GUIEditor.gridlist[1], not Alpha) not local Alpha = guiGetAlpha(GUIEditor.girdlist) guiSetAlpha(GUIEditor.girdlist,not aplha) So shallow.
  5. Full code would be really useful as LabiVila said. However, if you want to take money from specific player, you must pass a player through triggerServerEvent. triggerServerEvent("itens", localPlayer) And to get player server side, use source. takePlayerMoney(source, 500) -- You don't need tonumber here. local currentgivem4 = getElementData(source, "M4") or 0 setElementData(source, "M4", currentgivem4+1)
  6. There are 12 slots (including 0) and with second argument on getPedWeapon you can make that. for i=0, 12 do outputChatBox(getPedWeapon(player, i)) end
  7. You can't. Apply them a value from interpolateBetween
  8. You mean like it duplicates? Use guiGridListClear
  9. GTX

    [HELP] dxDrawImage

    Is it added to the meta?
  10. GTX

    Parachute bug

    There's a parachute resource, you can try edit it.
  11. You mean when you create a weapon for player, it doesn't show in the grid list? That's because you have to refresh the grid list.
  12. Put it in lua file and make a meta. Meta: <meta> <script src="server.lua" type="server"/> </meta>
  13. Do you want to remove selected row? guiGridListRemoveRow(grid, guiGridListGetSelectedItem(grid)) Or remove row based on index from your table? guiGridListRemoveRow(grid, INDEX)
  14. GTX

    Learn script

    ipairs/pairs is used when you're looping through a table. We are using so-called numeric for which loops through specific chunk and returns current processed number based on what numbers you expressed as values in for loop.
  15. GTX

    Look My help.

    When player buys a weapon, set element data to them. If that element data is true or whatever (while buying), use return, so player doesn't buy weapon (and ammo?). Use onClientPlayerWeaponFire and use 3rd argument (ammoInClip). If it's zero then set element data to false, so player can buy again. I think that's what you mean. Correct me if I'm wrong.
  16. GTX

    Learn script

    DX functions return only boolean value. That means it's true (if created successfully) or false (otherwise). That is a bit harder. You'll have to calculate their intersections. Like this (based on my example): addEventHandler("onClientClick", root, function(button, state, x, y) if button == "left" and state == "down" then for i=1, 12 do if x >= 500 and x <= 500+50 and y >= 100+(i*50) and y <= 100+(i*50)+30 then outputChatBox("Pressed on rectangle number "..i) end end end end )
  17. GTX

    Look My help.

    First of all, what do you mean by bullet? Ammo?
  18. GTX

    Learn script

    You can use 'for' loop to draw multiple rectangle based on their position and index from loop. http://www.lua.org/pil/4.3.4.html Example: for i=1, 12 do dxDrawRectangle(500, 100+(i*50), 50, 30, tocolor(0, 0, 0, 255)) end
  19. GTX

    Learn script

    viewforum.php?f=148 Here are many tutorials you can learn from. Some topics include video. Explore Here's one: viewtopic.php?f=148&t=75501&p=701393#p701393
  20. function dx_move(_, _, x, y) if ( x >= sW*741 and x <= (sW*741) + (sW*162) and y > (sH*587) and y < (sH*587) + (sH*622) ) then color2 = tocolor (255, 255, 0, 255) else color2 = tocolor (255, 255, 255, 255) end if ( x >= sW*381 and x <= (sW*381) + (sW*202) and y > (sH*587) and y < (sH*587) + (sH*622) ) then color = tocolor (255, 255, 0, 255) else color = tocolor (255, 255, 255, 255) end end
  21. if string.find(string.lower(string.gsub(getPlayerName(v), "#%x%x%x%x%x%x", "")), string.lower(guiGetText(source))) then
  22. That's much different code than I gave you. guiGridListClear(GridList) for i, v in ipairs(getElementsByType"player") do if string.find(string.lower(string.gsub(getPlayerName(v), "#%x%x%x%x%x%x", "")), guiGetText(source)) then guiGridListSetItemText(GridList, guiGridListAddRow(GridList), 1, tostring(i), false, false) guiGridListSetItemText(GridList, guiGridListAddRow(GridList), 2, getPlayerName(v), false, false) end end
  23. addEventHandler("onClientGUIChanged", root, function() if source == edit then guiGridListClear(grid) for i, v in ipairs(getElementsByType"player") do if string.find(string.lower(string.gsub(getPlayerName(v), "#%x%x%x%x%x%x", "")), guiGetText(source)) then guiGridListSetItemText(grid, guiGridListAddRow(grid), column, getPlayerName(v), false, false) end end end end )
  24. GTX

    Look My help.

    What do you mean? There's no such function. You can make one by yourself.
×
×
  • Create New...