Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/01/17 in all areas

  1. تقدر ماجربته لكن اتوقع ينفع طريقة الاستخدام سهلة addColumnIcon(gridlist, column, w, h, src) gridlist : الليست column : الكولمن w, h : الطول والعرض src : مسار الصورة function addColumnIcon(gridlist, column, w, h, src) local count = guiGridListGetColumnCount(gridlist) assert(count < column, "Invalid Column") local iconx = 0 for k=1, count do iconx = iconx+guiGridListGetColumnWidth(gridlist, k, false) if k == column then break end end return guiCreateStaticImage(iconx+2, 2, w, h, src, false, gridlist) end تقدر تسوي تعديلات مثلا تعدل رقم 2 عشان يناسب الحجم
    3 points
  2. G&T Mapping & Loki present: Cinema Experience Beta 2.0.2 Description We're happy to finally release the first beta version of our Cinema Experience! Check out its features down below... Video Screenshots Download Now Beta Ver. 2.0.2 [ October 7, 2019 ] Changelog Authors: Tails - Follow his group G&T Mapping on Facebook: http://fb.com/gtmapping Check out their other resources as well: http://gtmapping.blogspot.com Loki - Check out his original Cinema script here: https://community.multitheftauto.com/in ... s&id=11993 and his profile here: https://forum.multitheftauto.com/memberlist.php? ... le&u=79989 Please note that this resource is not 100% complete yet. Some features are disabled and there may still be some bugs. To get started, scroll down the page and read "How to install". The Features - YouTube TV browser - Fully automated playlist - VIP manager - Add/remove VIPs who can manage the Cinema. - Synced playback - Vote to skip video - Real-time Ambilight - Open/close the cinema - Kick players from the cinema - And a lot more! Commands Global Cmds: - F2 - Toggle the Cinema Panel (You have to be inside) - M - Mute the playback [This is currently bugged] - /play url - Adds a video to the playlist - /playlist - Shows the playlist in the chat - /geturl - Gives you the URL to the current video - /proper - Adjusts the width of the screen making it more normal VIP/Admin Cmds: - /replay - Replays the current video - /skipvideo - Force skip the current video - /stopplay - Stops all playback and clears the playlist - /remove nr - Removes a video from the playlist. E.x.: /remove 2 How to install Step 1 (Unpack resource) First update your server to the latest version! You need atleast version 1.5.2 anything lower is not supported! Type 'ver' without quotes into the server console (F8) to see what version you're running. Unpack the zip file to your server resources folder: Multi Theft Auto\server\mods\deathmatch\resources\ in a new folder called CinemaExperience Make sure you're an admin on your server if you don't know how to do that go and read the MTA wiki. Step 2 (grant resource admin access) Press P on your keyboard to open your admin panel and add the resource to the Admin ACL group To do that go to the Resources tab and click on the 'Manage ACL' button in the top right corner then double click 'Admin' under 'Groups' and press 'Add Object'. Type in resource.CinemaExperience and click on OK. Step 3 (start resource) Now start the resource. Open the in-game console (F8) and type in refresh and press enter, then type in start CinemaExperience and hit enter again. Step 4 (add yourself as VIP) Finally, you need to add yourself as VIP in the cinema panel. In order to do that, enter the cinema and press F2 to open up the cinema panel. Now open the Settings tab, then open the Visitors tab (on the right side of the panel) and select your name. Click on 'Add/remove VIP'. That's it! You have now access to all the settings so you can enjoy our Cinema Experience to the fullest How to change binds You can change the bind for toggling the panel in the s-binds.Lua file. Known issues / FAQ Installation: - I can't connect to API? Make sure the resource has admin privileges and server is up to date (1.5.2). Also try extracting the resource. - I can't add videos? If you can't control the settings after you've added yourself as VIP, unpack the resource and delete the config files in the cfg folder. Still need help? Leave us a message below or contact me through the G&T Mapping Facebook page (link at the bottom or top) Panel: - There's ads covering the screen! Sometimes there may be ads covering the video on the screen. You can click on the Skip Ads button to refresh the video, usually this will remove any ads on the video. Sorry for the inconvenience. There is no other solution at the moment. In the future - Add option to limit how many videos can be added per user - Add option to set the max length of a video - Add option to change the screens width and height and position This list isn't finished yet Bug reports / Questions / Feedback If you encounter any bugs, glitches, have any suggestions, feature requests, or simply just like to ask a question, please don't hesitate to post them Thanks!
    1 point
  3. Have the MTA Team setup an official Discord server? I saw an unofficial one on a topic a few weeks back and joined it, but somebody speaks once every few days and it's full of weird bot scripts. Would be an idea to get one going, especially as it can link to IRC.
    1 point
  4. Bruhhh just stay in SAPD:FR mate no hate here
    1 point
  5. @Master_MTA جرب هذا وعدل اسم داتا القتل او النقاط باول شيء : aKillsData = 'داتا النقاط' function aUpdateKiller ( ) aTopKiller = { }; for _,v in ipairs( getElementsByType ( 'player') ) do if getElementData ( v,aKillsData ) then table.insert ( aTopKiller,{ ['aName'] = getPlayerName ( v ),['aScore'] = getElementData ( v,aKillsData ) } ); end; end; table.sort ( aTopKiller, function ( a,b ) return a.aScore > b.aScore end ); end; aUpdateKiller ( ); addEventHandler ( 'onClientElementDataChange',root, function ( aD ) if aD == aKillsData then aUpdateKiller ( ); end end ); local aX,aY = guiGetScreenSize ( ) addEventHandler ( 'onClientRender',root, function ( ) if #aTopKiller > 0 then dxDrawText ( 'Top Player is : '..aTopKiller[1].aName..' and His score is : '..aTopKiller [1].aScore..'', 44, aY - 43, aX, aY, tocolor ( 255, 255, 255, 255 ), 1 ) end end )
    1 point
  6. Momentul ala cand te pupi singur in c*r ca nimeni alt cineva nu o face :))) vR-ul A FOST baza MTA-ului, cand fondatorul era inca cu capul pe umeri, acum nici stafful vechi nu il mai suporta si il lasa
    1 point
  7. Released: https://community.multitheftauto.com/index.php?p=resources&s=details&id=14043 Enjoy!
    1 point
  8. Exactly. There is a meta.xml file you can edit as well... Not a big surprise people come on this forum saying half of the functions don't work when people tell them to simply delete them...
    1 point
  9. Hola, no suelo ser muy activo en este foro pero quería presentar mi servidor. ¿De que trata? Se trata de un servidor DayZ, basado en la conocida modificación del juego Arma II y del juego con el mismo nombre. Aunque no es 100% igual al juego, se busca innovar e implementar nuevas cosas, no tan apegado a lo anterior. ¿Que sistemas y recursos tiene el servidor? Bueno, aquí me gustaría aclarar que el 90% del servidor fue programado por mi, buscando el rendimiento por sobre los demás servidores DayZ, el modo de juego prácticamente se hizo desde cero, reparando cada falla y error siempre. El servidor cuenta, entre otras cosas, con: Imágenes del servidor IP del servidor: 144.217.102.162:22063 Pagina de facebook: DayZ: Fear of Death Nuevamente quiero aclarar que en el servidor, tenemos como objetivo el rendimiento y también el equilibrio entre supervivencia y combate. También quiero aclarar que el servidor se está actualiza casi siempre, así que es posible que se encuentren muchas novedades y arreglos, aceptamos sugerencias y "críticas constructivas". Sin nada mas que decir, me despido cordialmente, cualquier pregunta la puedo responder en los comentarios. ^^ Los esperamos!
    1 point
  10. Sure, Add this to function, which is triggered when gui opens: Renderobjects = true And this to function which triggers when gui closes: Renderobjects = false Now add this on bottom of your script: Object = createObject(--your argument here) local ox, oy, oz = getElementPosition(Object) Summary = 0.4 -- amount, how much your object goes upwards addEventHandler("onClientRender", root, function() if Renderobjects then local scpos = guiScrollBarGetScrollPosition(scroll) setElementPosition(Object, ox, oy, oz+(scpos*Summary*0.01)) end end )
    1 point
  11. fr_client in freeroam folder, then search ' function showWelcomeMap() createWindow(wndSpawnMap) showCursor(true) end Then deleet this. If im not right, let me know, and i'll find you. I don't remember exactly.
    1 point
  12. ههههههههههههههههههههههههههه الله يرجك
    1 point
  13. local bestplayer = table.sort(getElementsByType("player"), function(a, b) return getElementData(a, "pointplayer") > getElementData(b, "pointplayer") end)[1]
    1 point
  14. 1 point
  15. السلام عليكم ورحمة الله وبركاته أول موضوع لي وسيكون مميز باذن الله ::??? شرح بسيط : الأغلب يشتكي انه بحث وبحث عن نسخة اصلية من لعبة GTA SAN وكره الاضافات التي تعلق اللعبة وتزيد من فرصة عدم ارتياحه باللعب ولكن كل هذا سيذهب بعيدا عن طريق هذا الشرح الجميل اخي الكريم نبدأ. ::??? عن اللعبة : متطلبات التشغيل OS : Xp - Vista - Seven Ram : 512 Mb Cpu : 2.8 Ghz Vga : 128 Mb وهذه النسخة ستكون خالية من الأضافات التي تسبب لاق او مشاكل باللعب وهذه النسخة مضاف لها جرافيك لدعم الاجهزة الضعيفة ?? كلمات سر اللعبة ?? تنويه : تعمل فقط على الأوف لاين التحميل والأن وصلنا لنهاية الموضوع وهو تحميل لعبة GTA SAN Orginal +None LaG التحميل أو قوم بنسخ هذا الرابط ولصقه بأعلى فوق: http://viid.me/quvqvX الأون لاين لها شرح اخر لبرنامجي اون لاين باذن الله
    1 point
  16. I was replying to @fabervox ( Moved to https://forum.multitheftauto.com/topic/92043-cd46-ac-error-4-8da6-0500/ )
    1 point
  17. That's true but he's using NerdGaming's script which is open-source.
    1 point
  18. يا ابن آدم، خالفني و إختلف عنّي يهوديا، مسيحيّا، أو مسلما شيعيّا كنت أم سنّي.. أو حتى لو كنت دون معتقد أبيضا كنت أو أسود فقط كُن أنت و لا تكن هُم دع ذاتك تسمو و عانق عمق الحُلم يا ابن آدم خلقك الله مختلف فبربّك.. بإختلافك إعترف و في تفرّدكَ إحترِف كُن خليفة الله على الأرض بإختلافك و لا تتبع ذاك القطيع عِش حُرّا يا ابن آدم . فهذه الأرض للجميع انيس شوشان
    1 point
  19. 1. Stop ArtMoney 2. Reboot PC
    1 point
  20. انجليزي دا يا مرسي ؟
    1 point
  21. (فَإِذَا قَضَيْتُمُ الصَّلَاةَ فَاذْكُرُوا اللَّهَ قِيَامًا وَقُعُودًا وَعَلَىٰ جُنُوبِكُمْ ۚ فَإِذَا اطْمَأْنَنتُمْ فَأَقِيمُوا الصَّلَاةَ ۚ إِنَّ الصَّلَاةَ كَانَتْ عَلَى الْمُؤْمِنِينَ كِتَابًا مَّوْقُوتًا (103 من فوائد صلاة الفجر أحمد خالد العتيبي بسم الله الرحمن الرحيم 1- أن أداءها في وقتها مع الجماعة من صفات المؤمنين. 2- أن أداءها مع الجماعة مع صلاة العشاء يعدل قيام الليل قال صلى الله عليه وسلم : ( من صلى العشاء في جماعة فكأنما قام نصف الليل، ومن صلى الصبح في جماعة فكأنما صلى الليل كله) رواه مسلم. 3- أن من صلى الفجر فهو في ذمة الله – أي في حفظ الله : قال صلى الله عليه وسلم (من صلى الصبح فهو في ذمة الله) رواه مسلم. 4- أن المسلم إذا استيقظ من نومه فذكر الله وتوضأ وصلى أصبح نشيطاً طيب النفس وإلا أصبح خبيث النفس كسلان. 5- أن أداءها في وقتها مع الجماعة من أسباب دخول الجنة والنجاة من النار مع أداء صلاة العصر، قال صلى الله عليه وسلم: (من صلى البردين دخل الجنة) متفق عليه \" والبردان : الصبح والعصر \". 6- حضور اجتماع الملائكة في صلاة الصبح وصلاة العصر. قال صلى الله عليه وسلم : ( يتعاقبون فيكم ملائكة بالليل وملائكة بالنهار ويجتمعون في صلاة الصبح وصلاة العصر ثم يعرج الذين باتوا فيكم فيسألهم الله – وهو أعلم بهم – كيف تركتم عبادي؟ فيقولون تركناهم وهو يصلون) متفق عليه. ومن الأسباب المعينة للاستيقاظ لصلاة الفجر : 1- النوم مبكراً فقد كان النبي صلى الله عليه وسلم يكره النوم قبل صلاة العشاء والحديث بعدها إلا ما فيه مصلحه وخير . 2- أن يحرص المسلم على آداب النوم كالدعاء قبل النوم وجمع الكفين والنفث فيهما ويقرأ سورة الإخلاص والمعوذات والنوم على طهارة. 3- أن يستعين بمن حوله من أهله ووالديه وأقاربه وجيرانه فيوصيهم بإيقاظه. 4- عمارة القلب بالإيمان والعمل الصالح والبعد عن المعاصي. 5- أن يستشعر ما ودر في فضل صلاة الفجر من الأجر العظيم قال صلى الله عليه وسلم: (من صلى العشاء في جماعة فكأنما قام نصف الليل ومن صلى الصبح في جماعة فكأنما قام الليل كله) رواه مسلم. وما ورد في ذم تاركها مع الجماعة ومؤخرها عن وقتها من الزجر والتوبيخ عن ابن مسعود رضي الله عنه قال : ذكر عند النبي صلى الله عليه وسلم رجل نام ليله حتى أصبح قال : ذاك رجل بال الشيطان في أذنه \" أو قال \" : \"في أذنيه\". رواه البخاري ومسلم. 6- أن يحرص المسلم على أن ينفي عن نفسه صفة المنافقين، قال صلى الله عليه وسلم : ( إن أثقل الصلاة على المنافقين صلاة العشاء وصلاة الفجر ولو يعلمون ما فيهما لأتوهما ولو حبوا ) رواه البخاري ومسلم. وقبل ذلك كله سؤال الله تعالى التوفيق والهداية لذلك. أسأل الله عز وجل أن يجعلنا من المحافظين على الصلوات ومن المكثرين من الطاعات .
    1 point
  22. oh sory i don't see what you posted lol function test () local groupTurfs = { } for i, v in pairs ( turfLocs ) do if ( not groupTurfs [ v.owner ] ) then groupTurfs [ v.owner ] = 0 end if ( not v.attackers ) then groupTurfs [ v.owner ] = groupTurfs [ v.owner ] + 1 end end for index, clan in pairs(exports.SAEGClans:getClanList(groupTurfs)) do local clanList = tostring(clan["clan_name"]) if ( groupTurfs [ clanList ] or 0 ) then outputChatBox ( "Test : "..clanList.."->"..tostring(groupTurfs [ clanList ]).. "") end end end addCommandHandler("ct",test) now i'm geting full clans list with how much have turfs , i want if clan don't have turfs it's don't show in that chat ! Please help !
    1 point
  23. function addTurf( player, cmd, width, height) if ( exports.NGAdministration:isPlayerStaff ( player ) and exports.NGAdministration:getPlayerStaffLevel ( player, 'int' ) >= 4 ) then if ( not width ) then return exports.NGMessages:sendClientMessage ( "Missing width argument, correct syntax: /addturf width height", player, 225, 0, 0) end if ( not height ) then return exports.NGMessages:sendClientMessage ( "Missing height argument, correct syntax: /addturf width height", player, 225, 0, 0) end -------if ( type ( width ) ~= 'string' and type ( height ) ~= 'string' ) then return exports.SAEGMessages:sendClientMessage( "SAEGTurf: Expected numbers for width and/or height", player, 0, 255, 0 ) end local x, y, z = getElementPosition ( player ) createTurf ( x, y, z, width, height, "server", id ) exports.NGSQL:db_query ( "INSERT INTO turfs(`id`, `owner`, `x`, `y`, `z`, `width`, `height`) VALUES (?, ?, ?, ?, ?, ?, ?)", id, 'server', math.floor(x), math.floor(y), math.floor(z), tonumber(width), tonumber(height)) exports.NGMessages:sendClientMessage( "SAEGTurf: A new turf was added successfully", player, 0, 255, 0 ) end end addCommandHandler( "addturf", addTurf )
    1 point
  24. Clan War System -Version 1.2.0- What is Clan War System (CWS)? CWS is a system which automatically manages your clan wars by score, but also automatically switches maps which you set. Also there are alot of other settings which you can set to however you like! Why did you make this script? Because remembering the score by yourself is annoying, also setting the maps by yourself is annoying. So why not making an automatic system? Why are the scripts compiled? The client-side script has 6949 rules and the server-side script has 2323 rules of scripting work, which means a lot of work was put into this system. A good functionality and good working script is a reason to steal it. In other words: Thank those stealers as reason for me to compile it! (Maybe later it will get released decompiled) Is Clan War System (CWS) even fully made by you? CWS is fully created by myself. In the progress of making CWS, I had to learn some parts of scripting. I have and had to learn these parts and with the help of some people I was able to reach what I wanted. Thanks those for the help! (Check the credits) CWS was made without tools. No tools like GUIEditor, DXGUI, or other tools. What gamemodes does Clan War System (CWS) support? CWS does only support gamemode RACE. (RACE:DD, RACE:DM and RACE:RACE) The System Main EIW (Error, Info and Warning messages) Join Team Management Panel Settings Scoreboard Changelog To do List Bugs, glitches, typo's, idea's, suggestions or more? Post it in this topic! Spread the word! -DOWNLOAD- https://community.multitheftauto.com/ind ... s&id=10471 Please also give a rate( and comment) about what you think of the system Have fun using Clan War System!
    1 point
  25. It is using the bank system? https://community.multitheftauto.com/in ... ails&id=54
    1 point
  26. local _setElementData = setElementData function setElementData ( element, group, value ) return _setElementData ( element, group, value, true ) end local turfLocs = { } function createTurf ( x, y, z, width, height, owner, forcedId ) local owner = tostring ( owner or "server" ) local r, g, b = exports.SAEGGroups:getGroupColor ( owner ) if not r then r = 255 end if not g then g = 255 end if not b then b = 255 end if ( owner == "server" ) then r, g, b = 255, 255, 255 end local rad = createRadarArea ( x, y, width, height, r, g, b, 170, getRootElement ( ) ) local col = createColCuboid ( x, y, z-5, width, height, 35) if ( not forcedId or turfLocs [ id ] ) then id = 0 while ( turfLocs [ id ] ) do id = id + 1 end else id = forcedId end turfLocs[id] = { } turfLocs[id].col = col turfLocs[id].radar = rad turfLocs[id].owner = owner or "server" turfLocs[id].attackers = nil turfLocs[id].attackProg = 0 turfLocs[id].prepProg = 0 setElementData ( turfLocs[id].col, "SAEGTurf:TurfId", id ) setElementData ( turfLocs[id].col, "SAEGTurf:TurffingTable", turfLocs [ id ] ) addEventHandler ( "onColShapeHit", turfLocs[id].col, onColShapeHit ) addEventHandler ( "onColShapeLeave", turfLocs[id].col, onColShapeLeave ) return turfLocs[id]; end function updateTurfGroupColor ( group ) local r, g, b = exports.saeggroups:getGroupColor ( group ) for i, v in pairs ( turfLocs ) do if ( v.owner == group ) then setRadarAreaColor ( v.radar, r, g, b, 120 ) end end end function onColShapeHit ( player ) if ( player and isElement ( player ) and getElementType ( player ) == "player" and not isPedInVehicle ( player ) ) then local gang = exports.saeggroups:getPlayerGroup ( player ) if getTeamName(getPlayerTeam(player)) ~= "Criminals" then exports['SAEGMessages']:sendClientMessage("You must be criminal.",255,0,0) return end triggerClientEvent ( player, "SAEGTurfs:onClientEnterTurfArea", player, turfLocs [ id ] ) if ( not gang ) then return exports.SAEGMessages:sendClientMessage ( "You're not in a gang, you cannot turf.", player, 255, 255, 0 ) end local id = tonumber ( getElementData ( source, "SAEGTurf:TurfId" ) ) if ( turfLocs[id].owner == gang ) then return end if ( turfLocs[id].attackers and turfLocs[id].attackers ~= gang ) then end if ( not turfLocs[id].attackers ) then local x, y, z = getElementPosition ( source ) setRadarAreaFlashing ( turfLocs[id].radar, true ) turfLocs[id].attackers = gang turfLocs[id].attackProg = 0 turfLocs[id].prepProg = 0 setElementData ( turfLocs[id].col, "SAEGTurf:TurffingTable", turfLocs [ id ] ) end end end function onColShapeLeave ( player ) if ( player and getElementType ( player ) == "player" ) then triggerClientEvent ( player, "SAEGTurfs:onClientExitTurfArea", player, turfLocs [ getElementData ( source, "SAEGTurf:TurfId" ) ] ) end end setTimer ( function ( ) for id, data in pairs ( turfLocs ) do if ( data.attackers ) then local players = { attackers = { }, owners = { } } local isGangInTurf = false local isOwnerInTurf = false for i, v in pairs ( getElementsWithinColShape ( data.col, "player" ) ) do local g = exports.SAEGGroups:getPlayerGroup ( v ) if ( g == data.attackers ) then isGangInTurf = true table.insert ( players.attackers, v ) elseif ( g == data.owner ) then isOwnerInTurf = true table.insert ( players.owners, v ) end end local x, y, z = getElementPosition ( data.col ) if ( isOwnerInTurf and isGangInTurf ) then else -- Add Points To Attackers if ( isGangInTurf ) then -- Prep the war if ( turfLocs[id].attackProg == 0 ) then turfLocs[id].prepProg = data.prepProg + 2 if ( turfLocs[id].prepProg >= 100 ) then turfLocs[id].prepProg = 0 turfLocs[id].attackProg = 1 beginTurfWarOnTurf ( id ) end -- Attack War else turfLocs[id].attackProg = turfLocs[id].attackProg + 1 if ( turfLocs[id].attackProg == 100 ) then setTurfOwner ( id, turfLocs[id].attackers ) exports['SAEGPolice']:giveWantedPoints(source,120) end end -- Take points from attackers else -- Prepare war if ( turfLocs[id].attackProg == 0 ) then turfLocs[id].prepProg = data.prepProg - 2 if ( turfLocs[id].prepProg <= 0 ) then setTurfOwner ( id, turfLocs[id].owner ) end -- Attacking war else turfLocs[id].attackProg = data.attackProg - 1 if ( turfLocs[id].attackProg <= 0 ) then setTurfOwner ( id, turfLocs[id].owner ) end end end end for i, v in pairs ( players ) do for k, p in pairs ( v ) do triggerClientEvent ( p, "SAEGTurfs:upadateClientInfo", p, turfLocs [ id ] ) end end end end end, 800, 0 ) addEvent ( "SAEGTurfs:onTurfProgressChange", true ) --[[ addCommandHandler ( "attackprog", function ( p ) local gangAttacks = { } local g = exports.SAEGGroups:getPlayerGroup ( p ) if ( not g ) then return exports.SAEGMessages:sendclientMessage ( "You're not in a gang", p, 255, 255, 0) end for i, v in pairs ( turfLocs ) do if ( v.attackers and v.attackers == g ) then gangAttacks [ i ] = true end end if ( table.len ( gangAttacks ) == 0 ) then return exports.SAEGMessages:sendClientMessage ( "Your gang isn't involved in any gang wars right now.", p, 255, 255, 0 ) end for id, _ in pairs ( gangAttacks ) do local x ,y, z = getElementPosition ( turfLocs[id].col ) outputChatBox ( "----Turf War Status---", p, 255, 255, 255, false ) outputChatBox ( "Current owner: "..turfLocs[id].owner, p, 255, 255, 255, false ) outputChatBox ( "Attacker: "..turfLocs[id].attackers, p, 255, 255, 255, false ) outputChatBox ( "Prep Progress: "..turfLocs[id].prepProg.."%", p, 255, 255, 255, false ) outputChatBox ( "Attack Progress: "..turfLocs[id].attackProg.."%", p, 255, 255, 255, false ) outputChatBox ( "Turf Location: "..getZoneName ( x, y, z )..", "..getZoneName ( x, y, z, true ), p, 255, 255, 255, false ) outputChatBox ( "Turf Server-ID: "..id, p, 255, 255, 255, false ) end end )]] function table.len ( tb ) local c = 0 for i, v in pairs ( tb ) do c = c + 1 end return c end function beginTurfWarOnTurf ( id ) local d = turfLocs [ id ] local x, y, z = getElementPosition ( d.col ) setRadarAreaColor ( d.radar, 255, 255, 255, 170 ) end function setTurfOwner ( id, owner ) setRadarAreaFlashing ( turfLocs[id].radar, false ) turfLocs[id].owner = owner turfLocs[id].attackers = nil turfLocs[id].attackProg = 0 local r, g, b = exports.SAEGGroups:getGroupColor ( owner ) setRadarAreaColor ( turfLocs[id].radar, r, g, b, 120 ) saveTurfs ( ) end function getTurfs ( ) return turfLocs end function saveTurfs ( ) for id, data in pairs ( turfLocs ) do exports.NGSQL:db_exec ( "UPDATE turfs SET owner=? WHERE id=?", data.owner, id ) end return true end addEventHandler( "onResourceStart", resourceRoot, function ( ) exports.NGSQL:db_exec ( "CREATE TABLE IF NOT EXISTS turfs ( id INT, owner VARCHAR(50), x FLOAT, y FLOAT, z FLOAT, width INT, height INT )" ) local query = exports.NGSQL:db_query ( "SELECT * FROM turfs" ) if ( #query == 0 ) then local data = { { -1867.8, -107.43, 15.1, 58, 65 }, { -1866.5, -26.36, 15.29, 49, 200 }, { -1811.33, 743.43, 20, 85, 85 }, { -1991.5, 862.62, 34, 79, 42 }, { -2799.25, -200.6, 7.19, 83, 120 }, { -2136.84, 120.12, 30, 120, 190 }, { -2516.52, 718.16, 27.97, 118, 80 }, { -2516.41, 578.19, 16.62, 100, 100 }, { -2596.49, 818.05, 49.98, 59, 80 }, { -2453.17, 947.58, 45.43, 54, 80 }, { -2740.6, 344.59, 4.41, 68, 61 }, { -2696.24, 227.35, 4.33, 39.5, 50.5 }, { -2397.31, 82.99, 35.3, 133, 160 }, { -2095.33, -280.06, 35.32, 84, 176 }, { -1980.58, 107.69, 27.68, 59, 62 }, { -2129.01, 741.71, 48, 112, 57 }, { -2243.24, 928.4, 66.65, 87, 154 }, { -1701.62, 743.44, 10, 129, 83 }, { -2696.23, -59.88, 4.73, 83, 89 }, { -2541.18, -720.16, 135, 55, 125 }, }
    1 point
  27. How I can add isPlayerInTeamTurfing in this script (not my own script ) local _setElementData = setElementData function setElementData ( element, group, value ) return _setElementData ( element, group, value, true ) end local turfLocs = { } function createTurf ( x, y, z, width, height, owner, forcedId ) local owner = tostring ( owner or "server" ) local r, g, b = exports.SAEGGroups:getGroupColor ( owner ) if not r then r = 255 end if not g then g = 255 end if not b then b = 255 end if ( owner == "server" ) then r, g, b = 255, 255, 255 end local rad = createRadarArea ( x, y, width, height, r, g, b, 170, getRootElement ( ) ) local col = createColCuboid ( x, y, z-5, width, height, 35) if ( not forcedId or turfLocs [ id ] ) then id = 0 while ( turfLocs [ id ] ) do id = id + 1 end else id = forcedId end turfLocs[id] = { } turfLocs[id].col = col turfLocs[id].radar = rad turfLocs[id].owner = owner or "server" turfLocs[id].attackers = nil turfLocs[id].attackProg = 0 turfLocs[id].prepProg = 0 setElementData ( turfLocs[id].col, "SAEGTurf:TurfId", id ) setElementData ( turfLocs[id].col, "SAEGTurf:TurffingTable", turfLocs [ id ] ) addEventHandler ( "onColShapeHit", turfLocs[id].col, onColShapeHit ) addEventHandler ( "onColShapeLeave", turfLocs[id].col, onColShapeLeave ) return turfLocs[id]; end function updateTurfGroupColor ( group ) local r, g, b = exports.saeggroups:getGroupColor ( group ) for i, v in pairs ( turfLocs ) do if ( v.owner == group ) then setRadarAreaColor ( v.radar, r, g, b, 120 ) end end end function onColShapeHit ( player ) if ( player and isElement ( player ) and getElementType ( player ) == "player" and not isPedInVehicle ( player ) ) then local gang = exports.saeggroups:getPlayerGroup ( player ) triggerClientEvent ( player, "SAEGTurfs:onClientEnterTurfArea", player, turfLocs [ id ] ) if ( not gang ) then return exports.SAEGMessages:sendClientMessage ( "You're not in a gang, you cannot turf.", player, 255, 255, 0 ) end local id = tonumber ( getElementData ( source, "SAEGTurf:TurfId" ) ) if ( turfLocs[id].owner == gang ) then return end if ( turfLocs[id].attackers and turfLocs[id].attackers ~= gang ) then return exports.SAEGMessages:sendClientMessage ( "The "..tostring(turfLocs[id].attackers).." gang is already trying to take this turf. Try again later.", player, 255, 0, 0 ) end if ( not turfLocs[id].attackers ) then exports.SAEGMessages:sendClientMessage ( "You have started to prepare a turf war. Find cover, call backup, and wait for it to begin.", player, 255, 255, 0 ) local x, y, z = getElementPosition ( source ) exports.SAEGGroups:outputGroupMessage ( getPlayerName ( player ).." is preparing a turf war with "..tostring(turfLocs[id].owner).." in "..getZoneName(x,y,z)..", "..getZoneName(x,y,z,false).."! Get there to help him, the war will start in 2 minutes!", gang, 255, 255, 0 ) setRadarAreaFlashing ( turfLocs[id].radar, true ) turfLocs[id].attackers = gang turfLocs[id].attackProg = 0 turfLocs[id].prepProg = 0 setElementData ( turfLocs[id].col, "SAEGTurf:TurffingTable", turfLocs [ id ] ) end end end function onColShapeLeave ( player ) if ( player and getElementType ( player ) == "player" ) then triggerClientEvent ( player, "SAEGTurfs:onClientExitTurfArea", player, turfLocs [ getElementData ( source, "SAEGTurf:TurfId" ) ] ) end end setTimer ( function ( ) for id, data in pairs ( turfLocs ) do if ( data.attackers ) then local players = { attackers = { }, owners = { } } local isGangInTurf = false local isOwnerInTurf = false for i, v in pairs ( getElementsWithinColShape ( data.col, "player" ) ) do local g = exports.SAEGGroups:getPlayerGroup ( v ) if ( g == data.attackers ) then isGangInTurf = true table.insert ( players.attackers, v ) elseif ( g == data.owner ) then isOwnerInTurf = true table.insert ( players.owners, v ) end end local x, y, z = getElementPosition ( data.col ) if ( isOwnerInTurf and isGangInTurf ) then exports.SAEGGroups:outputGroupMessage ( "The turf war in "..getZoneName ( x,y,z )..", "..getZoneName ( x,y,z, false ).." is paused due to both gangs in the turf", turfLocs[id].attackers, 255, 255, 255 ) exports.SAEGGroups:outputGroupMessage ( "The turf war in "..getZoneName ( x,y,z )..", "..getZoneName ( x,y,z, false ).." is paused due to both gangs in the turf", turfLocs[id].owner, 255, 255, 255 ) else -- Add Points To Attackers if ( isGangInTurf ) then -- Prep the war if ( turfLocs[id].attackProg == 0 ) then turfLocs[id].prepProg = data.prepProg + 2 if ( turfLocs[id].prepProg >= 100 ) then turfLocs[id].prepProg = 0 turfLocs[id].attackProg = 1 beginTurfWarOnTurf ( id ) end -- Attack War else turfLocs[id].attackProg = turfLocs[id].attackProg + 1 if ( turfLocs[id].attackProg == 100 ) then exports.SAEGGroups:outputGroupMessage ( "Your gang has captured a turf in "..getZoneName ( x,y,z )..", "..getZoneName ( x,y,z, false ).." from the "..turfLocs[id].owner.." gang! Great job!", turfLocs[id].attackers, 0, 255, 0) exports.SAEGGroups:outputGroupMessage ( "Your gang lost a turf in "..getZoneName ( x,y,z )..", "..getZoneName ( x,y,z, false ).." to the "..turfLocs[id].attackers.." gang.", turfLocs[id].owner, 255, 0, 0) setTurfOwner ( id, turfLocs[id].attackers ) end end -- Take points from attackers else -- Prepare war if ( turfLocs[id].attackProg == 0 ) then turfLocs[id].prepProg = data.prepProg - 2 if ( turfLocs[id].prepProg <= 0 ) then exports.SAEGGroups:outputGroupMessage ( "Your gang lost the turf preparation war in "..getZoneName(x,y,z)..", "..getZoneName ( x,y,z, false ).." to the "..turfLocs[id].owner.." gang!", turfLocs[id].attackers, 255, 0, 0 ) exports.SAEGGroups:outputGroupMessage ( "Your gang has defended the turf in "..getZoneName(x,y,z)..", "..getZoneName(x,y,z,false).."!", turfLocs[id].owner..", from the "..turfLocs[id].attackers.." gang, when it was being preped for a war", 0, 255, 0 ) setTurfOwner ( id, turfLocs[id].owner ) end -- Attacking war else turfLocs[id].attackProg = data.attackProg - 1 if ( turfLocs[id].attackProg <= 0 ) then exports.SAEGGroups:outputGroupMessage ( "Your gang lost the turf war in "..getZoneName(x,y,z)..", "..getZoneName ( x,y,z, false ).." to the "..turfLocs[id].owner.." gang!", turfLocs[id].attackers, 255, 0, 0 ) exports.SAEGGroups:outputGroupMessage ( "Your gang has defended the turf in "..getZoneName(x,y,z)..", "..getZoneName(x,y,z,false).." from the "..turfLocs[id].attackers.." gang", turfLocs[id].owner, 0, 255, 0 ) setTurfOwner ( id, turfLocs[id].owner ) end end end end for i, v in pairs ( players ) do for k, p in pairs ( v ) do triggerClientEvent ( p, "SAEGTurfs:upadateClientInfo", p, turfLocs [ id ] ) end end end end end, 800, 0 ) addEvent ( "SAEGTurfs:onTurfProgressChange", true ) --[[ addCommandHandler ( "attackprog", function ( p ) local gangAttacks = { } local g = exports.SAEGGroups:getPlayerGroup ( p ) if ( not g ) then return exports.SAEGMessages:sendclientMessage ( "You're not in a gang", p, 255, 255, 0) end for i, v in pairs ( turfLocs ) do if ( v.attackers and v.attackers == g ) then gangAttacks [ i ] = true end end if ( table.len ( gangAttacks ) == 0 ) then return exports.SAEGMessages:sendClientMessage ( "Your gang isn't involved in any gang wars right now.", p, 255, 255, 0 ) end for id, _ in pairs ( gangAttacks ) do local x ,y, z = getElementPosition ( turfLocs[id].col ) outputChatBox ( "----Turf War Status---", p, 255, 255, 255, false ) outputChatBox ( "Current owner: "..turfLocs[id].owner, p, 255, 255, 255, false ) outputChatBox ( "Attacker: "..turfLocs[id].attackers, p, 255, 255, 255, false ) outputChatBox ( "Prep Progress: "..turfLocs[id].prepProg.."%", p, 255, 255, 255, false ) outputChatBox ( "Attack Progress: "..turfLocs[id].attackProg.."%", p, 255, 255, 255, false ) outputChatBox ( "Turf Location: "..getZoneName ( x, y, z )..", "..getZoneName ( x, y, z, true ), p, 255, 255, 255, false ) outputChatBox ( "Turf Server-ID: "..id, p, 255, 255, 255, false ) end end )]] function table.len ( tb ) local c = 0 for i, v in pairs ( tb ) do c = c + 1 end return c end function beginTurfWarOnTurf ( id ) local d = turfLocs [ id ] local x, y, z = getElementPosition ( d.col ) exports.SAEGGroups:outputGroupMessage ( "Your gang has begun a turf war in "..getZoneName ( x, y, z)..", "..getZoneName ( x, y, z, true ).." against the "..d.owner.." gang! Get there an help!", d.attackers, 255, 255, 0 ) exports.SAEGGroups:outputGroupMessage ( "One of your turfs in "..getZoneName ( x, y, z)..", "..getZoneName ( x, y, z, true ).." is being attacked by the "..d.attackers.." gang!", d.owners, 255, 0, 0 ) setRadarAreaColor ( d.radar, 255, 255, 255, 170 ) end function setTurfOwner ( id, owner ) setRadarAreaFlashing ( turfLocs[id].radar, false ) turfLocs[id].owner = owner turfLocs[id].attackers = nil turfLocs[id].attackProg = 0 local r, g, b = exports.SAEGGroups:getGroupColor ( owner ) setRadarAreaColor ( turfLocs[id].radar, r, g, b, 120 ) saveTurfs ( ) end function getTurfs ( ) return turfLocs end function saveTurfs ( ) for id, data in pairs ( turfLocs ) do exports.NGSQL:db_exec ( "UPDATE turfs SET owner=? WHERE id=?", data.owner, id ) end return true end addEventHandler( "onResourceStart", resourceRoot, function ( ) exports.NGSQL:db_exec ( "CREATE TABLE IF NOT EXISTS turfs ( id INT, owner VARCHAR(50), x FLOAT, y FLOAT, z FLOAT, width INT, height INT )" ) local query = exports.NGSQL:db_query ( "SELECT * FROM turfs" ) if ( #query == 0 ) then local data = { { -1867.8, -107.43, 15.1, 58, 65 }, { -1866.5, -26.36, 15.29, 49, 200 }, { -1811.33, 743.43, 20, 85, 85 }, { -1991.5, 862.62, 34, 79, 42 }, { -2799.25, -200.6, 7.19, 83, 120 }, { -2136.84, 120.12, 30, 120, 190 }, { -2516.52, 718.16, 27.97, 118, 80 }, { -2516.41, 578.19, 16.62, 100, 100 }, { -2596.49, 818.05, 49.98, 59, 80 }, { -2453.17, 947.58, 45.43, 54, 80 }, { -2740.6, 344.59, 4.41, 68, 61 }, { -2696.24, 227.35, 4.33, 39.5, 50.5 },
    1 point
  28. Great news! I've released Nerd Gaming 1.1.4, which is equipped with some great new features for both players and administrators! Change log
    1 point
×
×
  • Create New...