MR.StoRm Posted April 27, 2017 Share Posted April 27, 2017 1 minute ago, #!~Aln3mani~#! said: اوك بس وش الحل ابي حد يعرف ويساعدني لاهنتمم الدي بق وش يقول ؟ Link to comment
#!~Aln3mani~#! Posted April 27, 2017 Author Share Posted April 27, 2017 1 minute ago, MR.StoRm said: الدي بق وش يقول ؟ الدي بيق : ERROR: Loading script failed:mission\server.lua:3: Bad argument @‘createMarkerAttachedTo‘ [Expected element at argument 1,got boolean] Link to comment
MR.StoRm Posted April 27, 2017 Share Posted April 27, 2017 Just now, #!~Aln3mani~#! said: الدي بيق : ERROR: Loading script failed:mission\server.lua:3: Bad argument @‘createMarkerAttachedTo‘ [Expected element at argument 1,got boolean] ايكو قلك انسخ الوظيفة من جديد من الويكي !. Link to comment
#!~Aln3mani~#! Posted April 27, 2017 Author Share Posted April 27, 2017 @#_iMr.[E]coo @MR.StoRm فيه خطأ الدي بيق : ERROR: Loading script failed:mission\server.lua:7:‘<eof>‘ expected near ‘end‘ Link to comment
^iiEcoo'x_) Posted April 27, 2017 Share Posted April 27, 2017 Just now, #!~Aln3mani~#! said: @#_iMr.[E]coo @MR.StoRm فيه خطأ الدي بيق : ERROR: Loading script failed:mission\server.lua:7:‘<eof>‘ expected near ‘end‘ اطرح الكود من جديد Link to comment
#!~Aln3mani~#! Posted April 27, 2017 Author Share Posted April 27, 2017 function createMarkerAttachedTo(element, mType, size, r, g, b, a, visibleTo, xOffset, yOffset, zOffset) mType, size, r, g, b, a, visibleTo, xOffset, yOffset, zOffset = mType or "checkpoint", size or 4, r or 0, g or 0, b or 255, a or 255, visibleTo or getRootElement(), xOffset or 0, yOffset or 0, zOffset or 0 assert(isElement(element), "Bad argument @ 'createMarkerAttachedTo' [Expected element at argument 1, got " .. type(element) .. "]") assert(type(mType) == "string", "Bad argument @ 'createMarkerAttachedTo' [Expected string at argument 2, got " .. type(mType) .. "]") assert(type(size) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 3, got " .. type(size) .. "]") assert(type(r) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 4, got " .. type(r) .. "]") assert(type(g) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 5, got " .. type(g) .. "]") assert(type(b) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 6, got " .. type(b) .. "]") assert(type(a) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 7, got " .. type(a) .. "]") assert(isElement(visibleTo), "Bad argument @ 'createMarkerAttachedTo' [Expected element at argument 8, got " .. type(visibleTo) .. "]") assert(type(xOffset) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 9, got " .. type(xOffset) .. "]") assert(type(yOffset) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 10, got " .. type(yOffset) .. "]") assert(type(zOffset) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 11, got " .. type(zOffset) .. "]") local m = createMarker(0, 0, 0, mType, size, r, g, b, a, visibleTo) if m then if attachElements(m, element) then return m end end return false end end return false end local aMarker = createMarker ( 2073.20435,-3011.00293,5.00000 , "arrow" , 1.5 , 255 , 0 , 0 , 255 ) local aMarker2 = createMarker ( 2082.50610,-3010.59644,5.00000 , "arrow" , 1.5 , 0 , 0 , 255 , 255 ) local theObject = createObject ( 2091.38916,-3010.56616,5.00000 ) local aMar = createMarkerAttachedTo ( theObject ) local aMission = false function openMission ( ) aTimer = setTimer ( function () outputChatBox ( " * تم فتح المهمة " , root ) aMission = true end , 1000*60*4 , 1 ) -- كل 4 دقايق تفتح end openMission ( ) addEventHandler ( "onMarkerHit" , root , function ( aPlayer ) if getElementType ( aPlayer ) == "player" and not isPedInVehicle ( aPlayer ) then if aMission == false then return end if source == aMarker then outputChatBox ( " لقد دخلت الفريق الاحمر " , aPlayer ) setElementPosition ( aPlayer , 2101.37207,-3010.55127,5.00000 ) setElementFrozen ( aPlayer , true ) setElementData ( aPlayer , "MissionR" , true ) setTimer ( function () aMission = false for _ , plr in ipairs ( getElementsByType ( "player" ) ) do if getElementData ( plr , "MissionB" ) == true or getElementData ( plr , "MissionR" ) == true then setElementFrozen ( plr , false ) outputChatBox ( " بدات المهمة ، لا يمكن لاحد الدخول " , root ) end end end , 1000*60*1 , 1 ) elseif source == aMarker2 then outputChatBox ( " لقد دخلت الفريق الازرق " , aPlayer ) setElementPosition ( aPlayer , 2109.97852,-3010.54004,5.00000 ) setElementFrozen ( aPlayer , true ) setElementData ( aPlayer , "MissionB" , true ) setTimer ( function () aMission = false for _ , plr in ipairs ( getElementsByType ( "player" ) ) do if getElementData ( plr , "MissionB" ) == true or getElementData ( plr , "MissionR" ) == true then setElementFrozen ( plr , false ) outputChatBox ( " بدات المهمة ، لا يمكن لاحد الدخول " , root ) end end end , 1000*60*1 , 1 ) end end end ) function outall () for _ , plr in ipairs ( getElementsByType ( "player") ) do if getElementData ( plr , "MissionR" ) == true or getElementData ( plr , "MissionB" ) == true then setElementPosition ( plr , 2117.62280,-3010.53003,5.00000 ) end end end addEventHandler ( "onMarkerHit" , root , function ( aPlayer ) if getElementType ( aPlayer ) == "player" and not isPedInVehicle ( aPlayer ) then if source == aMar then if getElementData ( aPlayer , "MissionR" ) == true then for _ , plr in ipairs ( getElementsByType ( "player") ) do if getElementData ( plr , "MissionR" ) == true then givePlayerMoney ( plr , 5000 ) outputChatBox (" الفريق الاحمر فاز " , root ) outall () end end elseif getElementData ( aPlayer , "MissionB" ) == true then for _ , plr in ipairs ( getElementsByType ( "player") ) do if getElementData ( plr , "MissionR" ) == true then givePlayerMoney ( plr , 5000 ) outputChatBox (" الفريق الازرق فاز " , root ) outall () end end end end end end ) Just now, #_iMr.[E]coo said: اطرح الكود من جديد ذا هو Link to comment
MR.StoRm Posted April 27, 2017 Share Posted April 27, 2017 function createMarkerAttachedTo(element, mType, size, r, g, b, a, visibleTo, xOffset, yOffset, zOffset) mType, size, r, g, b, a, visibleTo, xOffset, yOffset, zOffset = mType or "checkpoint", size or 4, r or 0, g or 0, b or 255, a or 255, visibleTo or getRootElement(), xOffset or 0, yOffset or 0, zOffset or 0 assert(isElement(element), "Bad argument @ 'createMarkerAttachedTo' [Expected element at argument 1, got " .. type(element) .. "]") assert(type(mType) == "string", "Bad argument @ 'createMarkerAttachedTo' [Expected string at argument 2, got " .. type(mType) .. "]") assert(type(size) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 3, got " .. type(size) .. "]") assert(type(r) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 4, got " .. type(r) .. "]") assert(type(g) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 5, got " .. type(g) .. "]") assert(type(b) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 6, got " .. type(b) .. "]") assert(type(a) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 7, got " .. type(a) .. "]") assert(isElement(visibleTo), "Bad argument @ 'createMarkerAttachedTo' [Expected element at argument 8, got " .. type(visibleTo) .. "]") assert(type(xOffset) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 9, got " .. type(xOffset) .. "]") assert(type(yOffset) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 10, got " .. type(yOffset) .. "]") assert(type(zOffset) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 11, got " .. type(zOffset) .. "]") local m = createMarker(0, 0, 0, mType, size, r, g, b, a, visibleTo) if m then if attachElements(m, element) then return m end end return false end return false end local aMarker = createMarker ( 2073.20435,-3011.00293,5.00000 , "arrow" , 1.5 , 255 , 0 , 0 , 255 ) local aMarker2 = createMarker ( 2082.50610,-3010.59644,5.00000 , "arrow" , 1.5 , 0 , 0 , 255 , 255 ) local theObject = createObject ( 2091.38916,-3010.56616,5.00000 ) local aMar = createMarkerAttachedTo ( theObject ) local aMission = false function openMission ( ) aTimer = setTimer ( function () outputChatBox ( " * تم فتح المهمة " , root ) aMission = true end , 1000*60*4 , 1 ) -- كل 4 دقايق تفتح end openMission ( ) addEventHandler ( "onMarkerHit" , root , function ( aPlayer ) if getElementType ( aPlayer ) == "player" and not isPedInVehicle ( aPlayer ) then if aMission == false then return end if source == aMarker then outputChatBox ( " لقد دخلت الفريق الاحمر " , aPlayer ) setElementPosition ( aPlayer , 2101.37207,-3010.55127,5.00000 ) setElementFrozen ( aPlayer , true ) setElementData ( aPlayer , "MissionR" , true ) setTimer ( function () aMission = false for _ , plr in ipairs ( getElementsByType ( "player" ) ) do if getElementData ( plr , "MissionB" ) == true or getElementData ( plr , "MissionR" ) == true then setElementFrozen ( plr , false ) outputChatBox ( " بدات المهمة ، لا يمكن لاحد الدخول " , root ) end end end , 1000*60*1 , 1 ) elseif source == aMarker2 then outputChatBox ( " لقد دخلت الفريق الازرق " , aPlayer ) setElementPosition ( aPlayer , 2109.97852,-3010.54004,5.00000 ) setElementFrozen ( aPlayer , true ) setElementData ( aPlayer , "MissionB" , true ) setTimer ( function () aMission = false for _ , plr in ipairs ( getElementsByType ( "player" ) ) do if getElementData ( plr , "MissionB" ) == true or getElementData ( plr , "MissionR" ) == true then setElementFrozen ( plr , false ) outputChatBox ( " بدات المهمة ، لا يمكن لاحد الدخول " , root ) end end end , 1000*60*1 , 1 ) end end end ) function outall () for _ , plr in ipairs ( getElementsByType ( "player") ) do if getElementData ( plr , "MissionR" ) == true or getElementData ( plr , "MissionB" ) == true then setElementPosition ( plr , 2117.62280,-3010.53003,5.00000 ) end end end addEventHandler ( "onMarkerHit" , root , function ( aPlayer ) if getElementType ( aPlayer ) == "player" and not isPedInVehicle ( aPlayer ) then if source == aMar then if getElementData ( aPlayer , "MissionR" ) == true then for _ , plr in ipairs ( getElementsByType ( "player") ) do if getElementData ( plr , "MissionR" ) == true then givePlayerMoney ( plr , 5000 ) outputChatBox (" الفريق الاحمر فاز " , root ) outall () end end elseif getElementData ( aPlayer , "MissionB" ) == true then for _ , plr in ipairs ( getElementsByType ( "player") ) do if getElementData ( plr , "MissionR" ) == true then givePlayerMoney ( plr , 5000 ) outputChatBox (" الفريق الازرق فاز " , root ) outall () end end end end end end ) Link to comment
^iiEcoo'x_) Posted April 27, 2017 Share Posted April 27, 2017 function createMarkerAttachedTo(element, mType, size, r, g, b, a, visibleTo, xOffset, yOffset, zOffset) mType, size, r, g, b, a, visibleTo, xOffset, yOffset, zOffset = mType or "checkpoint", size or 4, r or 0, g or 0, b or 255, a or 255, visibleTo or getRootElement(), xOffset or 0, yOffset or 0, zOffset or 0 assert(isElement(element), "Bad argument @ 'createMarkerAttachedTo' [Expected element at argument 1, got " .. type(element) .. "]") assert(type(mType) == "string", "Bad argument @ 'createMarkerAttachedTo' [Expected string at argument 2, got " .. type(mType) .. "]") assert(type(size) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 3, got " .. type(size) .. "]") assert(type(r) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 4, got " .. type(r) .. "]") assert(type(g) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 5, got " .. type(g) .. "]") assert(type(b) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 6, got " .. type(b) .. "]") assert(type(a) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 7, got " .. type(a) .. "]") assert(isElement(visibleTo), "Bad argument @ 'createMarkerAttachedTo' [Expected element at argument 8, got " .. type(visibleTo) .. "]") assert(type(xOffset) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 9, got " .. type(xOffset) .. "]") assert(type(yOffset) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 10, got " .. type(yOffset) .. "]") assert(type(zOffset) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 11, got " .. type(zOffset) .. "]") local m = createMarker(0, 0, 0, mType, size, r, g, b, a, visibleTo) if m then if attachElements(m, element) then return m end end return false end local aMarker = createMarker ( 2073.20435,-3011.00293,5.00000 , "arrow" , 1.5 , 255 , 0 , 0 , 255 ) local aMarker2 = createMarker ( 2082.50610,-3010.59644,5.00000 , "arrow" , 1.5 , 0 , 0 , 255 , 255 ) local theObject = createObject ( 2091.38916,-3010.56616,5.00000 ) local aMar = createMarkerAttachedTo ( theObject ) local aMission = false function openMission ( ) aTimer = setTimer ( function () outputChatBox ( " * تم فتح المهمة " , root ) aMission = true end , 1000*60*4 , 1 ) -- كل 4 دقايق تفتح end openMission ( ) addEventHandler ( "onMarkerHit" , root , function ( aPlayer ) if getElementType ( aPlayer ) == "player" and not isPedInVehicle ( aPlayer ) then if aMission == false then return end if source == aMarker then outputChatBox ( " لقد دخلت الفريق الاحمر " , aPlayer ) setElementPosition ( aPlayer , 2101.37207,-3010.55127,5.00000 ) setElementFrozen ( aPlayer , true ) setElementData ( aPlayer , "MissionR" , true ) setTimer ( function () aMission = false for _ , plr in ipairs ( getElementsByType ( "player" ) ) do if getElementData ( plr , "MissionB" ) == true or getElementData ( plr , "MissionR" ) == true then setElementFrozen ( plr , false ) outputChatBox ( " بدات المهمة ، لا يمكن لاحد الدخول " , root ) end end end , 1000*60*1 , 1 ) elseif source == aMarker2 then outputChatBox ( " لقد دخلت الفريق الازرق " , aPlayer ) setElementPosition ( aPlayer , 2109.97852,-3010.54004,5.00000 ) setElementFrozen ( aPlayer , true ) setElementData ( aPlayer , "MissionB" , true ) setTimer ( function () aMission = false for _ , plr in ipairs ( getElementsByType ( "player" ) ) do if getElementData ( plr , "MissionB" ) == true or getElementData ( plr , "MissionR" ) == true then setElementFrozen ( plr , false ) outputChatBox ( " بدات المهمة ، لا يمكن لاحد الدخول " , root ) end end end , 1000*60*1 , 1 ) end end end ) function outall () for _ , plr in ipairs ( getElementsByType ( "player") ) do if getElementData ( plr , "MissionR" ) == true or getElementData ( plr , "MissionB" ) == true then setElementPosition ( plr , 2117.62280,-3010.53003,5.00000 ) end end end addEventHandler ( "onMarkerHit" , root , function ( aPlayer ) if getElementType ( aPlayer ) == "player" and not isPedInVehicle ( aPlayer ) then if source == aMar then if getElementData ( aPlayer , "MissionR" ) == true then for _ , plr in ipairs ( getElementsByType ( "player") ) do if getElementData ( plr , "MissionR" ) == true then givePlayerMoney ( plr , 5000 ) outputChatBox (" الفريق الاحمر فاز " , root ) outall () end end elseif getElementData ( aPlayer , "MissionB" ) == true then for _ , plr in ipairs ( getElementsByType ( "player") ) do if getElementData ( plr , "MissionR" ) == true then givePlayerMoney ( plr , 5000 ) outputChatBox (" الفريق الازرق فاز " , root ) outall () end end end end end end ) Link to comment
#BrosS Posted April 27, 2017 Share Posted April 27, 2017 1 minute ago, MR.StoRm said: function createMarkerAttachedTo(element, mType, size, r, g, b, a, visibleTo, xOffset, yOffset, zOffset) mType, size, r, g, b, a, visibleTo, xOffset, yOffset, zOffset = mType or "checkpoint", size or 4, r or 0, g or 0, b or 255, a or 255, visibleTo or getRootElement(), xOffset or 0, yOffset or 0, zOffset or 0 assert(isElement(element), "Bad argument @ 'createMarkerAttachedTo' [Expected element at argument 1, got " .. type(element) .. "]") assert(type(mType) == "string", "Bad argument @ 'createMarkerAttachedTo' [Expected string at argument 2, got " .. type(mType) .. "]") assert(type(size) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 3, got " .. type(size) .. "]") assert(type(r) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 4, got " .. type(r) .. "]") assert(type(g) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 5, got " .. type(g) .. "]") assert(type(b) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 6, got " .. type(b) .. "]") assert(type(a) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 7, got " .. type(a) .. "]") assert(isElement(visibleTo), "Bad argument @ 'createMarkerAttachedTo' [Expected element at argument 8, got " .. type(visibleTo) .. "]") assert(type(xOffset) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 9, got " .. type(xOffset) .. "]") assert(type(yOffset) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 10, got " .. type(yOffset) .. "]") assert(type(zOffset) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 11, got " .. type(zOffset) .. "]") local m = createMarker(0, 0, 0, mType, size, r, g, b, a, visibleTo) if m then if attachElements(m, element) then return m end end return false end return false end local aMarker = createMarker ( 2073.20435,-3011.00293,5.00000 , "arrow" , 1.5 , 255 , 0 , 0 , 255 ) local aMarker2 = createMarker ( 2082.50610,-3010.59644,5.00000 , "arrow" , 1.5 , 0 , 0 , 255 , 255 ) local theObject = createObject ( 2091.38916,-3010.56616,5.00000 ) local aMar = createMarkerAttachedTo ( theObject ) local aMission = false function openMission ( ) aTimer = setTimer ( function () outputChatBox ( " * تم فتح المهمة " , root ) aMission = true end , 1000*60*4 , 1 ) -- كل 4 دقايق تفتح end openMission ( ) addEventHandler ( "onMarkerHit" , root , function ( aPlayer ) if getElementType ( aPlayer ) == "player" and not isPedInVehicle ( aPlayer ) then if aMission == false then return end if source == aMarker then outputChatBox ( " لقد دخلت الفريق الاحمر " , aPlayer ) setElementPosition ( aPlayer , 2101.37207,-3010.55127,5.00000 ) setElementFrozen ( aPlayer , true ) setElementData ( aPlayer , "MissionR" , true ) setTimer ( function () aMission = false for _ , plr in ipairs ( getElementsByType ( "player" ) ) do if getElementData ( plr , "MissionB" ) == true or getElementData ( plr , "MissionR" ) == true then setElementFrozen ( plr , false ) outputChatBox ( " بدات المهمة ، لا يمكن لاحد الدخول " , root ) end end end , 1000*60*1 , 1 ) elseif source == aMarker2 then outputChatBox ( " لقد دخلت الفريق الازرق " , aPlayer ) setElementPosition ( aPlayer , 2109.97852,-3010.54004,5.00000 ) setElementFrozen ( aPlayer , true ) setElementData ( aPlayer , "MissionB" , true ) setTimer ( function () aMission = false for _ , plr in ipairs ( getElementsByType ( "player" ) ) do if getElementData ( plr , "MissionB" ) == true or getElementData ( plr , "MissionR" ) == true then setElementFrozen ( plr , false ) outputChatBox ( " بدات المهمة ، لا يمكن لاحد الدخول " , root ) end end end , 1000*60*1 , 1 ) end end end ) function outall () for _ , plr in ipairs ( getElementsByType ( "player") ) do if getElementData ( plr , "MissionR" ) == true or getElementData ( plr , "MissionB" ) == true then setElementPosition ( plr , 2117.62280,-3010.53003,5.00000 ) end end end addEventHandler ( "onMarkerHit" , root , function ( aPlayer ) if getElementType ( aPlayer ) == "player" and not isPedInVehicle ( aPlayer ) then if source == aMar then if getElementData ( aPlayer , "MissionR" ) == true then for _ , plr in ipairs ( getElementsByType ( "player") ) do if getElementData ( plr , "MissionR" ) == true then givePlayerMoney ( plr , 5000 ) outputChatBox (" الفريق الاحمر فاز " , root ) outall () end end elseif getElementData ( aPlayer , "MissionB" ) == true then for _ , plr in ipairs ( getElementsByType ( "player") ) do if getElementData ( plr , "MissionR" ) == true then givePlayerMoney ( plr , 5000 ) outputChatBox (" الفريق الازرق فاز " , root ) outall () end end end end end end ) ماسويت شي وفيه اند زيادة ورجوع القيمة أيضا Link to comment
#!~Aln3mani~#! Posted April 27, 2017 Author Share Posted April 27, 2017 (edited) @#_iMr.[E]coo انت اغلب الاخطاء تفتح قوس لاكن م تقفله مثل addEventHandler ( "onMarkerHit" , root , مب المفروض تقفل القوس هنا ؟؟ Edited April 27, 2017 by #!~Aln3mani~#! Link to comment
^iiEcoo'x_) Posted April 27, 2017 Share Posted April 27, 2017 1 minute ago, #!~Aln3mani~#! said: @#_iMr.[E]coo انت اغلب الاخطاء تفتح قوس لاكن م تقفله مثل addEventHandler ( "onMarkerHit" , root , مب المفروض تقفل القوس هنا ؟؟ لا , زبط الكود ؟ Link to comment
#!~Aln3mani~#! Posted April 27, 2017 Author Share Posted April 27, 2017 1 minute ago, #_iMr.[E]coo said: لا , زبط الكود ؟ لا نفس المشكله مشكلة الفانكشن Link to comment
MR.StoRm Posted April 27, 2017 Share Posted April 27, 2017 1 minute ago, #!~Aln3mani~#! said: لا نفس المشكله مشكلة الفانكشن كودك هريسة ~ من وين جايبه ؟ Link to comment
#!~Aln3mani~#! Posted April 27, 2017 Author Share Posted April 27, 2017 1 minute ago, MR.StoRm said: كودك هريسة ~ من وين جايبه ؟ من ايكو Link to comment
^iiEcoo'x_) Posted April 27, 2017 Share Posted April 27, 2017 11 minutes ago, #_iMr.[E]coo said: function createMarkerAttachedTo(element, mType, size, r, g, b, a, visibleTo, xOffset, yOffset, zOffset) mType, size, r, g, b, a, visibleTo, xOffset, yOffset, zOffset = mType or "checkpoint", size or 4, r or 0, g or 0, b or 255, a or 255, visibleTo or getRootElement(), xOffset or 0, yOffset or 0, zOffset or 0 assert(isElement(element), "Bad argument @ 'createMarkerAttachedTo' [Expected element at argument 1, got " .. type(element) .. "]") assert(type(mType) == "string", "Bad argument @ 'createMarkerAttachedTo' [Expected string at argument 2, got " .. type(mType) .. "]") assert(type(size) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 3, got " .. type(size) .. "]") assert(type(r) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 4, got " .. type(r) .. "]") assert(type(g) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 5, got " .. type(g) .. "]") assert(type(b) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 6, got " .. type(b) .. "]") assert(type(a) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 7, got " .. type(a) .. "]") assert(isElement(visibleTo), "Bad argument @ 'createMarkerAttachedTo' [Expected element at argument 8, got " .. type(visibleTo) .. "]") assert(type(xOffset) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 9, got " .. type(xOffset) .. "]") assert(type(yOffset) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 10, got " .. type(yOffset) .. "]") assert(type(zOffset) == "number", "Bad argument @ 'createMarkerAttachedTo' [Expected number at argument 11, got " .. type(zOffset) .. "]") local m = createMarker(0, 0, 0, mType, size, r, g, b, a, visibleTo) if m then if attachElements(m, element) then return m end end return falseendlocal aMarker = createMarker ( 2073.20435,-3011.00293,5.00000 , "arrow" , 1.5 , 255 , 0 , 0 , 255 )local aMarker2 = createMarker ( 2082.50610,-3010.59644,5.00000 , "arrow" , 1.5 , 0 , 0 , 255 , 255 )local theObject = createObject ( 2091.38916,-3010.56616,5.00000 )local aMar = createMarkerAttachedTo ( theObject ) local aMission = false function openMission ( )aTimer = setTimer ( function ()outputChatBox ( " * تم فتح المهمة " , root )aMission = true end , 1000*60*4 , 1 ) -- كل 4 دقايق تفتحend openMission ( )addEventHandler ( "onMarkerHit" , root ,function ( aPlayer )if getElementType ( aPlayer ) == "player" and not isPedInVehicle ( aPlayer ) then if aMission == false then return end if source == aMarker then outputChatBox ( " لقد دخلت الفريق الاحمر " , aPlayer )setElementPosition ( aPlayer , 2101.37207,-3010.55127,5.00000 )setElementFrozen ( aPlayer , true )setElementData ( aPlayer , "MissionR" , true )setTimer ( function ()aMission = false for _ , plr in ipairs ( getElementsByType ( "player" ) ) doif getElementData ( plr , "MissionB" ) == true or getElementData ( plr , "MissionR" ) == true thensetElementFrozen ( plr , false ) outputChatBox ( " بدات المهمة ، لا يمكن لاحد الدخول " , root ) end endend , 1000*60*1 , 1 )elseif source == aMarker2 then outputChatBox ( " لقد دخلت الفريق الازرق " , aPlayer )setElementPosition ( aPlayer , 2109.97852,-3010.54004,5.00000 ) setElementFrozen ( aPlayer , true )setElementData ( aPlayer , "MissionB" , true )setTimer ( function ()aMission = false for _ , plr in ipairs ( getElementsByType ( "player" ) ) doif getElementData ( plr , "MissionB" ) == true or getElementData ( plr , "MissionR" ) == true thensetElementFrozen ( plr , false ) outputChatBox ( " بدات المهمة ، لا يمكن لاحد الدخول " , root ) end endend , 1000*60*1 , 1 )endendend) function outall () for _ , plr in ipairs ( getElementsByType ( "player") ) doif getElementData ( plr , "MissionR" ) == true or getElementData ( plr , "MissionB" ) == true thensetElementPosition ( plr , 2117.62280,-3010.53003,5.00000 )end end endaddEventHandler ( "onMarkerHit" , root ,function ( aPlayer )if getElementType ( aPlayer ) == "player" and not isPedInVehicle ( aPlayer ) thenif source == aMar then if getElementData ( aPlayer , "MissionR" ) == true thenfor _ , plr in ipairs ( getElementsByType ( "player") ) doif getElementData ( plr , "MissionR" ) == true thengivePlayerMoney ( plr , 5000 )outputChatBox (" الفريق الاحمر فاز " , root )outall ()endendelseif getElementData ( aPlayer , "MissionB" ) == true then for _ , plr in ipairs ( getElementsByType ( "player") ) doif getElementData ( plr , "MissionR" ) == true thengivePlayerMoney ( plr , 5000 )outputChatBox (" الفريق الازرق فاز " , root )outall ()endendendendendend ) p. ستورم اذا الكود هريسة اشرحلي كل فنكشن شو يسوي بالتفصيل بالزبط 1 Link to comment
MR.StoRm Posted April 27, 2017 Share Posted April 27, 2017 14 minutes ago, #_iMr.[E]coo said: p. ستورم اذا الكود هريسة اشرحلي كل فنكشن شو يسوي بالتفصيل بالزبط انا أقصد اول كود وضعه في الموضوع ~# Link to comment
^iiEcoo'x_) Posted April 27, 2017 Share Posted April 27, 2017 1 minute ago, MR.StoRm said: انا أقصد اول كود وضعه في الموضوع ~# هو شبه هريسة لاني ما جربته وما عندي جهاز اجربه Link to comment
MR.StoRm Posted April 27, 2017 Share Posted April 27, 2017 Just now, #_iMr.[E]coo said: هو شبه هريسة لاني ما جربته وما عندي جهاز اجربه ليش انت عـ جوال ؟؟ Link to comment
^iiEcoo'x_) Posted April 27, 2017 Share Posted April 27, 2017 1 minute ago, MR.StoRm said: ليش انت عـ جوال ؟؟ اجل 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