Jump to content

Jaysds1

Members
  • Posts

    4,961
  • Joined

  • Last visited

Everything posted by Jaysds1

  1. Try this: local isPlayerViewingPanel = false local sw,sh = guiGetScreenSize() addEventHandler ( "onClientRender", root, function( ) if isPlayerViewingPanel then dxDrawImage ( 400, 120, 560, 480, "Ventana.png" ) dxDrawImage ( 746.50, 144, 43.50, 43.50, "close.png" ) end end ) bindKey("f9", "down",function() if isPlayerViewingPanel then isPlayerViewingPanel = false showCursor (false) else isPlayerViewingPanel = true showCursor (true) end end) addEventHandler("onClientClick",root,function(_,_,x,y) if not isPlayerViewingPanel then return end --Checks if the panel's opening and if it is then stop the function --Checks if the cursor is over the mouse from x to the width and y to the height if ( x >= 746.50 and x <= 746.50 + 43.50) and ( y >= 144 and y <= 144 + 43.50 ) then isPlayerViewingPanel = false end end)
  2. This sounds good, Good Luck and sorry I have no other ideas for you.
  3. Sorry, I meant OnClientClick Example: addEventHandler("onClientClick",root,function(_,_,x,y) if not isPlayerViewingPanel then return end --Checks if the panel's opening and if it is then stop the function --Checks if the cursor is over the mouse from x to the width and y to the height if ( x >= 746.50 and x <= 746.50 + 43.50) and ( y >= 144 and y <= 144 + 43.50 ) then isPlayerViewingPanel = false end end)
  4. He said that he played around with some settings on his router... That's his exact words to me.
  5. Well, it could be the server as the server is the one that banned you and holds the info on your ban info and if you were unbanned then the server is suppose to release/remove the info.
  6. Jaysds1

    help

    Look at what he said:
  7. Try this: local objects = { --TeddyBear createObject ( 14602, 622.2998, -255.59961, 1085.40002 ), createObject ( 2164, 599.5, -270.70001, 1080.19995, 0, 0, 90 ), createObject ( 2164, 599.5, -268.89999, 1080.19995, 0, 0, 90 ), createObject ( 2164, 599.5, -267.10001, 1080.19995, 0, 0, 90 ), createObject ( 2164, 599.5, -265.29999, 1080.19995, 0, 0, 90 ), createObject ( 2202, 599.70001, -261.29999, 1080.09998, 0, 0, 89.979 ), createObject ( 2202, 599.70001, -263.5, 1080.09998, 0, 0, 89.979 ), createObject ( 1671, 604.90002, -255.5, 1080.5, 0, 0, 85.289 ), createObject ( 1671, 601.5, -260.29999, 1080.5, 0, 0, 88.549 ), createObject ( 1671, 601.5, -263.89999, 1080.5, 0, 0, 88.544 ), createObject ( 1671, 601.5, -267.29999, 1080.5, 0, 0, 88.544 ), createObject ( 1671, 601.5, -270.29999, 1080.5, 0, 0, 88.544 ), createObject ( 1671, 601.5, -251.10001, 1080.5, 0, 0, 88.544 ), createObject ( 1671, 601.5, -247, 1080.5, 0, 0, 88.544 ), createObject ( 1671, 601.5, -243.60001, 1080.5, 0, 0, 88.544 ), createObject ( 1671, 601.5, -240.7, 1080.5, 0, 0, 88.544 ), createObject ( 2190, 606.5, -254.8, 1080.80005, 0, 359.011, 303.395 ), createObject ( 2190, 603.20001, -250.7, 1081, 0, 359.006, 303.393 ), createObject ( 2190, 603.20001, -246.39999, 1081, 0, 359.006, 303.393 ), createObject ( 2190, 603.20001, -243.3, 1081, 0, 359.006, 303.393 ), createObject ( 2190, 602.79999, -241.7, 1081, 0, 359.006, 204.849 ), createObject ( 2190, 602.90002, -261.39999, 1081, 0, 359.006, 205.25 ), createObject ( 2190, 602.90002, -264.79999, 1081, 0, 359.006, 205.247 ), createObject ( 2190, 602.90002, -268, 1081, 0, 359.006, 205.247 ), createObject ( 2190, 603.20001, -269.60001, 1081, 0, 359.006, 297.27 ), createObject ( 2164, 599.5, -241.3, 1080.19995, 0, 0, 90 ), createObject ( 2164, 599.5, -243.10001, 1080.19995, 0, 0, 90 ), createObject ( 2164, 599.5, -244.89999, 1080.19995, 0, 0, 90 ), createObject ( 2202, 599.70001, -251.2, 1080.09998, 0, 0, 85.297 ), createObject ( 2202, 599.79999, -249.10001, 1080.09998, 0, 0, 86.476 ), createObject ( 2164, 599.5, -246.7, 1080.19995, 0, 0, 90 ), createObject ( 2007, 599.70001, -257.29999, 1080, 0, 0, 90.952 ), createObject ( 2007, 599.70001, -256.29999, 1080, 0, 0, 90.284 ), createObject ( 2007, 599.70001, -255.3, 1080, 0, 0, 89.316 ), createObject ( 2007, 599.70001, -254.3, 1080, 0, 0, 89.313 ), createObject ( 2007, 599.70001, -253.3, 1080, 0, 0, 89.313 ), createObject ( 1491, 616.90002, -262.70001, 1080.09998 ), createObject ( 10184, 625.29999, -263.10001, 1082.59998, 0, 0, 88.99 ), createObject ( 1705, 622.29999, -240.39999, 1080, 0, 0, 296.718 ), createObject ( 1705, 622.70001, -248.39999, 1080, 0, 0, 239.952 ), createObject ( 1705, 622.79999, -245.60001, 1080, 0, 0, 267.633 ), createObject ( 1705, 622.79999, -244.39999, 1080, 0, 0, 267.632 ), createObject ( 1705, 622.79999, -243.2, 1080, 0, 0, 267.632 ), createObject ( 1705, 622.79999, -242, 1080, 0, 0, 267.632 ), createObject ( 1705, 622.79999, -246.8, 1080, 0, 0, 267.632 ), createObject ( 1705, 615, -240.89999, 1080, 0, 0, 24.714 ), createObject ( 1705, 616.40002, -240.39999, 1080, 0, 0, 1.972 ), createObject ( 1705, 617.59998, -240.39999, 1080, 0, 0, 1.967 ), createObject ( 1705, 618.79999, -240.39999, 1080, 0, 0, 1.967 ), createObject ( 1705, 620, -240.39999, 1080, 0, 0, 1.967 ), createObject ( 14597, 612, -226.2998, 1082, 0, 359.926, 270.441 ), createObject ( 3093, 613.09998, -239.8, 1081.09998, 0, 0, 269.539 ), createObject ( 3093, 613.09998, -239.8, 1081.40002, 0, 0, 269.539 ), createObject ( 3093, 610.09998, -239.8, 1081.40002, 0, 0, 269.539 ), createObject ( 3093, 611.20001, -239.60001, 1084.09998, 0, 0, 269.539 ), createObject ( 3093, 611.90002, -239.60001, 1084.09998, 0, 0, 269.539 ), createObject ( 1997, 624.20001, -251.8, 1080, 0, 0, 270.756 ), createObject ( 1997, 627.20001, -251.8, 1080, 0, 0, 270.753 ), createObject ( 1997, 630.09998, -251.8, 1080, 0, 0, 270.753 ), createObject ( 1997, 633.70001, -251.8, 1080, 0, 0, 270.753 ), createObject ( 1997, 633.70001, -259.29999, 1080, 0, 0, 270.753 ), createObject ( 1997, 630.20001, -259.29999, 1080, 0, 0, 270.753 ), createObject ( 1997, 627.40002, -259.20001, 1080, 0, 0, 270.753 ), createObject ( 1997, 624.59998, -259.29999, 1080, 0, 0, 270.753 ), createObject ( 1997, 621.79999, -262, 1080, 0, 0, 270.753 ), createObject ( 1997, 616.09998, -262, 1080, 0, 0, 270.753 ), createObject ( 1997, 608.59998, -240.39999, 1080, 0, 1.978, 88.76 ), createObject ( 1997, 605.09998, -240.39999, 1080, 0, 1.972, 88.759 ), createObject ( 1997, 614.20001, -263.89999, 1080, 0, 1.972, 181.81 ), createObject ( 1997, 614.20001, -266.79999, 1080, 0, 1.967, 181.807 ), createObject ( 1997, 609.70001, -270.79999, 1080, 0, 1.967, 89.098 ), createObject ( 1491, 608.70001, -235.39999, 1080, 0, 0, 90.059 ), createObject ( 1491, 608.70001, -226.10001, 1080, 0, 0, 89.49 ), createObject ( 1491, 615.40002, -235.39999, 1080, 0, 0, 90.055 ), createObject ( 1491, 615.29999, -226, 1080, 0, 0, 90.055 ), createObject ( 1998, 672.40002, -182.10001, 1026 ), createObject ( 1998, 617.09998, -237, 1080, 0, 0, 90.38 ), createObject ( 1998, 615.90002, -223.8, 1080, 0, 0, 0.302 ), createObject ( 1998, 607, -222.89999, 1080, 0, 0, 269.963 ), createObject ( 1998, 608.09998, -236, 1080, 0, 0, 181.128 ), createObject ( 2197, 617, -233, 1080, 0, 0, 89.538 ), createObject ( 2197, 617, -232.3, 1080, 0, 0, 89.533 ), createObject ( 2197, 617, -231.60001, 1080, 0, 0, 89.533 ), createObject ( 2197, 617, -230.89999, 1080, 0, 0, 89.533 ), createObject ( 2197, 617, -229, 1080, 0, 0, 89.533 ), createObject ( 2197, 617, -228.3, 1080, 0, 0, 89.533 ), createObject ( 2197, 617, -227.60001, 1080, 0, 0, 89.533 ), createObject ( 2197, 617, -226.89999, 1080, 0, 0, 89.533 ), createObject ( 2197, 607.29999, -229.10001, 1080, 0, 0, 270.035 ), createObject ( 2197, 607.29999, -228.39999, 1080, 0, 0, 270.033 ), createObject ( 2197, 607.29999, -227.7, 1080, 0, 0, 270.033 ), createObject ( 2197, 607.29999, -227, 1080, 0, 0, 270.033 ), createObject ( 2197, 607.29999, -231, 1080, 0, 0, 270.033 ), createObject ( 2197, 607.29999, -231.7, 1080, 0, 0, 270.033 ), createObject ( 2197, 607.29999, -232.39999, 1080, 0, 0, 270.033 ), createObject ( 2197, 607.29999, -233.10001, 1080, 0, 0, 270.033 ), createObject ( 3383, 624.79999, -233.89999, 1080, 0, 0, 90.223 ), createObject ( 3383, 624.79999, -225.60001, 1080, 0, 0, 90.22 ), createObject ( 3383, 599.40002, -233.89999, 1080, 0, 0, 270.645 ), createObject ( 3383, 599.29999, -226, 1080, 0, 0, 270.643 ), createObject ( 1806, 616.90002, -236.2, 1080, 0, 0, 91.515 ), createObject ( 1806, 616.70001, -223.7, 1080, 0, 0, 359.995 ), createObject ( 1806, 607.09998, -223.8, 1080, 0, 0, 268.83 ), createObject ( 1806, 607.20001, -236.3, 1080, 0, 1.978, 181.564 ), createObject ( 2010, 615.09998, -248.5, 1080.09998 ), createObject ( 2010, 614.70001, -239.10001, 1080.09998 ), createObject ( 2010, 619, -249.3, 1080.09998 ), createObject ( 2010, 615.09998, -244.7, 1080.09998 ), createObject ( 2010, 609.70001, -239.10001, 1080.09998 ), createObject ( 14604, 620, -230.5, 1081, 0, 0, 179.917 ), createObject ( 14604, 604.40002, -230.5, 1081, 0, 0, 179.912 ), createObject ( 14604, 620, -229.3, 1081, 0, 0, 0.549 ), createObject ( 14604, 604.5, -229.3, 1081, 0, 0, 0.544 ), createObject ( 2315, 618.40002, -244, 1080, 0, 0, 269.62 ), createObject ( 2813, 618.40002, -245.7, 1080.5 ), createObject ( 2813, 618.40002, -243.89999, 1080.5 ), createObject ( 1752, 618.20001, -244.7, 1080.5, 0, 0.989, 89.244 ), createObject ( 1491, 612.79999, -222, 1080, 0, 0, 179.451 ), createObject ( 2167, 609.70001, -213.2, 1080 ), createObject ( 2167, 610.59998, -213.2, 1080 ), createObject ( 2167, 611.5, -213.2, 1080 ), createObject ( 2167, 612.40002, -213.2, 1080 ), createObject ( 2167, 613.29999, -213.2, 1080 ), createObject ( 2167, 614.20001, -213.2, 1080 ), createObject ( 1768, 609.59998, -221.2, 1080, 0, 0, 90.233 ), createObject ( 1768, 614.29999, -219.2, 1080, 0, 0, 270.108 ), createObject ( 1433, 609.59998, -218.2, 1080.19995 ), createObject ( 1433, 614.20001, -218.2, 1080.19995 ), createObject ( 2195, 609.59998, -218.2, 1081.30005 ), createObject ( 2195, 614.29999, -218.2, 1081.30005 ), createObject ( 2817, 609.70001, -214.89999, 1080 ), createObject ( 2817, 612.40002, -220.3, 1080, 0, 0, 90.335 ), createObject ( 2817, 613.09998, -214.89999, 1080 ) } -- Put them standby for now. for _, object in ipairs( objects ) do setElementDimension( object, 65535 ) end local col = createColSphere(635.24976,-255.57161,1081.03284,50) local function watchChanges( ) local lpDim = getElementDimension( getLocalPlayer( ) ) local oDim = getElementDimension( objects[1] ) if lpDim > 0 and lpDim ~= oDim and getElementInterior( getLocalPlayer( ) ) == getElementInterior( objects[1] ) then for _, object in ipairs( objects ) do setElementDimension( object, lpDim ) end elseif lpDim == 0 and oDim ~= 65535 then for _, object in ipairs( objects ) do setElementDimension( object, 65535 ) end end end addEventHandler( "onClientColShapeHit", col,function( element ) if element == getLocalPlayer( ) then addEventHandler( "onClientRender", root, watchChanges ) end end) addEventHandler( "onClientColShapeLeave", col,function( element ) if element == getLocalPlayer( ) then removeEventHandler( "onClientRender", root, watchChanges ) end end)
  8. 1. You're missing an end before "showCursor" 2. In order to detect if the cursor is over the button/close.png then you would need to use either of these events: OnClientMouseMove or OnClientCursorMove
  9. local levels = { [200] = "1", [500] = "2", [600] = "3", [1000] = "4", [2000] = "5", [3000] = "6", [4000] = "7", [5000] = "8", [9000] = "9" } addEventHandler( "onPlayerWasted",root, function(_, killer) if (killer and killer ~= source) then local Rep = tonumber(getElementData(killer, "Reputation")) or 0 local kName = getPlayerName(killer) local sName = getPlayerName(source) setElementData(killer, "Reputation", Rep + math.random ( 20, 50 ) ) if levels[Rep] then setElementData(killer, "Rank", "Rank/Lvl".. levels[Rep] ..".png") --Rank/Lvl1.png triggerClientEvent ( killer, "playSound", killer ) end end local Rep = tonumber(getElementData ( source, "Reputation" )) or 0 setElementData ( source, "Reputation", Rep - math.random ( 20, 50 ) ) end) addEventHandler ("onPlayerLogin", root, function (_,curAcc) setElementData(source, "Rank", getAccountData(curAcc, "Rank") or "0") setElementData(source, "Reputation", getAccountData(curAcc, "Rep") or 0) end) function saveData(source, acc) if not acc or isGuestAccount(acc)then return end setAccountData (acc, "Rnk", getElementData(source, "Rank")) setAccountData (acc, "Rep", getElementData(source, "Reputation")) end addEventHandler ("onPlayerQuit", root, function () saveData(source, getPlayerAccount(source)) end) addEventHandler ("onPlayerLogout", root, function (acc) saveData(source, acc) end)
  10. Lol, I forgot about that. Ya MTA took it to the future for traveling
  11. try this: local levels = { [200] = "1", [500] = "2", [600] = "3", [1000] = "4", [2000] = "5", [3000] = "6", [4000] = "7", [5000] = "8", [9000] = "9" } addEventHandler( "onPlayerWasted",root, function(_, killer) if (killer and killer ~= source) then local Rep = tonumber(getElementData(killer, "Reputation")) or 0 local Rank = getElementData(killer, "Rank") local kName = getPlayerName(killer) local sName = getPlayerName(source) setElementData(killer, "Reputation", Rep + math.random ( 20, 50 ) ) if levels[Rep] then setElementData(killer, "Rank", "Rank ".. levels[Rep] .." ! ") triggerClientEvent ( killer, "playSound", killer ) end end local Rep = tonumber(getElementData ( source, "Reputation" )) or 0 setElementData ( source, "Reputation", Rep - math.random ( 20, 50 ) ) end) addEventHandler ("onPlayerLogin", root, function (_,curAcc) setElementData(source, "Rank", getAccountData(curAcc, "Rank") or "0") setElementData(source, "Reputation", getAccountData(curAcc, "Rep") or 0) end) function saveData(source, acc) if not acc or isGuestAccount(acc)then return end setAccountData (acc, "Rnk", getElementData(source, "Rank")) setAccountData (acc, "Rep", getElementData(source, "Reputation")) end addEventHandler ("onPlayerQuit", root, function () saveData(source, getPlayerAccount(source)) end) addEventHandler ("onPlayerLogout", root, function (acc) saveData(source, acc) end)
  12. Sorry, I don't get what your saying, can you put more details on what's happening pls.
  13. Jaysds1

    Help please :(

    Wrong forum BTW Anyways, Can you download and run this MTADiag, then post the generated MTA:Pastebin url here please.
  14. He has fixed the issue, Topic can be closed now!
  15. Ya, where as if you set the object as the player's child then it would still sync but not as bad as using element data.
  16. There's 2 ways, 1 is a timer and the other is a render. If you create a render all you have to do is check if the object is in the same dimension as the player and if it's not then set it's dimension to the player's. Example 1: Server-sided setTimer(function() for _,player in ipairs(getElementsByType("player"))do for _,child in ipairs(getElementChildren(player))do if getElementType(child) == "object" then local playerDim = getElementDimension(player) if getElementDimension(child) ~= playerDim then setElementDimension(child,playerDim) end end end end end,3000,0) Example 2: Client-side addEventHandler("onClientPreRender",root,function() for _,player in ipairs(getElementsByType("player"))do for _,child in ipairs(getElementChildren(player))do if getElementType(child) == "object" then local playerDim = getElementDimension(player) if getElementDimension(child) ~= playerDim then setElementDimension(child,playerDim) end end end end end)
  17. I'm not sure because I don't really create fonts or import fonts to my MTA, but any font size should be use-able.
  18. By any chance does it touch any other objects when it's moving? Because the only thing I fixed that with was setting the collision off. setElementCollisionsEnabled
  19. try this: function loginFunc () showCursor ( true ) bg = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "img/bg.png", true) window = guiCreateStaticImage(0.30, 0.32, 0.40, 0.34, "img/login_window.png", true, bg) login = guiCreateStaticImage(0.70, 0.44, 0.21, 0.13, "img/login.png", true, window) guest = guiCreateStaticImage(0.70, 0.59, 0.21, 0.13, "img/guest.png", true, window) ------------------------- -- Mouse Events --------- ------------------------- addEventHandler( "onClientMouseEnter", root,function(aX, aY) if source==login then --check if the source they went over is the login guiCreateStaticImage(70, 0.44, 0.21, 0.13, "img/login2.png", true, window) end end) end addCommandHandler (loginFunc) And please try not to put function names and variable names the same name!
  20. try this: local gx,gy,gz = 1544.69995, -1630.80005, 13.1 local objGateg = createObject(968, gx, gy, gz, 0, 269.87, 270.149) exports.pool:allocateElement(objGateg) local open = false -- Gate code function usePDFrontGarageGate(thePlayer) local x, y, z = getElementPosition(thePlayer) local distance = getDistanceBetweenPoints3D(gx, gy, gz, x, y, z) if (distance<=10) and (open==false) then if (exports.global:hasItem(thePlayer, 64)) then open = true outputChatBox("LSPD Garage is now Open!", thePlayer, 0, 255, 0) moveObject(objGateg, 3000, 1544.69922, -1630.80005, 13.1, 0, 357.87, 270.148) setTimer(closePDFrontGarageGate, 5000, 1) end end end addCommandHandler("gate", usePDFrontGarageGate) function closePDFrontGarageGate() setTimer(function() open = false end, 3000, 1) moveObject(objGateg, 3000, gx, gy, gz, 0, 269.87, 270.149) end
  21. Like this? local function outputChatMsg(msgtype,m,source) if not msgtype or type(msgtype)~="number" then return false end if msgtype == 0 then for _,v in ipairs(getElementsByType("player")) do if (getElementData(v,"room") == getElementData(source,"room")) then outputChatBox(m,v,255,255,255,true) end end elseif msgtype == 2 then local team = getPlayerTeam(source) if team then for _,v in ipairs(getElementsByType("player")) do if getPlayerTeam(v) then outputChatBox("#FF6464(Team) #ffffff"..m,v,255,255,255,true) end end end elseif msgtype == 3 then outputChatBox("#FF6464[Language] #ffffff"..m,root,255,255,255,true) end end addCommandHandler("Language",function(source,_,...) local m = table.concat({...},' '):gsub("#%x%x%x%x%x%x",""):sub(1,100) outputChatMsg(3,getPlayerName(source).."#F2F0F0: "..m,source) end) addEventHandler("onPlayerJoin",root,function() bindKey(source,"L","down","chatbox","Language") end) for _,v in ipairs(getElementsByType("player")) do bindKey(v,"L","down","chatbox","Language") end
×
×
  • Create New...