Jump to content

WhoAmI

Members
  • Posts

    1,248
  • Joined

  • Last visited

Everything posted by WhoAmI

  1. Actually correct one is math.floor ( number + 0.5 ) or math.ceil ( number - 0.5 )
  2. Yep. As I said, this DX library should be inside script which is goin' to use it.
  3. As it is in README Note: Due to the current limitations in MTA that evolves around Lua environments and Object Orientated Programming, this GUI system only works within one resource and can only be used by one resource. We do not recommend running multiple dxGUI scripts (across different resources or within a single resource) as this may cause a significant impact to visitors of your server. We recommend that all important logic that utilises the GUI exists within a centralised resource (take care for security, keep secure scripts away from the main GUI). So it won't be any exported functions. Anyway, whole script works on OOP. OOP functions as far as I know are impossible to export. Personally I tested this script and it is really good, tho. You have to just see functions in files. For example creation window: local window = dxWindow:create ( x, y, width, height, text ) And if you want to change something window:setTitleColor ( r, g, b ) If you want to make it work this dxGUI library has to be inside your script.
  4. https://wiki.multitheftauto.com/wiki/En ... rldTexture And you have to write simple shader to do this.
  5. He is asking for dxGUI, or may I wrong?
  6. You can do a test with getTickCount ( ) - firstly check element data, secondly trigger and check what method was done with less seconds.
  7. Well, you used my code only.
  8. local r,g,b = 255, 0, 0; outputChatBox ( string.format("#%, 2X%, 2X%, 2X", r, g , b) .. "Red string", 255, 255, 255, true );
  9. No problemo, thanks (even if it's not true).
  10. modshopls1 = createMarker(1041.5,-1021.5,31,"cylinder",3.5,250,0,0,100,getRootElement ()) addEventHandler ( "onClientMarkerHit", modshopls1, function ( hitElement, matchingDimension ) if ( getElementType ( hitElement ) == "player" and matchingDimension ) then if ( isPedInVehicle ( hitElement ) ) then Panel ( ) end end end ) Blipmodshopls1 = createBlipAttachedTo(modshopls1, 27) setBlipVisibleDistance (Blipmodshopls1, 300) function Panel() showCursor ( true ) modshop = guiCreateWindow(1230, 285, 323, 433, "modshop", false) guiWindowSetSizable(modshop, false) Nitrox2 = guiCreateButton(20, 38, 134, 43, "Nitrox2", false, modshop) Nitrox5 = guiCreateButton(20, 100, 134, 43, "Nitrox5", false, modshop) Nitrox10 = guiCreateButton(20, 163, 134, 43, "Nitrox10", false, modshop) Exit = guiCreateButton(66, 375, 193, 48, "Exit", false, modshop) addEventHandler ( "onClientGUIClick", Exit, Close, false ) addEventHandler ( "onClientGUIClick", Nitrox2, Nitroxx2, false ) addEventHandler ( "onClientGUIClick", Nitrox5, Nitroxx5, false ) addEventHandler ( "onClientGUIClick", Nitrox10, Nitroxx10, false ) end function Close() if ( isElement ( modshop ) ) then destroyElement ( odshop ) end showCursor ( false ) end function Nitroxx2() triggerServerEvent ( "onNitroxxx2", getLocalPlayer() ) end function Nitroxx5() triggerServerEvent ( "onNitroxxx5", getLocalPlayer() ) end function Nitroxx10() triggerServerEvent ( "onNitroxxx10", getLocalPlayer() ) end
  11. Oh, thanks lol. I'll try it.. (Glad to see clever boys around here lol.) Dimos7 often doesn't understand what topic's maker wants to do.
  12. Well, If you can random from 1st id's, do it. You'll get row id, which is good. Then, use guiGridListSetSelectedItem
  13. if ( isUserSmart ( "TheSmart" ) ) then type = "Smart"; else type = "Stupid"; end print ( "The" .. type );
  14. https://wiki.multitheftauto.com/wiki/Resource:DxGUI
  15. Oops. Fixed. function split ( n, max, mags ) if ( type ( n ) ~= "number" ) then return false; end local numbers = { }; local last = n; for i=1, mags do if ( last > 0 ) then local y = last / max; if ( y > 1 ) then table.insert ( numbers, max ); last = last - max; else local z = n % max; table.insert ( numbers, z ); last = last - z; end else table.insert ( numbers, 0 ); end end return numbers; end for _, v in pairs ( split ( 100, 30, 5 ) ) do print ( v ); end
  16. local max = 30; local mags = 5; function split ( n ) if ( type ( n ) ~= "number" ) then return false; end local numbers = { }; local last = n; for i=1, mags do if ( last > 0 ) then local y = last / max; if ( y > 1 ) then table.insert ( numbers, max ); last = last - max; else local z = n % max; table.insert ( numbers, z ); last = last - z; end if ( last == 0 ) then table.insert ( numbers, 0 ); end end end return numbers; end for _, v in pairs ( split ( 100 ) ) do print ( v ); end Output: 30 30 30 10 0
  17. Done function for you. (i'm not good in math but it works) local max = 30; function split ( n ) if ( type ( n ) ~= "number" ) then return false; end local x = ( n / max ) + 1; local x = math.floor ( x + 0.5 ); local numbers = { }; local last = n; for i=1, x do local y = last / max; if ( y > 1 ) then table.insert ( numbers, max ); last = last - max; else local z = n % max; if ( z > 0 ) then table.insert ( numbers, z ); end end end return numbers; end for _, v in pairs ( split ( 100 ) ) do print ( v ); end It outputs 30 30 30 10
  18. WhoAmI

    wanted

    replace getTeamName(thePlayer) with getTeamName(getPlayerTeam(thePlayer))
  19. function createTeam1 ( thePlayer, commandName, teamName ) local money = getPlayerMoney (thePlayer) local newTeam = createTeam ( teamName ) if money >= 888888 and newTeam then takePlayerMoney (thePlayer, 888888) setPlayerTeam ( thePlayer, newTeam ) else outputChatBox("Bạn không đủ tiền để tạo nhóm",thePlayer,255,0,0) end end addCommandHandler("createteam", createTeam1)
  20. function createTeam1 ( source, commandName, teamName, thePlayer ) local money = getPlayerMoney (thePlayer) local newTeam = createTeam ( teamName ) if money >= 888888 and newTeam then takePlayerMoney (thePlayer, 888888) setPlayerTeam ( source, newTeam ) else outputChatBox("Bạn không đủ tiền để tạo nhóm",thePlayer,255,0,0) end end addCommandHandler("createteam", createTeam1)
  21. WhoAmI

    Server Limitation

    Hard disk you can limit by FTP I believe.
  22. You mean automatically? If so, I don't really know.
  23. Doesn't matter, you see that when you type "\n" it is doing break. It's about ~2px.
×
×
  • Create New...