#!~Aln3mani~#! 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 ( 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 ) و جزاكم الله الف خير Link to comment
Adham Posted April 27, 2017 Share Posted April 27, 2017 دي بق وش يقول ل الخطأ و ب اي سطر Link to comment
F_F 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 ( 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 end ) Link to comment
^iiEcoo'x_) Posted April 27, 2017 Share Posted April 27, 2017 @F_F , شخخبط شخابيط للخبطط لخببيط مختم اللغة Link to comment
#!~Aln3mani~#! Posted April 27, 2017 Author Share Posted April 27, 2017 فيه خطأ في سطر 33 الدي بيق : ERROR: Loading script failed:mission\server.lua:33:‘end‘ expected (to close ‘if‘ at line 32) near ‘outputChatBox‘ وش الحل 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 ( 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 aMission == false then return end if source == aMarker then 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 ) Link to comment
#!~Aln3mani~#! Posted April 27, 2017 Author Share Posted April 27, 2017 @#_iMr.[E]coo فيه خطأ في سطر 42 الدي بيق :ERROR: Loading script failed:mission\server.lua:42:‘)‘ expected near ‘then‘‘ 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 ( 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 aMission == false then return end if source == aMarker then 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 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 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 ) Link to comment
#!~Aln3mani~#! Posted April 27, 2017 Author Share Posted April 27, 2017 @#_iMr.[E]coo فيه خطأ في سطر 38 الدي بيق Loading script failed:mission\server.lua:38:‘)‘ expected near ‘then‘‘ ضض كل مره م يضبط مشكله Link to comment
Adham Posted April 27, 2017 Share Posted April 27, 2017 @#_iMr.[E]coo اعتقد ان ذا حطأ if getElementData ( plr , "MissionB" == true or getElementData ( plr , "MissionR" == true then بيكون كذا if getElementData ( plr , "MissionB" ) == true or getElementData ( plr , "MissionR" ) == true then Link to comment
#!~Aln3mani~#! Posted April 27, 2017 Author Share Posted April 27, 2017 @#_iMr.[E]coo @Deativated فيه خطأ في سطر 72 الدي بيق Loading script failed:mission\server.lua:72:‘then‘ expected near ‘if‘‘ Link to comment
Adham Posted April 27, 2017 Share Posted April 27, 2017 elseif getElementData ( plr , "MissionR" ) == true then -- Link to comment
#!~Aln3mani~#! Posted April 27, 2017 Author Share Posted April 27, 2017 @Deativated أغير كل السطر ؟ Link to comment
MR.StoRm Posted April 27, 2017 Share Posted April 27, 2017 4 minutes ago, Deativated said: elseif getElementData ( plr , "MissionR" ) == true then -- يقلك 72 مو 73 ! ~@Deativated 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 ( 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 aMission == false then return end if source == aMarker then 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 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 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 ) 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 ) 16 minutes ago, Deativated said: @#_iMr.[E]coo اعتقد ان ذا حطأ if getElementData ( plr , "MissionB" == true or getElementData ( plr , "MissionR" == true then بيكون كذا if getElementData ( plr , "MissionB" ) == true or getElementData ( plr , "MissionR" ) == true then ما في مشكلة دام اني مستعمل or Link to comment
#!~Aln3mani~#! Posted April 27, 2017 Author Share Posted April 27, 2017 @#_iMr.[E]coo فيه خطأ الدي بيق : ERROR: Loading script failed:mission\server.lua:93:‘end‘ expected (to close ‘function‘ at line 63) near ‘<eof>‘ 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 ( 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 aMission == false then return end if source == aMarker then 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 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 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 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 @#_iMr.[E]coo وش غيرت؟؟ Link to comment
#!~Aln3mani~#! Posted April 27, 2017 Author Share Posted April 27, 2017 @#_iMr.[E]coo فيه خطأ الدي بيق : ERROR: Loading script failed:mission\server.lua:3: Bad argument @‘createMarkerAttachedTo‘ [Expected element at argument 1,got boolean] Link to comment
^iiEcoo'x_) Posted April 27, 2017 Share Posted April 27, 2017 2 minutes ago, #!~Aln3mani~#! said: @#_iMr.[E]coo فيه خطأ الدي بيق : 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 Just now, #_iMr.[E]coo said: الوظيفة موجودة ف الويكي ، ناسخها خطا انا ! مدري عنك انا كذا مطلع لي ب الدي بق Link to comment
^iiEcoo'x_) Posted April 27, 2017 Share Posted April 27, 2017 https://wiki.multitheftauto.com/wiki/CreateMarkerAttachedTo الوظيفة هنا انسخها من جديد Link to comment
#!~Aln3mani~#! Posted April 27, 2017 Author Share Posted April 27, 2017 1 minute ago, #_iMr.[E]coo said: https://wiki.multitheftauto.com/wiki/CreateMarkerAttachedTo الوظيفة هنا انسخها من جديد اوك بس وش الحل ابي حد يعرف ويساعدني لاهنتمم 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