Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/12/16 in Posts

  1. @LopSided_ You are providing incomplete chunks of reply which probably makes the original poster confused if he can't follow your logic (I understood what you were trying to do but it's incorrect as there should be one (and only one) line per row (1 row = 1 tent; but each tent can have 0 or more "itens" (items I guess, might be a typo)). For an easy solution, build key-value based array where the key will be the "itens" name and the value will be the quantity of that itens you get with the getElementData. Once the array is built, use the toJSON function to convert that array into a string. local tentItensTable = { {"Assault Rifle"}, {"Motorcycle"}, } local itens = {} for i, data in ipairs(tentItensTable) do local itenName = data[1] -- the 'iten' name local itenQuantity = getElementData(thecol, itenName) or 0 -- the 'iten' quantity (0 if 'false') table.insert(itens, { name = itenName, quantity = itenQuantity }) -- adding the 'iten' datas in the list end --[[ Here 'itens' is like a table with 2 columns that should look like this (for example): { { name = "Assault Riffle", quantity = 63 }, { name = "Motorcycle", quantity = 0 } } But now as you can't save complex types (like arrays and tables) directly, you have to convert it into a simple string using the toJSON function: --]] local itensJson = toJSON(itens) --[[ saving line --]] dbExec(thedatabase, "INSERT INTO bau_obj VALUES (?,?,?,?,?,?,?,?,?)", numeros, modelo, x, y, z, rx, ry, rz, itensJson) --[[ saving line --]] And to load the itens from database do it like this: ---- Loading the itens back somewhere else ---- local itensJson = REPLACE_ME -- Do your thing to get the 'itens' column value as string from the database in that variable -- Then convert the Json string back into our table of itens like before the save using fromJSON function: local itens = fromJSON(itensJson) -- Loop to read all itens in that tent for i, data in ipairs(itens) do local itenName = data["name"] -- the 'iten' name local itenQuantity = data["quantity"] -- the 'iten' quantity (0 if nil/false) setElementData(thecol, itenName, itenQuantity) end But for a clean/not dirty solution as above, you should use another table to only save the 'itens' with an extra column like 'bau_obj_numeros' that will store the value of the bau_obj it is related to: bau_obj table: numeros | modelo | x | y | z | rx | ry | rz 1 | 123 | 0 | 0 | 0 | 0 | 0 | 0 <-- tent 1 2 | 123 | 9 | 9 | 0 | 0 | 0 | 0 <-- tent 2 bau_obj_itens table: bau_obj_numeros | name | quantity 1 | Assault Riffle | 54 <-- tent 1 1 | Motorcycle | 1 <-- tent 1 2 | Assault Riffle | 180 <-- tent 2 2 | Motorcycle | 0 <-- tent 2 Here tent 1 has: - 54 ammos of Assault Riffle - 1 Motorcycle And tent 2 has: - 180 ammos of Assault Riffle - 0 Motorcycle See one-to-many relationship. I hope it makes sense for you. It will require more modifications of your script but that's a standard thing for storing a list for a given row in a database. Remember this: If a column needs to store a list of another thing, then create another table for that other thing. Best regards, Citizen
    1 point
  2. يسلمو جميعآ علي الردود الجميلة منورين يا حلوين
    1 point
  3. خطا فقط كنت انسخها عشان ما اكتبها الكسل وما ادراك ما هو ههههههههههه
    1 point
  4. منتدى جميل و رائعع و حقق اشياء كبيرهة في ايام معدودهه و جلب الكثير من الاسامي المميزهة اهنيكم
    1 point
  5. منتدى روعه والأروع الشخص اللي مؤسسه أتمنى لكم التطوير والتقدم دوما تحياتي
    1 point
  6. نبي رايكم في منتدى مجتمع العرب www.mtaarabs.com + اقترحاتكم لكل شخص سجل او دخل المنتدى @N3xT @Mr.MtFcH @Abdul KariM @MoDeR2014 @MR.GRAND @MR.NaiF-MTA @iPrestege @MrSAUD1 @Mr.CoR @Mr.TnT @#BrosS @iMr ~ MnHmAr @iiKhaled @3NAD @MR.S3D
    1 point
  7. الله يعفيك حياك بـ اي وقت
    1 point
  8. جرب addEventHandler("onClientGUIClick",root, if source == GUIEditor.button[1] then local sel = guiGridListGetSelectedItem(grid) --جلب من القريت لست local aSoking = guiGridListGetItemText(grid,sel,1) -- احظار مكان الكلمة اذا كان في قصمين if ( sel ~= -1 ) then -- يتحقق اذا كان محدد triggerServerEvent("Remove",localPlayer,aSoking) end end ) -- سيرفر executeSQLQuery ( 'CREATE TABLE IF NOT EXISTS aSokingX2 ( aRows )' ) addEvent('Event', true ) addEventHandler('Event' , getRootElement ( ) , function ( aText ) executeSQLQuery( 'INSERT INTO aSokingX2 (aRows) VALUES ( ? )' , aText ) triggerClientEvent( getRootElement ( ) , 'addText', getRootElement ( ) , aText ) end ) addEvent('EventS', true ) addEventHandler('EventS' , getRootElement ( ) , function ( ) Value = executeSQLQuery( 'SELECT * FROM aSokingX2' ) if ( #Value ~= 0 ) then triggerClientEvent ( source , 'EventT2' , source , Value ) end end ) addEvent("Remove",true) addEventHandler("Remove",root, function ( aSoking ) executeSQLQuery("DELETE FROM aSokingX2 WHERE aRows=?",aSoking) outputChatBox("تم الازألة بنجآح",source,0,188,205,true) end )
    1 point
  9. حولت اساعدك ولكن ما زبط مشكلتي ما افهم كثير في قواعد البيانات اسف
    1 point
  10. جرب addEventHandler ( "onClientGUIClick", root, function ( ) local Selected = guiGridListGetSelectedItem( gridlist ) if button == source then if Selected ~= -1 then guiGridListRemoveRow ( gridlist, Selected ) end end end )
    1 point
  11. https://wiki.multitheftauto.com/wiki/Meta.xml <script src="example.lua" type="client" cache="false/>
    1 point
  12. Simple, solo cambia esta línea, si el archivo de sonido que tienes se llama "stop.mp3", ejemplo: local name = "stop" --Nombre del archivo que tienes Quedaría algo así addEventHandler("onClientGUIClick", reproducir1, function () local name = "SonidoA" triggerServerEvent("playSound", localPlayer, name) end ) addEventHandler("onClientGUIClick", reproducir2, function () local name = "SonidoB" triggerServerEvent("playSound", localPlayer, name) end )
    1 point
  13. Toma, no sé si es lo que tratas de hacer, pero al presionar F7 aparecerán los botones de sonidos, te recuerdo que este script los sonidos se deben llamar de la misma manera que se llaman los botones de audios, es decir "Audio1.mp3", "Audio2.mp3", etc. Cliente reproducir2 = guiCreateButton(136, 333, 234, 37, "Audio2", false) guiSetProperty(reproducir2, "NormalTextColour", "FFAAAAAA") reproducir1 = guiCreateButton(282, 235, 234, 37, "Audio1", false) guiSetProperty(reproducir1, "NormalTextColour", "FFAAAAAA") reproducir3 = guiCreateButton(199, 430, 234, 37, "Audio3", false) guiSetProperty(reproducir3, "NormalTextColour", "FFAAAAAA") reproducir4 = guiCreateButton(867, 445, 234, 37, "Audio4", false) guiSetProperty(reproducir4, "NormalTextColour", "FFAAAAAA") reproducir5 = guiCreateButton(924, 356, 234, 37, "Audio5", false) guiSetProperty(reproducir5, "NormalTextColour", "FFAAAAAA") reproducir6 = guiCreateButton(952, 260, 234, 37, "Audio6", false) guiSetProperty(reproducir6, "NormalTextColour", "FFAAAAAA") reproducir7 = guiCreateButton(788, 176, 234, 37, "Audio7", false) guiSetProperty(reproducir7, "NormalTextColour", "FFAAAAAA") reproducir8 = guiCreateButton(475, 176, 234, 37, "Audio8", false) guiSetProperty(reproducir8, "NormalTextColour", "FFAAAAAA") guiSetVisible(reproducir1, false) guiSetVisible(reproducir2, false) guiSetVisible(reproducir3, false) guiSetVisible(reproducir4, false) guiSetVisible(reproducir5, false) guiSetVisible(reproducir6, false) guiSetVisible(reproducir7, false) guiSetVisible(reproducir8, false) viewPanel = false function openPanel() if ( viewPanel == false ) then guiSetVisible(reproducir1, true) guiSetVisible(reproducir2, true) guiSetVisible(reproducir3, true) guiSetVisible(reproducir4, true) guiSetVisible(reproducir5, true) guiSetVisible(reproducir6, true) guiSetVisible(reproducir7, true) guiSetVisible(reproducir8, true) showCursor(true) viewPanel = true else guiSetVisible(reproducir1, false) guiSetVisible(reproducir2, false) guiSetVisible(reproducir3, false) guiSetVisible(reproducir4, false) guiSetVisible(reproducir5, false) guiSetVisible(reproducir6, false) guiSetVisible(reproducir7, false) guiSetVisible(reproducir8, false) showCursor(false) viewPanel = false end end bindKey("F7", "down", openPanel) addEventHandler("onClientGUIClick", reproducir1, function () local name = guiGetText(reproducir1) triggerServerEvent("playSound", localPlayer, name) end ) addEventHandler("onClientGUIClick", reproducir2, function () local name = guiGetText(reproducir2) triggerServerEvent("playSound", localPlayer, name) end ) addEventHandler("onClientGUIClick", reproducir3, function () local name = guiGetText(reproducir3) triggerServerEvent("playSound", localPlayer, name) end ) addEventHandler("onClientGUIClick", reproducir4, function () local name = guiGetText(reproducir4) triggerServerEvent("playSound", localPlayer, name) end ) addEventHandler("onClientGUIClick", reproducir5, function () local name = guiGetText(reproducir5) triggerServerEvent("playSound", localPlayer, name) end ) addEventHandler("onClientGUIClick", reproducir6, function () local name = guiGetText(reproducir6) triggerServerEvent("playSound", localPlayer, name) end ) addEventHandler("onClientGUIClick", reproducir7, function () local name = guiGetText(reproducir7) triggerServerEvent("playSound", localPlayer, name) end ) addEventHandler("onClientGUIClick", reproducir8, function () local name = guiGetText(reproducir8) triggerServerEvent("playSound", localPlayer, name) end ) addEvent("startPlaySound", true) addEventHandler("startPlaySound", root, function(nameSound) local x, y, z = getElementPosition( localPlayer ) local sound = playSound3D( "sonidos/"..nameSound..".mp3", x, y, z ) setSoundVolume( sound, 1 ) setSoundMinDistance( sound, 1 ) setSoundMaxDistance( sound, 100 ) attachElements( sound, localPlayer, 0, 0, 0 ) end ) Servidor addEvent("playSound", true) addEventHandler("playSound", root, function(name) local nameSound = tostring(name) outputChatBox(nameSound) triggerClientEvent(source,"startPlaySound", source, nameSound ) end ) Si tienes algún problema o otra duda avísame
    1 point
  14. Debug strings did not work so I used ircSay instead. I had to set the permission to 0 for the command to even show up. And it says, 1, 2, 4, shay successfully added to Moderator! And it did work. Here is the code I used. addIRCCommandHandler("!staff",function(server,channel,user,command,account,group) ircSay(channel,"1") if account and group then ircSay(channel,"2") if isObjectInACLGroup("user."..account,aclGetGroup(group)) then ircSay(channel,"3") aclGroupRemoveObject(aclGetGroup(group),"user."..account) ircSay(channel,account.." has been successfully removed from "..group.."!") outputChatBox("#FFFF00* #FF008F[#FFFFFFIRC#FF008F] #FFFFFF"..ircGetUserNick(user).."#FFFFFF has removed "..account.." from "..group.."!",getRootElement(),255,0,0,true) else ircSay(channel,"4") aclGroupAddObject(aclGetGroup(group),"user."..account) outputChatBox("#FFFF00* #FF008F[#FFFFFFIRC#FF008F] #FFFFFF"..ircGetUserNick(user).."#FFFFFF has added "..account.." to "..group.."!",getRootElement(),255,0,0,true) ircSay(channel,account.." has been successfully added to "..group.."!") end else ircSay(channel,"5") ircSay(channel,"Incorrect Syntax! !addstaff <playerName> <aclGroup>") end end)
    1 point
  15. Pues a mi me funciona bien el código, lo probé y todo bien ¿Compruebas que el script se haya iniciado? No sé, prueba de esta manera para que te avise que hayas iniciado el sonido correctamente y que los archivos de sonidos se llamen "prueba1.mp3" y "prueba2.mp3" y solo esos dos estén dentro de la carpeta "sonidos" Server local tick = getTickCount() addCommandHandler( "sound", function( player, _, name ) if getTickCount() - tick > 1000 then -- solo podrá usar el comando cada 1 segundo local name = name if (name) == "prueba1" or (name) == "prueba2" then --sólo si el comando es /sound prueba1 o /sound prueba2 se iniciará triggerClientEvent( player, "sound:startSound9", player, player, name) else outputChatBox("Este archivo "..name.." no se puede iniciar") end tick = getTickCount() end end ) Client addEvent( "sound:startSound9", true ) addEventHandler( "sound:startSound9", getRootElement( ), function( player, name) outputChatBox("Se inició el sonido "..name.."")-- El nombre del sonido que se inició local x, y, z = getElementPosition( player ) local sound = playSound3D( "sonidos/"..name..".mp3", x, y, z ) setSoundVolume( sound, 1 ) setSoundMinDistance( sound, 1 ) setSoundMaxDistance( sound, 100 ) attachElements( sound, player, 0, 0, 0 ) end )
    1 point
  16. cameras = { {x, y, z, rx, ry, rz}; {x, y, z, rx, ry, rz}; {x, y, z, rx, ry, rz}; } local Cameramode = 0 function cameraHandler( enablecam = true timer = setTimer(function() if enablecam == true then if Cameramode == #cameras then Cameramode = 1 else Cameramode = Cameramode + 1 end setCameraMatrix(cameras[Cameramode][1], cameras[Cameramode][2], cameras[Cameramode][3], cameras[Cameramode][4], cameras[Cameramode][5], cameras[Cameramode][6]) else killTimer(timer) end end, 5000, 0) end Add this to your script. Change x, y, z, rx, ry, rz to your camera coordinates. When you want to enable camera, add cameraHandler() to your script. and when you want to disable camera, add this to your code: enablecam = false Btw, haven't tested, because I wrote this all on phone.
    1 point
  17. 1 point
  18. .. مجتمع العرب يرحب بلجميع .. بعض رمزيات الجميلة للمنتدى بعض التوقيعات الجميلة للمنتدى بعض شعارات بسيطة لـ منتدى عبارات بسيطة للمنتدى .. رايكم يهمنا وشو رايكم بـ رمزيات و توقيعات و شعارات و عبارات #Edit: شهـآدهـ نـفـتخر فـيها هذا عدد الاعضاء و زوار الى دخلو ساعه 12 صباح يعطيكم العافيه لكل شخص دخل او تواجد او تفاعل @N3xT @Mr.MtFcH @Abdul KariM @MoDeR2014 @MR.GRAND @MR.NaiF-MTA @Khaled Alamri @iPrestege @MrSAUD1 @Mr.CoR @Mr.TnT @#BrosS وصنا 200 عضو الحمدالله
    1 point
  19. adddEventHandler( 'onClientGUIClick', root, function() if (source == btn1) then triggerServerEvent(localPlayer,"Master1",localPlayer) elseif (source == btn2) then triggerServerEvent(localPlayer,"Master",localPlayer) end end ) هذا كلنت سايد السيرفر سايد addEvent("Master",true) addEventHandler("Master",root,function() triggerClientEvent(root,"txt1",root) end ) addEvent("Master1",true) addEventHandler("Master1",root,function() triggerClientEvent(root,"txt2",root) end ) الان نرج للكلنت مره ثانيه وبتكون الاكواد addEvent("txt1",true) addEventHandler("txt1",root,function() guiSetText(Buy_Status, "Label 2") end ) addEvent("txt2",true) addEventHandler("txt2",root,function() guiSetText(Buy_Status, "Label 1") end ) يعني باختصار الكلنت كلو كذا ----------------------------------------------------------------------------- addEvent("txt1",true) addEventHandler("txt1",root,function() guiSetText(Buy_Status, "Label 2") end ) addEvent("txt2",true) addEventHandler("txt2",root,function() guiSetText(Buy_Status, "Label 1") end ) adddEventHandler( 'onClientGUIClick', root, function() if (source == btn1) then triggerServerEvent(localPlayer,"Master1",localPlayer) elseif (source == btn2) then triggerServerEvent(localPlayer,"Master",localPlayer) end end ) -------------------------------------------- والسيرفر كلو addEvent("Master",true) addEventHandler("Master",root,function() triggerClientEvent(root,"txt1",root) end ) addEvent("Master1",true) addEventHandler("Master1",root,function() triggerClientEvent(root,"txt2",root) end )
    1 point
  20. ما فهمت شي ممكن تسويه انت لان كل الاكواد كلنت مدري ايش فايدة التريقر في الموضوع @iPrestege
    1 point
  21. لا اللي اعرفه mysql فقط لتخزين البيانات ما اقدر اخزن صوت عليها او ملف
    1 point
  22. المايك ماتقدر تسجل صوته لكن... تقدر اذا كانت لك خبرة عالية نسبياً لانها تحتاج متصفحات وجافسكربت واتش ام ال بما ان ام تي ايه اضافت المتصفحات تقدر تسفيد منها مثلا اقرا الاقتباس هذا طبعا تقدر تسفيد من امكانيات المكتبة وتسجل الصوت الطريقة انك تسوي متصفح وتحط فيه صفحة تسجيل الصوت( اذا كان متصفح اللعبة نفسه يدعم تسجيل الصوت ) وبعدين تحفظه لكن الحفظ مو امن نسبيا تقدر تشفره وتحفظه وتفك تشفيره وهذي الية العمل اعرف انك راح تقول صعبة وماتقدر تسوي
    1 point
  23. В мта 1.5.3 не одно енб не работает!!! и я теперь не могу вернуть прежнюю версию(1.5.2), постоянно требует обновления, или я не смогу зайти на любой сервер! и испраьте эту ошибку, или удаляйте эту версию! Теперь мне Как сделать, так, чтобы в мта на версии 1.5.2 сервера запускались?
    1 point
  24. It seems that it's a nulled version. It seems that it's a nulled version.
    1 point
  25. In December 2016 R* will release GRAND THEFT AUTO: Vice City Stories in the mobile device but i happy the Last GTA 3D Universe release on phone But I Don't know R* release GTA VCS On Phone XX December 2016
    1 point
×
×
  • Create New...