ايهاب Posted October 19, 2015 Share Posted October 19, 2015 (edited) فى مود الاحتلال دة هل كود من الاكواد دى لة علاقة بأختيار التيم الى يقدر يحتل الارض ماثلا اللاعب الى يقدر يحتل الارض لازم يبقى مجرم كريمنال لو عايز اضيف تيم اخر ماثلا الشرطة هل الاكواد دى ليها علاقة بأختيار اللاعب تيم الى يقدر يحتل الارض عشان لو عايز اضيف تيم for i,v in ipairs(turfPos) do local sqlData = executeSQLQuery("SELECT * FROM Turf_System WHERE Turfs=?", "Turf["..tostring(i).."]") local turfCol = createColCuboid(unpack(v)) setElementData(turfCol, "getTurfGang", sqlData[1].GangOwner) local turfArea = createRadarArea(v[1], v[2], v[4], v[5], sqlData[1].r, sqlData[1].g, sqlData[1].b, 175) turfElement[turfCol] = {turfCol, turfArea, i} turfTimer[turfCol] = {} function ( ) local players = getGangPlayersInTurf ( turf, playerGang ) setRadarAreaColor ( area, tonumber(r), tonumber(g), tonumber(b), 175 ) for _, player in ipairs ( players ) do local playerGang = getElementData ( player, "gang" ) local turfGang = executeSQLQuery("SELECT GangOwner FROM Turf_System WHERE Turfs=?", "Turf["..tostring(id).."]" ) if ( turfGang[1].GangOwner == playerGang ) then for _, v in ipairs( players ) do if getElementData(v, "gang") == gang then table.insert(gPla, v) function(source, aGang) if isTimer(turfTimer[source][1]) then killTimer(turfTimer[source][1]) end setRadarAreaFlashing(turfElement[source][2], false) for _, v in ipairs( getElementsByType("player") ) do if getElementData(v, "gang") == aGang then outputChatBox(messages[7], v, 255, 0, 0) end [divbox=]عشان عايز اخلى الى معاهم تيم ارمى يقدروة يحتل اراضى واستفسار اخر بدل ما اعمل موضوع اخر ازاى اخفى الماركر يعنى انا عملت ماركر كبير فى حجم قطعة ارض بس عايز الماركر يختفى يكون موجود يختفى بس مظهروة Edited October 20, 2015 by Guest Link to comment
ALw7sH Posted October 19, 2015 Share Posted October 19, 2015 بالنسبة لسؤالك الأول ولا كود من الاكواد الي حطيتها له علاقه بالي تتكلم عنه وبالنسبة لسؤالك الثاني فك الويكي حق الماركر وبتشوف بالساينتكس حقه الفا خل ذا الارقمنت 0 Link to comment
ايهاب Posted October 19, 2015 Author Share Posted October 19, 2015 ملقتشى غير دول فى المود مفيش حتى كلمة كيرمينال طب لو موجودة بتبقى اسمها اية وهل يمكن اضافة تيم يحتل ولا المود بيبقى كدة اصل الاحتلال دة gang system مش جروب سيستم ينفع ؟. Link to comment
3NAD Posted October 20, 2015 Share Posted October 20, 2015 اولاً يجب تعريف الأرض مثلاً : Place_A وابحث عن كود بدء الإحتلال و ضع فيه الشرط الذي تريده if colshape == Place_A then if team == "Criminal" then -- else outputChatBox ( "for 'Criminal Team' only" ) end end Link to comment
ايهاب Posted October 21, 2015 Author Share Posted October 21, 2015 اولاً يجب تعريف الأرضمثلاً : Place_A وابحث عن كود بدء الإحتلال و ضع فيه الشرط الذي تريده if colshape == Place_A then if team == "Criminal" then -- else outputChatBox ( "for 'Criminal Team' only" ) end end الصراحة مش عارف انى كود من دول انا اعتقد دة لكن مو متاكد function getGangPlayersInTurf( turf, gang ) -- element, string او دة function( player ) addEventHandler("onClientResourceStart", resourceRoot, function() setDevelopmentMode(true) end ) function music() local sound = playSound("missionDone.mp3") end addEvent("onTakeTurf", true) addEventHandler("onTakeTurf", resourceRoot, music) هذا الكود فى ملف الكلينت ------------------------------------ دول السيرفر local turfPos = { { 2133.1950683594, 633.66455078125, 0, 197.5, 92, 90 }, { 2 } local turfElement = {} local turfTimer = {} local checkComplete = false local messages = { [1] = "Turf System by Sasuke* was started correctly!", [2] = "This territory already belongs to %s", [3] = "You enter into de %s's turf zone. Wait 2 minutes to capture the turf and win 4k", [4] = "This turf doesn't belong to anyone. Wait 2 minutes to capture the turf and win 4k", [5] = "Congratulations. You capture the turf. +4K!", [6] = "If you don't come back within 20s, you won't capture the turf", [7] = "You couldn't capture the turf because of absence" } -- Nadie = None | Just a translation addEventHandler("onResourceStart", resourceRoot, function() executeSQLQuery("CREATE TABLE IF NOT EXISTS Turf_System ( Turfs TEXT, GangOwner TEXT, r INT, g INT, b INT)") -- local check = executeSQLQuery("SELECT * FROM Turf_System" ) if #check == 0 then for i=1,#turfPos do executeSQLQuery("INSERT INTO Turf_System(Turfs,GangOwner,r,g,b) VALUES(?,?,?,?,?)", "Turf["..tostring(i).."]", "Nadie", 0, 255, 0) end elseif #check > 1 then for i = #check, #turfPos do executeSQLQuery("INSERT INTO Turf_System(Turfs,GangOwner,r,g,b) VALUES(?,?,?,?,?)", "Turf["..tostring(i).."]", "Nadie", 0, 255, 0) end end for i,v in ipairs(turfPos) do local sqlData = executeSQLQuery("SELECT * FROM Turf_System WHERE Turfs=?", "Turf["..tostring(i).."]") local turfCol = createColCuboid(unpack(v)) setElementData(turfCol, "getTurfGang", sqlData[1].GangOwner) local turfArea = createRadarArea(v[1], v[2], v[4], v[5], sqlData[1].r, sqlData[1].g, sqlData[1].b, 175) turfElement[turfCol] = {turfCol, turfArea, i} turfTimer[turfCol] = {} end outputDebugString( messages[1] ) end ) addEventHandler ( "onColShapeHit", root, function ( player ) if turfElement[source] and source == turfElement[source][1] then local turf,area,id = unpack( turfElement[source] ) local playerGang = getElementData ( player, "gang" ) local turfGang = executeSQLQuery("SELECT GangOwner FROM Turf_System WHERE Turfs=?", "Turf["..tostring(id).."]" ) if ( turfGang[1].GangOwner == playerGang ) then outputChatBox( messages[2]:format( turfGang[1].GangOwner or "None" ), player, 0, 255, 0, false ) else local playerGang = getElementData ( player, "gang" ) setElementData( source, "warTurf", playerGang ) if ( isTimer ( turfTimer[source][1] ) ) then if isTimer( turfTimer[source][2] ) then killTimer( turfTimer[source][2] ) end return end if ( playerGang ) then local r, g, b = unpack ( exports [ "gang_system" ]:getGangColor ( playerGang ) ) -- local r, g, b = 255, 255, 255 setRadarAreaFlashing ( area, true ) if turfGang[1].GangOwner ~= "Nadie" then outputChatBox( messages[3]:format( turfGang[1].GangOwner ), player, 0, 255, 0, false ) else outputChatBox( messages[4], player, 0, 255, 0, false ) end turfTimer[source][1] = setTimer ( function ( ) local players = getGangPlayersInTurf ( turf, playerGang ) setRadarAreaColor ( area, tonumber(r), tonumber(g), tonumber(b), 175 ) for _, player in ipairs ( players ) do outputChatBox( messages[5], player, 0, 255, 0, false ) triggerClientEvent(player, "onTakeTurf", player) givePlayerMoney ( player, 4000 ) executeSQLQuery("UPDATE Turf_System SET GangOwner=?,r=?,g=?,b=? WHERE Turfs=?", playerGang, tonumber(r), tonumber(g), tonumber(b), "Turf["..tostring(id).."]" ) -- setElementData ( turf, "getTurfGang", playerGang ) end setRadarAreaFlashing ( area, false ) end ,120000, 1) end end end end ) addEventHandler ( "onColShapeLeave", root, function( player ) if turfElement[source] and source == turfElement[source][1] then if isTimer( turfTimer[source][1] ) then local aGang = getElementData( source, "warTurf" ) local ps = getGangPlayersInTurf( source, aGang ) if #ps == 0 then outputChatBox( messages[6], player, 255, 0, 0 ) turfTimer[source][2] = setTimer( function(source, aGang) if isTimer(turfTimer[source][1]) then killTimer(turfTimer[source][1]) end setRadarAreaFlashing(turfElement[source][2], false) for _, v in ipairs( getElementsByType("player") ) do if getElementData(v, "gang") == aGang then outputChatBox(messages[7], v, 255, 0, 0) end end end , 20000, 1, source, aGang) end end end end ) function getGangPlayersInTurf( turf, gang ) -- element, string if turf and gang then local players = getElementsWithinColShape ( turf, "player" ) local gPla = {} for _, v in ipairs( players ) do if getElementData(v, "gang") == gang then table.insert(gPla, v) end end return gPla end end Link to comment
3NAD Posted October 21, 2015 Share Posted October 21, 2015 إستبدل بالإيفنت حق الكول شيب addEventHandler ( "onColShapeHit", root, function ( player ) if turfElement[source] and source == turfElement[source][1] then local turf,area,id = unpack( turfElement[source] ) local playerGang = getElementData ( player, "gang" ) local turfGang = executeSQLQuery("SELECT GangOwner FROM Turf_System WHERE Turfs=?", "Turf["..tostring(id).."]" ) if id == 2 then if playerGang ~= "Criminal" then outputChatBox ( "for 'Criminal Team' only", player, 255, 0, 0, true ) return false end end if ( turfGang[1].GangOwner == playerGang ) then outputChatBox( messages[2]:format( turfGang[1].GangOwner or "None" ), player, 0, 255, 0, false ) else local playerGang = getElementData ( player, "gang" ) setElementData( source, "warTurf", playerGang ) if ( isTimer ( turfTimer[source][1] ) ) then if isTimer( turfTimer[source][2] ) then killTimer( turfTimer[source][2] ) end return end if ( playerGang ) then local r, g, b = unpack ( exports [ "gang_system" ]:getGangColor ( playerGang ) ) -- local r, g, b = 255, 255, 255 setRadarAreaFlashing ( area, true ) if turfGang[1].GangOwner ~= "Nadie" then outputChatBox( messages[3]:format( turfGang[1].GangOwner ), player, 0, 255, 0, false ) else outputChatBox( messages[4], player, 0, 255, 0, false ) end turfTimer[source][1] = setTimer ( function ( ) local players = getGangPlayersInTurf ( turf, playerGang ) setRadarAreaColor ( area, tonumber(r), tonumber(g), tonumber(b), 175 ) for _, player in ipairs ( players ) do outputChatBox( messages[5], player, 0, 255, 0, false ) triggerClientEvent(player, "onTakeTurf", player) givePlayerMoney ( player, 4000 ) executeSQLQuery("UPDATE Turf_System SET GangOwner=?,r=?,g=?,b=? WHERE Turfs=?", playerGang, tonumber(r), tonumber(g), tonumber(b), "Turf["..tostring(id).."]" ) -- setElementData ( turf, "getTurfGang", playerGang ) end setRadarAreaFlashing ( area, false ) end ,120000, 1) end end end end ) التعديل من سطر 7 كيف تحدد الأرض ؟ من الآي دي اللي مسويه بالجدول حق احداثيات الأراضي Link to comment
ايهاب Posted October 21, 2015 Author Share Posted October 21, 2015 هذا مود احتلال صاحبة اجنبى بس شغال تمام التمام ومجانى .....الاراضى كانت كتير بس انا حذفت منها شوية اما وضعتلك الاكواد هنا لانها كانت طويلة وبردوة شكرا ليك كويس انك عملت الاشياء بنفسك ما اعطتنى الفكرة وقولتلى اتصرف انت مع نفسك لانى مكنتش هعرف شى اخير ينفع احدد تيم مايقدر يحتل الى معاة جروب ماثلا فى تيم اسمة ارمى بوظيفة تيمات ممكن اى اشخاص يعملوة جروب ويحتلوة بى التيم انا عايز اخلى التيم دة ميحتلش غير بأسم جروب واحد والشى التانى والمهم لو عايز اضيف اسم تيمات جمب بعض تبقى كدة عشان ما اتلغبط if playerGang ~= "Criminal and ARMY " then if playerGang ~= "Criminal " Army" then اعطينى مثال لى اضافة اسامى جروبات جمب بعض والاستفسار الاول ينفع يتعمل ولا لاء وما ابى شى تانى ولك الشكر على المساعدة Link to comment
3NAD Posted October 23, 2015 Share Posted October 23, 2015 كذا يكون اكثر من قروب if playerGang ~= "Criminal" and playerGang ~= "Army" then Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now