-
Posts
1,273 -
Joined
-
Last visited
-
Days Won
1
Everything posted by GTX
-
Why did you put 0, 0, 0 in setElementPosition? setElementPosition(source, tonumber(x), tonumber(y), tonumber(z))
-
Use guiSetVisible instead of guiSetAlpha. local Alpha = guiGetVisible(GUIEditor.gridlist[1]) guiSetVisible(GUIEditor.gridlist[1], not Alpha)
-
Then the slots are empty.
-
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.
-
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)
-
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
-
You can't. Apply them a value from interpolateBetween
-
You mean like it duplicates? Use guiGridListClear
-
There's a parachute resource, you can try edit it.
-
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.
-
Put it in lua file and make a meta. Meta: <meta> <script src="server.lua" type="server"/> </meta>
-
Do you want to remove selected row? guiGridListRemoveRow(grid, guiGridListGetSelectedItem(grid)) Or remove row based on index from your table? guiGridListRemoveRow(grid, INDEX)
-
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.
-
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.
-
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 )
-
First of all, what do you mean by bullet? Ammo?
-
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
-
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
-
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
-
if string.find(string.lower(string.gsub(getPlayerName(v), "#%x%x%x%x%x%x", "")), string.lower(guiGetText(source))) then
-
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
-
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 )
-
What do you mean? There's no such function. You can make one by yourself.
