Search the Community
Showing results for tags 'تعديل ^'.
-
السلام عليكم ورحمة الله عيالل انا معي كود حق المهمة وفيه اخطااء اتمنى اي حد يساعدني 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 ( 2054.27881,-2957.76709,251.00000 , "arrow" , 1.5 , 255 , 0 , 0 , 255 ) local aMarker2 = createMarker ( 2053.31323,-2952.16064,251.00000 , "arrow" , 1.5 , 0 , 0 , 255 , 255 ) local theObject = createObject ( 1210, 2072.70679,-2981.19604, 251.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 source == aMarker then if aMission == false then return outputChatBox ( " المهمة مغلقة " , aPlayer ) outputChatBox ( " لقد دخلت الفريق الاحمر " , aPlayer ) setElementPosition ( aPlayer , 2036.51465,-2967.23779,251.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 , 1000*60*1 , 1 ) elseif source == aMarker2 then outputChatBox ( " لقد دخلت الفريق الازرق " , aPlayer ) setElementPosition ( aPlayer , 2035.37842,-2959.64185,251.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 , 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 , 2015.84912,-2975.09717,251.00000 ) end end addEventHandler ( "onMarkerHit" , root , function ( aPlayer ) if getElementType ( aPlayer ) == "player" and not isPedInVehicle ( aPlayer ) 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 ) و جزاكم الله الف خير