Jump to content

xXMADEXx

Members
  • Posts

    2,718
  • Joined

  • Last visited

Everything posted by xXMADEXx

  1. That's because the arguments are: function dxDrawPartialCircle(posX, posY, radius, width, startAngle, endAngle, angleAmount, color, postGUI) You're missing a ton of arguments...
  2. You should do something like this: -- server addEventHandler ( "onPlayerJoin", root, function ( ) setElementData ( source, "AccountUsername", "" ) end ) addEventHandler ( "onPlayerLogin", root, function ( _, a ) setElementData ( source, "AccountUsername", getAccountName ( a ) ) end ) -- client owner = getElementData ( localPlayer, "AccountUsername" )
  3. What do you mean as in "my color"?
  4. Remember, Lua is case sensitive. getPlayerName getAccountName
  5. You need to have a VPS for this resource to work on a hosted server.
  6. t = createTeam ( "Team Name", 255, 255, 255 ) setTimer ( outputChatBox end, 1000, 0, "Team Data: "..tostring ( t ) ) lol
  7. The /register command is part of the default admin resource. Make sure the admin resource is running.
  8. I don't really think that it would change while the script is running, but I cannot be 100% sure. If you want, you can simply test it with a timer like this: t = createTeam ( "Team Name", 255, 255, 255 ) setTimer ( outputChatBox, 1000, 0, "Team Data: "..tostring ( t ) )
  9. You can just do something like this: local data = { [1] = { posX = 0, posY = 0, posW = 0, posH = 0, hovering = false, colors = { 23,23,23,204 } }, [2] = { posX = 0, posY = 0, posW = 0, posH = 0, hovering = false, colors = { 23,23,23,204 } }, [3] = { posX = 0, posY = 0, posW = 0, posH = 0, hovering = false, colors = { 23,23,23,204 } } } addEventHandler ( "onClientCursorMove", root, function ( _, _, cx, cy ) for i, v in pairs ( data ) do local x, y, w, h = v.posX, v.posY, v.posW, v.posH; if ( cx >= x and cx <= x+w and cy >= y and cy <= y+h ) then data[i].hovering = true else data[i].hovering = false end end end )
  10. Look at these pages: https://wiki.multitheftauto.com/wiki/Server_Commands https://wiki.multitheftauto.com/wiki/Client_Commands
  11. Does debugscript output any errors?
  12. You can check how I did it in my dx login panel, using the event onClientCursorMove https://community.multitheftauto.com/index.php?p= ... ls&id=7970
  13. Check the mta community.
  14. xXMADEXx

    Login Panel

    Use the MTA GUI functions: https://wiki.multitheftauto.com/wiki/Cl ... _functions
  15. xXMADEXx

    Save button

    You have to be able to script it...
  16. xXMADEXx

    Save button

    You just make it save to an xml file on the clients computer using the MTA XML functions
  17. I highly doubt any legit host is going to do the deal... Because what if your server doesn't get any donations?
  18. You could also use: string.gsub ( TheText, "#%x%x%x%x%x%x", "" )
  19. So.. What exactly do you mean?
  20. I think it's because those are invalid columns in the MySQL table.
  21. In a command, source isn't the player that executed the command. allVehicles = {} addEvent( "requestSendVehicles", true ) addEvent( "onVehicleBuyRequest", true ) addEvent( "requestVehicleMove", true ) addEvent( "onVehicleGift", true ) addEvent( "respawnRequest", true ) function moveVehToDimNow (vehicle) if not isPedInVehicle (source) then setElementDimension (vehicle, 80) outputChatBox ("*******", source, 0, 255, 0) else outputChatBox ("*******", source, 255, 0, 0) end end addEvent( "moveTheVehicleToDim", true ) addEventHandler( "moveTheVehicleToDim", root, moveVehToDimNow) addEventHandler( "onVehicleBuyRequest", root, function ( model, price, x, y, z, rx, ry, rz, dim, int ) if not isGuestAccount( getPlayerAccount( source ) ) then if model and price and x and y and z and dim and int then local veh = createVehicle( model, x, y, z, rx, ry, rz ) setElementDimension( veh, dim ) setElementInterior( veh, int ) takePlayerMoney( source, price ) outputChatBox( "You Buy a "..getVehicleNameFromModel( model ).." !", source, 0, 255, 0 ) triggerClientEvent (source, "buyVehicleHd", source) allVehicles[veh] = getAccountName( getPlayerAccount( source ) ) end else outputChatBox( "Fatal Error.", source, 255, 0, 0 ) end end ) addCommandHandler ("novehi", function ( p ) for i, v in pairs ( allVehicles ) do setElementDimension ( v, 33 ) end outputChatBox ("All Vehicles Moved To Dimension 33", p, 255, 255, 0) end) addEventHandler( "onVehicleEnter", root, function ( player, seat ) if seat == 0 then if allVehicles[source] and allVehicles[source] ~= getAccountName( getPlayerAccount( player )) then removePedFromVehicle ( player ) outputChatBox ("This Is Not Your Vehicle", player, 255, 0, 0) triggerClientEvent (player, "failVehicleEnter", player) end end end ) (I don't recommend change the vehicle dimension, I would recommend using destroyElement and store all the data in a database)
  22. xXMADEXx

    dx panel

    You're code is really,really inefficient, because it's creating GUI elements every render. home = guiCreateButton(487, 317, 135, 33, "", false) guiSetAlpha(home, 0.00) vehicle = guiCreateButton(487, 416, 135, 33, "", false) guiSetAlpha(vehicle, 0.00) weapon = guiCreateButton(487, 383, 135, 33, "", false) guiSetAlpha(weapon, 0.00) player = guiCreateButton(487, 350, 135, 33, "", false) guiSetAlpha(player, 0.00) binds = guiCreateButton(487, 482, 135, 33, "", false) guiSetAlpha(binds, 0.00) showcursor (true) function draw() xDrawRectangle(491, 297, 497, 263, tocolor(23, 23, 23, 255), true) dxDrawRectangle(481, 279, 517, 28, tocolor(55, 55, 55, 255), true) dxDrawText("Player", 487, 350, 622, 383, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) dxDrawText("Weapon", 487, 383, 622, 416, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) dxDrawText("Vehicle", 487, 416, 622, 449, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) dxDrawText("Home", 487, 317, 622, 350, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) dxDrawText("X", 968, 279, 998, 305, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "top", false, false, true, false, false) dxDrawText("X", 481, 279, 511, 305, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "top", false, false, true, false, false) dxDrawText("Hello,", 660, 317, 887, 405, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, true, false, false) dxDrawText("Binds", 487, 482, 622, 515, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "top", false, false, true, false, false) end local drawingPanel = false; function startDrawing_CMD() if(drawingPanel == false) then addEventHandler("onClientPreRender", getRootElement(), draw); drawingPanel = true; else removeEventHandler("onClientPreRender", getRootElement(), draw); drawingPanel = false; end end addCommandHandler("Panel", startDrawing_CMD, false, false);
  23. xXMADEXx

    dx panel

    Dx function return true/fasle, not elements. You have to use the function in onClientRender/onClientPreRender/onClientHUDRender
  24. xXMADEXx

    [Question]

    It would require changing most of the script. Rather than just having one accountData with all of the vehicle data, it should be a table containing all of the players vehicles and their data.
×
×
  • Create New...