Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 20/11/17 in all areas

  1. From the argument, we know he use bindKey on client side. If he pass such arguments on server side, warning will be caused.
    2 points
  2. You should be used function getKeyState on Client side Are you used the script on server side?
    2 points
  3. setAccountData وضع داتا علي الحساب حق اللاعب مثال يوضح كيف تحط اكاونت داتا علي فلوس اللاعب يحفظها وتجلبها عن طريق getAccountData addEventHandler("onPlayerQuit",root, -- حدث خروج اللاعب function() -- وظيفة local acc = getPlayerAccount( source )-- جلب اكاونت اللاعب if isGuestAccount(acc) then return end -- اذا اللاعب زائر ما يحفظ امواله local mon = getPlayerMoney( source ) -- يجلب فلوس اللاعب الي لما طلع كانت معه setAccountData(acc, "Save;Money",mon) -- يحط داتا علي اكاونت اللاعب وفلوسه end) addEventHandler("onPlayerLogin",root, -- عند تسجيل اللاعب function( _, acc ) -- وظيفة ولوب if ( acc ) then -- يتحقق من اكاونت اللاعب local getSavedMoney = getAccountData ( acc, "Save;Money" ) -- يجيب الداتا حقت الحساب حقه if ( getSavedMoney ) then -- يتحقق منها setPlayerMoney ( source, getSavedMoney ) -- يحطله الفلوس الي كانت معه لما طلع end end end) واضن اني عطيتك امثلة بالخاص قبل لل setElementData getElementData
    2 points
  4. Presented By (Previously J Series) With more than 3 years of work I decided to publicly release my map conversions, I had dropped my previous listings due to some "Issues" however, they're back. ---------------------------------------------------------------------------------------------- Download Streaming Quality - 8/10 Get's the job done, awesome all around, but some places are better than others ---------------------------------------------------------------------------------------------- Download Streaming Quality 7/10 Beats VC in other places, very poor in others; as well as a huge FPS drop in the first island (Issues are rockstars fault) ---------------------------------------------------------------------------------------------- Download Streaming Quality 9/10 Beats both VC and LC ---------------------------------------------------------------------------------------------- Vehicle testing gridmap Download Streaming Quality 10/10 Perfecto ---------------------------------------------------------------------------------------------- Download Streaming Quality 7/10 Decent all around Might be a tad laggy due to the high poly and Russian nature of this map Extremely detailed for a user created map ------------------------------------------------- Download (Coming soon) streaming quality 10/10 Very light weight ------------------------------------------------- MTA-Stream MTA-Stream a new lightweight streamer promising near instant load times and better streaming Post any bugs here Or here Questions or discussions can be either posted in this topic or here --- If you would like to support my work, please donate encourages me to make good updates. https://www.paypal.me/BlueJayL
    1 point
  5. I'm trying to make a really simple settings panel, check boxes are easy, but I have a problem setting the clients weather when they click the button, it shows the number in chat but won't set the weather, even if I use tonumber.... The idea is you type a number in edit box, click the button, it sets the weather. local screenW, screenH = guiGetScreenSize() function GUI() if ( window ) then if ( guiGetVisible( window )) then showCursor( false ) toggleAllControls(true) guiSetVisible( window, false ) else guiSetInputEnabled(false) showCursor(true) toggleAllControls(false) guiSetVisible( window, true ) end else window = guiCreateWindow((screenW - 275) / 2, (screenH - 203) / 2, 275, 203, "Settings", false) guiWindowSetMovable(window, false) guiWindowSetSizable(window, false) guiSetInputEnabled(false) showCursor(true) toggleAllControls(false) blur = guiCreateCheckBox(10, 99, 59, 21, "Blur", false, false, window) clouds = guiCreateCheckBox(69, 99, 59, 21, "Clouds", false, false, window) weather_lbl = guiCreateLabel(138, 102, 60, 15, "Weather: ", false, window) weather_edit = guiCreateEdit(190, 105, 44, 15, "", false, window) --edit box weather_button = guiCreateButton(242, 103, 23, 20, ">>", false, window) --button addEventHandler("onClientGUIClick",weather_button,setWeather) end end bindKey("F6", "down", GUI) function setWeather(button,state) --Function to change weather if(button == "left" and state == "up") then if (source == weather_button) then weather = guiGetText(weather_edit) --Getting the text setWeather(tonumber(weather)) --Doesn't set outputChatBox(""..weather) --Outputs the text so I can check --Checking weather that's set, returns same value every time local weatherID = getWeather() outputChatBox ( "The current weather ID is " .. weatherID ) end end end Thanks for any help can't see where I went wrong.
    1 point
  6. I didn't even notice that... Thanks bud
    1 point
  7. addEventHandler("onClientGUIClick",weather_button,setCustomWeather) function setCustomWeather(button,state) --Function to change weather You can't use the same name for the function `setWeather`, because it will actually overwrite it. Which means that if you call setWeather on line 42, it will re-call the function setWeather of line 38 (and not the mta function).
    1 point
  8. I forgot to add local valoda = " " Thank you! ^.^ Works great
    1 point
  9. What does the debug console say? Try defining variable valoda before the loop (e.g. local valoda = "") Make sure that dxDraw doesn't clip the text. EDIT: local valoda = "" for i = 1, 3 do local lang = getElementData(localPlayer, "languages.lang" .. i) if lang and lang ~= 0 then local skill = getElementData(localPlayer, "languages.lang" .. i .. "skill") local langname = exports['language-system']:getLanguageName(lang) if langname then valoda = valoda .. "\n - "..langname.."("..skill.."%)" end end end -- and dxDrawText("Valodas: "..valoda, screenW * 0.2161, screenH * 0.4981, screenW * 0.4130, screenH * 0.5574, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, true, false, false, false)
    1 point
  10. valoda = valoda .. "\n - "..langname.."("..skill.."%)" You're overwriting the valoda variable each time it loops, so you need to include the previous content of the variable to show all the languages.
    1 point
  11. addEventHandler ( 'onClientGUIDoubleClick', root, function ( ) if ( source == GridName ) then -- اسم القريد ليست , غير الاسم local sel = guiGridListGetSelectedItem(GridName) -- غيره هنا ايضا if sel == 0 then -- اذا اللاعب ضغط على الرو الاول -- اكوادك elseif sel == 1 then -- اذا ضغط على الرو الثاني -- اكوادك elseif sel == 3 then -- اذا ضغط على الرو الثالث -- اكوادك elseif sel == 4 then -- اذا ضغط على الرو الرابع -- اكوادك end end end)
    1 point
  12. Use the camera object. https://wiki.multitheftauto.com/wiki/GetCamera local camera = getCamera() bindKey( "w", "down", function () if getKeyState( "lshift" ) == true then -- position is already included in the matrix local x,y,z = getPositionFromElementOffset(camera, 0, 3, 0) setElementPosition(localPlayer, x, y, z) end end )
    1 point
  13. That's like trying to ride a bike without wheels. Not gonna work
    1 point
  14. You can use this to get position in front etc. https://wiki.multitheftauto.com/wiki/GetElementMatrix function getPositionFromElementOffset(element,offX,offY,offZ) local m = getElementMatrix ( element ) -- Get the matrix local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] -- Apply transform local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z -- Return the transformed point end -- Get the position of a point 3 units to the right of the element: x,y,z = getPositionFromElementOffset(element,3,0,0) -- Get the position of a point 2 units in front of the element: x,y,z = getPositionFromElementOffset(element,0,2,0) -- Get the position of a point 1 unit above the element: x,y,z = getPositionFromElementOffset(element,0,0,1)
    1 point
  15. You want to move player position when they press lshift + w/a/s/d? You need to bind w/a/s/d key and check if lshift key is pressed. bindKey( "w", "down", function () if getKeyState( "lshift" ) == true then local px,py,pz=getElementPosition(localPlayer) setElementPosition(localPlayer, px+0.05, py, pz) end end ) -- and more... Also, adding X coordinate doesn't mean you can go forward (if you trying to make player go forward). You need to get player rotation and finding the +0.05 coordinate in front of player.
    1 point
  16. 1 point
  17. Im going to be uploading the updated versions of my maps to my website in a bit here and making a central link in the mapping selection
    1 point
  18. مايحتاج لها شرح الاكاونت داتا يعني الداتا المخزنه بالاكاونت يعني اي شخص يسجل دخول بحساب فيه داتا راح تنتقل له الداتا اما الثانيه الي هي إليمنت داتا هذه داتا للإليمنت فقط يعني ماتقدر تنقلها من شخص لشخص عكس الاكاونت اي شخص يسجل دخول تنقل له الداتا اتمنى انك فهمت (:
    1 point
  19. I get the feeling that you are not taking me seriously. (I am out of here,)
    1 point
  20. 1 point
  21. Download: https://community.multitheftauto.com/?p=resources&s=details&id=14987 This resource enables you to create gates at specified locations, that will open when you arrive infront of them. It's a simple resource, the reason for still releasing it and creating a topic is because it's a very commonly sought type of script, this can be a proper reference for those in need of it. If you want to quickly grab the code instead of the ready resource; local gates = { { model = 985, -- Gate object ID so you can change type of gate originalPosition = Vector3(-1698.5302734375, 1392.7216796875, 7.1786022186279), -- Example gate is located at SF Well stacked pizza & Co, near sea originalRotation = Vector3(0,0,130.67932128906), newPosition = Vector3(-1704.1123046875, 1398.6796875, 7.1786022186279), -- Edit depending on the opening width you want to cover with the gate, this defines how far it will move to the side (creating the gate's opening effect) open = false, movingInterval = 3000, --Move time in milliseconds colInfo = {createColSphere,{-1698.5302734375, 1392.7216796875, 7.1786022186279,7.5}}, }, -- If you need to add more gates, you can simply copy the above chunk and duplicate it within the 'local gates' table. } local colshapes = {} local function toggleGate(element) if element.type ~= "player" then return end if element.dimension ~= source.dimension then return end if element.interior ~= source.interior then return end local gate = gates[colshapes[source]] gate.open = eventName=="onColShapeHit" if gate.open then gate.object:move(gate.movingInterval,gate.newPosition,0,0,0) else gate.object:move(gate.movingInterval,gate.originalPosition,0,0,0) end end local function initScript() for gateIndex,gate in ipairs(gates) do gate.object = Object(gate.model,gate.originalPosition,gate.originalRotation) local func,args = unpack(gate.colInfo) gate.colshape = func(unpack(args)) colshapes[gate.colshape] = gateIndex addEventHandler("onColShapeHit",gate.colshape,toggleGate) addEventHandler("onColShapeLeave",gate.colshape,toggleGate) end end addEventHandler("onResourceStart",resourceRoot,initScript)
    1 point
  22. هلا والله ذا التطبيق الثاني يلي برمجته ولكن مع @shwaeki الصور حظا موفقا للجميع مع هذه اللغه أي أسئله انا جاهز جود لك
    1 point
  23. وعليكم السلام .. غريبة ردي ماظهر , علعموم عندك مشكلة في الشرح المفروض تجيب كائن الحساب وليس سلسلة نصية واستعمل getAccount حتى تجلب الحساب من الأسم
    1 point
  24. السلام عليكم ورحمة الله تعالى وبركاته, شرح مفصل عن كيف تسوي سكربت وكيف تحط ميتا له وكيف تبرمجه وتصمم لوحة وتخليها تفتح بواسطة زر أول شرح في دخول البرمجة, أتمنى يكون الشرح مفيد لكل الأشخاص اللي يبون يكونون مبرمجين لآتنسى دعمي بالضغط على زر لايك للفيديو والإشتراك بالقناة لو كنت حاب انزل مودات وشروحات واشياء اكثر, الشرح : في أمان الله, اخوكم مستر جراند
    1 point
  25. دائما تنور مواضيعي ، متواصل بدعمك :*
    1 point
  26. كفوك , حياك الله ..
    1 point
  27. local Key = "F1" GUIEditor = { edit = {}, button = {}, window = {}, label = {}, gridlist = {} } GUIEditor.window[1] = guiCreateWindow(190, 166, 405, 305, "Admin x2", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.gridlist[1] = guiCreateGridList(10, 62, 134, 233, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Players:", 0.9) GUIEditor.edit[1] = guiCreateEdit(18, 38, 116, 19, "", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(55, 23, 99, 15, "Search ", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "default-bold-small") GUIEditor.button[1] = guiCreateButton(172, 62, 184, 35, "Mute", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") GUIEditor.edit[2] = guiCreateEdit(154, 118, 227, 30, "", false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(47, -14, 170, 15, "What is Resson", false, GUIEditor.edit[2]) GUIEditor.label[3] = guiCreateLabel(210, 97, 120, 15, "What is The Resson :", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[3], "default-bold-small") GUIEditor.button[2] = guiCreateButton(164, 155, 94, 20, "Slap", false, GUIEditor.window[1]) GUIEditor.button[3] = guiCreateButton(277, 155, 94, 20, "Kick", false, GUIEditor.window[1]) GUIEditor.button[4] = guiCreateButton(163, 193, 208, 29, "Fly Car", false, GUIEditor.window[1]) GUIEditor.button[5] = guiCreateButton(163, 232, 94, 20, "FIX", false, GUIEditor.window[1]) GUIEditor.button[6] = guiCreateButton(277, 232, 94, 20, "Nitro", false, GUIEditor.window[1]) GUIEditor.label[4] = guiCreateLabel(163, 170, 212, 15, "______________________________", false, GUIEditor.window[1]) GUIEditor.label[5] = guiCreateLabel(297, 283, 148, 18, "Creat by FAHD v2", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[5], 254, 0, 0) guiSetVisible ( GUIEditor.window[1], false ) bindKey ( Key, "down", function ( ) if guiGetVisible ( GUIEditor.window[1] ) then guiSetVisible ( GUIEditor.window[1], false ) showCursor ( false ) else guiSetVisible ( GUIEditor.window[1], true ) showCursor ( true ) end end ) function Players ( ) guiGridListClear ( GUIEditor.gridlist[1] ) for id, players in ipairs(getElementsByType("player")) do local Row = guiGridListAddRow ( GUIEditor.gridlist[1] ) guiGridListSetItemText ( GUIEditor.gridlist[1], Row ,1, getPlayerName ( players ), false, false ) end end addEventHandler ( 'onClientResourceStart' , resourceRoot , Players ) addEventHandler( "onClientPlayerJoin", root, Players ) addEventHandler( "onClientPlayerQuit", root, Players ) addEventHandler( "onClientPlayerChangeNick", root, Players )
    1 point
  28. صراحة لا تزعل مني يا اخوي لكن ما اشوف ليه فايده الشرح اسف انا اعبر عن رايي وانت مو ملزم تسمعه
    1 point
  29. ** IMPORTANT ** ------------------- MTA currently does not support IPv6. If your host is IPv6 enabled you need to set your IPv4 address in your mtaserver.conf between the tags. While MTA does not support IPv6, our web services do support this new addressing system. Therefore your server will attempt to register itself with our service by it's IPv6 address and confuse our master server.
    1 point
×
×
  • Create New...