BeCooL Posted December 20, 2012 Share Posted December 20, 2012 السلام عليككم ورححمة لله شباب عندي مشككلة في هذا الكود ان اذا الاعب ركب يطلع له الماركر ولاكن بعد ماتختفي السيارة وطلعت ثانية اذ ركب ما يطلع الماركر اذا فيه خطأ صلحوه لاهنتم ca3 = { { 0, 0, 3 }, { 0, 0, 3 }, { 0, 0, 3 }, { 0, 0, 3 }, } marker = { { 102.0269241333, 54.090785980225, 0.44342550635338 }, { 11.605502128601, 58.490795135498, 1.6355142593384 }, } function CreatCarRandom () random = ca3[math.random(#ca3)] car = createVehicle(411, -0.77234786748886, 0.1968837082386, 3.1171875) blip1Car = createBlipAttachedTo(car, 53) outputChatBox("#B22222 automobile has been requsted and placed on your map , get it first !!", root, 255, 255, 255, true) end addEventHandler ( "onResourceStart", getRootElement(), CreatCarRandom ) addEventHandler("onPlayerVehicleEnter", root, function (vehicle) if (vehicle == car) and not Marker then random = marker[math.random(#marker)] Marker = createMarker(random[1], random[2], random[3], "cylinder", 5, 0, 0, 205, 170) blipCar2 = createBlipAttachedTo(Marker, 51) setElementVisibleTo(Marker, root, false) setElementVisibleTo(Marker, source, true) end end ) addEventHandler( "onMarkerHit", root, function (hitElement) if source == Marker then if isPedInVehicle ( hitElement ) then givePlayerMoney ( hitElement, math.random(50000,70000) ) triggerClientEvent(hitElement, "playSoundC", hitElement) destroyElement(car) destroyElement(Marker) destroyElement(blipCar2) destroyElement(blip1Car) CreatCarRandom () end end end ) addEventHandler("onPlayerVehicleExit", root, function (vehicle) if (vehicle == car) and not Marker then setElementVisibleTo(Marker, root, false) setElementVisibleTo(Marker, source, false) setElementVisibleTo(blipCar2, root, false) setElementVisibleTo(blipCar2, root, false) end end ) Link to comment
BeCooL Posted December 20, 2012 Author Share Posted December 20, 2012 السلام عليككم ورححمة لله شباب عندي مشككلة في هذا الكود ان اذا الاعب ركب يطلع له الماركر ولاكن بعد ماتختفي السيارة وطلعت ثانية اذ ركب ما يطلع الماركر اذا فيه خطأ صلحوه لاهنتم ca3 = { { 0, 0, 3 }, { 0, 0, 3 }, { 0, 0, 3 }, { 0, 0, 3 }, } marker = { { 102.0269241333, 54.090785980225, 0.44342550635338 }, { 11.605502128601, 58.490795135498, 1.6355142593384 }, } function CreatCarRandom () random = ca3[math.random(#ca3)] car = createVehicle(411, -0.77234786748886, 0.1968837082386, 3.1171875) blip1Car = createBlipAttachedTo(car, 53) outputChatBox("#B22222 automobile has been requsted and placed on your map , get it first !!", root, 255, 255, 255, true) end addEventHandler ( "onResourceStart", getRootElement(), CreatCarRandom ) addEventHandler("onPlayerVehicleEnter", root, function (vehicle) if (vehicle == car) and not Marker then random = marker[math.random(#marker)] Marker = createMarker(random[1], random[2], random[3], "cylinder", 5, 0, 0, 205, 170) blipCar2 = createBlipAttachedTo(Marker, 51) setElementVisibleTo(Marker, root, false) setElementVisibleTo(Marker, source, true) end end ) addEventHandler( "onMarkerHit", root, function (hitElement) if source == Marker then if isPedInVehicle ( hitElement ) then givePlayerMoney ( hitElement, math.random(50000,70000) ) triggerClientEvent(hitElement, "playSoundC", hitElement) destroyElement(car) destroyElement(Marker) destroyElement(blipCar2) destroyElement(blip1Car) CreatCarRandom () end end end ) addEventHandler("onPlayerVehicleExit", root, function (vehicle) if (vehicle == car) and not Marker then setElementVisibleTo(Marker, root, false) setElementVisibleTo(Marker, source, false) setElementVisibleTo(blipCar2, root, false) setElementVisibleTo(blipCar2, root, false) end end ) Link to comment
AhmadQTR Posted December 20, 2012 Share Posted December 20, 2012 setElementVisibleTo(marker, root, false) setElementVisibleTo(marker, source, true) سطر 29 و 30 Link to comment
./BlackBird# Posted December 20, 2012 Share Posted December 20, 2012 setElementVisibleTo(marker, root, false) setElementVisibleTo(marker, source, true) سطر 29 و 30 خطا لو تدقق عدل راح تفهم Link to comment
BeCooL Posted December 20, 2012 Author Share Posted December 20, 2012 setElementVisibleTo(marker, root, false) setElementVisibleTo(marker, source, true) سطر 29 و 30 خطا لو تدقق عدل راح تفهم +1 Link to comment
BeCooL Posted December 20, 2012 Author Share Posted December 20, 2012 صعب ؟؟ i think so -1 Link to comment
AhmadQTR Posted December 20, 2012 Share Posted December 20, 2012 اي شي في debugscript 3? Link to comment
BeCooL Posted December 20, 2012 Author Share Posted December 20, 2012 وضح انت جربة اول سيارة الوضايف تممام بس الثانية تخرب مدري ليه !! Link to comment
./BlackBird# Posted December 20, 2012 Share Posted December 20, 2012 ca3 = { { 0, 0, 3 }, { 0, 0, 3 }, { 0, 0, 3 }, { 0, 0, 3 }, } marker = { { 102.0269241333, 54.090785980225, 0.44342550635338 }, { 11.605502128601, 58.490795135498, 1.6355142593384 }, } function CreatCarRandom () if isElement(car) or isElement(Marker) or isElement(blipCar2) or isElement(blip1Car) then return end random = ca3[math.random(#ca3)] car = createVehicle(411, -0.77234786748886, 0.1968837082386, 3.1171875) blip1Car = createBlipAttachedTo(car, 53) outputChatBox("#B22222 automobile has been requsted and placed on your map , get it first !!", root, 255, 255, 255, true) end addEventHandler ( "onResourceStart", getRootElement(), CreatCarRandom ) addEventHandler("onPlayerVehicleEnter", root, function (vehicle) if (vehicle == car) and not Marker then random = marker[math.random(#marker)] Marker = createMarker(random[1], random[2], random[3], "cylinder", 5, 0, 0, 205, 170) blipCar2 = createBlipAttachedTo(Marker, 51) setElementVisibleTo(Marker, root, false) setElementVisibleTo(Marker, source, true) end end ) addEventHandler( "onMarkerHit", root, function (hitElement) if source == Marker then if isPedInVehicle ( hitElement ) then givePlayerMoney ( hitElement, math.random(50000,70000) ) triggerClientEvent(hitElement, "playSoundC", hitElement) destroyElement(car) destroyElement(Marker) destroyElement(blipCar2) destroyElement(blip1Car) CreatCarRandom () end end end ) addEventHandler("onPlayerVehicleExit", root, function (vehicle) if (vehicle == car) and not Marker then setElementVisibleTo(Marker, root, false) setElementVisibleTo(Marker, source, false) setElementVisibleTo(blipCar2, root, false) setElementVisibleTo(blipCar2, root, false) end end ) Link to comment
Tete omar Posted December 20, 2012 Share Posted December 20, 2012 جرب local ca3 = { { 0, 0, 3 }, { 0, 0, 3 }, { 0, 0, 3 }, { 0, 0, 3 } } local marker = { { 102.0269241333, 54.090785980225, 0.44342550635338 }, { 11.605502128601, 58.490795135498, 1.6355142593384 } } local vehicle = {} local blip = {} local rand = {} local Markers = {} function CreatCarRandom () rand.random = ca3[math.random(#ca3)] vehicle.car = createVehicle(411, -0.77234786748886, 0.1968837082386, 3.1171875) blip.blip1Car = createBlipAttachedTo(car, 53) outputChatBox("#B22222 automobile has been requsted and placed on your map , get it first !!", root, 255, 255, 255, true) end addEventHandler("onResourceStart", root, CreatCarRandom) addEventHandler("onPlayerVehicleEnter", root, function(vehicle) if(isElement(vehicle.car))then if (vehicle == vehicle.car) then local x,y,z = unpack(marker[math.random(#marker)]) Markers.Marker = createMarker(x, y, z, "cylinder", 5, 0, 0, 205, 170) blip.blipCar2 = createBlipAttachedTo(Marker, 51) setElementVisibleTo(Markers.Marker, root, false) setElementVisibleTo(Markers.Marker, source, true) end end end ) addEventHandler( "onMarkerHit", root, function(hitElement) if ( getElementType( hitElement ) == "player" ) then if( isPedInVehicle( hitElement ) )then givePlayerMoney ( hitElement, math.random(50000,70000) ) triggerClientEvent(hitElement, "playSoundC", hitElement) for i,v in pairs(vehicle) do destroyElement(v) end for i,v in pairs(Markers) do destroyElement(v) end for i,v in pairs(blip) do destroyElement(v) end CreatCarRandom () end end end ) addEventHandler("onPlayerVehicleExit", root, function(vehicle) if( isElement( vehicle.car ) )then if( vehicle == vehicle.car )then for i,v in pairs(vehicle) do destroyElement(v) end for i,v in pairs(Markers) do destroyElement(v) end for i,v in pairs(blip) do destroyElement(v) end end end end ) Link to comment
BeCooL Posted December 20, 2012 Author Share Posted December 20, 2012 جرب local ca3 = { { 0, 0, 3 }, { 0, 0, 3 }, { 0, 0, 3 }, { 0, 0, 3 } } local marker = { { 102.0269241333, 54.090785980225, 0.44342550635338 }, { 11.605502128601, 58.490795135498, 1.6355142593384 } } local vehicle = {} local blip = {} local rand = {} local Markers = {} function CreatCarRandom () rand.random = ca3[math.random(#ca3)] vehicle.car = createVehicle(411, -0.77234786748886, 0.1968837082386, 3.1171875) blip.blip1Car = createBlipAttachedTo(car, 53) outputChatBox("#B22222 automobile has been requsted and placed on your map , get it first !!", root, 255, 255, 255, true) end addEventHandler("onResourceStart", root, CreatCarRandom) addEventHandler("onPlayerVehicleEnter", root, function(vehicle) if(isElement(vehicle.car))then if (vehicle == vehicle.car) then local x,y,z = unpack(marker[math.random(#marker)]) Markers.Marker = createMarker(x, y, z, "cylinder", 5, 0, 0, 205, 170) blip.blipCar2 = createBlipAttachedTo(Marker, 51) setElementVisibleTo(Markers.Marker, root, false) setElementVisibleTo(Markers.Marker, source, true) end end end ) addEventHandler( "onMarkerHit", root, function(hitElement) if ( getElementType( hitElement ) == "player" ) then if( isPedInVehicle( hitElement ) )then givePlayerMoney ( hitElement, math.random(50000,70000) ) triggerClientEvent(hitElement, "playSoundC", hitElement) for i,v in pairs(vehicle) do destroyElement(v) end for i,v in pairs(Markers) do destroyElement(v) end for i,v in pairs(blip) do destroyElement(v) end CreatCarRandom () end end end ) addEventHandler("onPlayerVehicleExit", root, function(vehicle) if( isElement( vehicle.car ) )then if( vehicle == vehicle.car )then for i,v in pairs(vehicle) do destroyElement(v) end for i,v in pairs(Markers) do destroyElement(v) end for i,v in pairs(blip) do destroyElement(v) end end end end ) صار الماركر مايطلع اصلا ! Link to comment
Tete omar Posted December 20, 2012 Share Posted December 20, 2012 اكتب باف 8 debugscript 3 بعدين عيد تشغيل السكربت Link to comment
BeCooL Posted December 20, 2012 Author Share Posted December 20, 2012 اكتب باف 8debugscript 3 بعدين عيد تشغيل السكربت WARNING: hijack\server.lua:16: Bad argument @ 'createBlipAttachedTo' [2001-02-15 18:51:06] hijack restarted successfully [2001-02-15 18:51:11] ERROR: hijack\server.lua:23: attempt to index local 'vehicle' (a userdata value) Link to comment
Tete omar Posted December 20, 2012 Share Posted December 20, 2012 local ca3 = { { 0, 0, 3 }, { 0, 0, 3 }, { 0, 0, 3 }, { 0, 0, 3 } } local marker = { { 102.0269241333, 54.090785980225, 0.44342550635338 }, { 11.605502128601, 58.490795135498, 1.6355142593384 } } local vehicle_ = {} local blip = {} local rand = {} local Markers = {} function CreatCarRandom () rand.random = ca3[math.random(#ca3)] vehicle_.car = createVehicle(411, -0.77234786748886, 0.1968837082386, 3.1171875) blip.blip1Car = createBlipAttachedTo(vehicle_.car, 53) outputChatBox("#B22222 automobile has been requsted and placed on your map , get it first !!", root, 255, 255, 255, true) end addEventHandler("onResourceStart", root, CreatCarRandom) addEventHandler("onPlayerVehicleEnter", root, function(vehicle) if(isElement(vehicle_.car))then if (vehicle == vehicle_.car) then local x,y,z = unpack(marker[math.random(#marker)]) Markers.Marker = createMarker(x, y, z, "cylinder", 5, 0, 0, 205, 170) blip.blipCar2 = createBlipAttachedTo(Markers.Marker, 51) setElementVisibleTo(Markers.Marker, root, false) setElementVisibleTo(Markers.Marker, source, true) end end end ) addEventHandler( "onMarkerHit", root, function(hitElement) if ( getElementType( hitElement ) == "player" ) then if( isPedInVehicle( hitElement ) )then givePlayerMoney ( hitElement, math.random(50000,70000) ) triggerClientEvent(hitElement, "playSoundC", hitElement) for i,v in pairs(vehicle_) do destroyElement(v) end for i,v in pairs(Markers) do destroyElement(v) end for i,v in pairs(blip) do destroyElement(v) end CreatCarRandom () end end end ) addEventHandler("onPlayerVehicleExit", root, function(vehicle) if( isElement( vehicle_.car ) )then if( vehicle == vehicle_.car )then for i,v in pairs(vehicle_) do destroyElement(v) end for i,v in pairs(Markers) do destroyElement(v) end for i,v in pairs(blip) do destroyElement(v) end end end end ) Link to comment
BeCooL Posted December 22, 2012 Author Share Posted December 22, 2012 local ca3 = { { 0, 0, 3 }, { 0, 0, 3 }, { 0, 0, 3 }, { 0, 0, 3 } } local marker = { { 102.0269241333, 54.090785980225, 0.44342550635338 }, { 11.605502128601, 58.490795135498, 1.6355142593384 } } local vehicle_ = {} local blip = {} local rand = {} local Markers = {} function CreatCarRandom () rand.random = ca3[math.random(#ca3)] vehicle_.car = createVehicle(411, -0.77234786748886, 0.1968837082386, 3.1171875) blip.blip1Car = createBlipAttachedTo(vehicle_.car, 53) outputChatBox("#B22222 automobile has been requsted and placed on your map , get it first !!", root, 255, 255, 255, true) end addEventHandler("onResourceStart", root, CreatCarRandom) addEventHandler("onPlayerVehicleEnter", root, function(vehicle) if(isElement(vehicle_.car))then if (vehicle == vehicle_.car) then local x,y,z = unpack(marker[math.random(#marker)]) Markers.Marker = createMarker(x, y, z, "cylinder", 5, 0, 0, 205, 170) blip.blipCar2 = createBlipAttachedTo(Markers.Marker, 51) setElementVisibleTo(Markers.Marker, root, false) setElementVisibleTo(Markers.Marker, source, true) end end end ) addEventHandler( "onMarkerHit", root, function(hitElement) if ( getElementType( hitElement ) == "player" ) then if( isPedInVehicle( hitElement ) )then givePlayerMoney ( hitElement, math.random(50000,70000) ) triggerClientEvent(hitElement, "playSoundC", hitElement) for i,v in pairs(vehicle_) do destroyElement(v) end for i,v in pairs(Markers) do destroyElement(v) end for i,v in pairs(blip) do destroyElement(v) end CreatCarRandom () end end end ) addEventHandler("onPlayerVehicleExit", root, function(vehicle) if( isElement( vehicle_.car ) )then if( vehicle == vehicle_.car )then for i,v in pairs(vehicle_) do destroyElement(v) end for i,v in pairs(Markers) do destroyElement(v) end for i,v in pairs(blip) do destroyElement(v) end end end end ) مشكؤؤر ي بعد تسبدي بس ابغى افهم ليه سويت ككذا وش الخطأ في الكود حقي وآسف عالاطاله Link to comment
Tete omar Posted December 23, 2012 Share Posted December 23, 2012 العفو الخطاء كان هنا random = marker[math.random(#marker)] المفروض يكون local x,y,z = unpack(marker[math.random(#marker)]) ثانياً انا سويتلك كل شي يجي احطه بجدول عشان اقدر اجيب كل الاشياء اللي بالجداول ونمسحهم كلهم مرة وحدة Link to comment
abu5lf Posted December 23, 2012 Share Posted December 23, 2012 Tete omar كودك فيه خلل Link to comment
Tete omar Posted December 23, 2012 Share Posted December 23, 2012 انا راجعت الكود بس ماكتشفت خلل :\ ممكن تحددلي الخلل او السطر الي يوجد به الخلل ؟ Link to comment
abu5lf Posted December 24, 2012 Share Posted December 24, 2012 اول شيء السطر 14 انت ماستفدت منه (: كآتبه بالطريقة خطأ اذا كان هو عشان احداثيات عشوائية للسيارة . السطر 19 الحدث onResourceStart أنت حآط root أي مود يشتغل رآح تتنفذ الوظيفة CreatCarRandom . السطر 35 كذلك الحال أنت حاط في الحدث root أي ماركر تخشه ومعك سيارة يجيك فلوس وتتنفذ الوظيفة CreatCarRandom ( حتى لو الماركر خارج المود ) . الحل في السطر 14 تحطه كذا local x, y, z = unpack( ca3[ math.random(#ca3) ] ) vehicle_.car = createVehicle( 411, x, y, z ) والحل في السطر 19 تحط بدال root هذي resourceRoot . والسطر الـ 35 نفس الشيء تحط بدال root هذي resourceRoot بشرط أن مايكون فيه ماركر غير الي في المهمة اذا كان فيه يجب تسوي شرط جديد عشان تحقق اذا كان .الماركر هو الي موجود في المهمة Link to comment
Tete omar Posted December 24, 2012 Share Posted December 24, 2012 اول شيء السطر 14 انت ماستفدت منه (: كآتبه بالطريقة خطأ اذا كان هو عشان احداثيات عشوائية للسيارة .السطر 19 الحدث onResourceStart أنت حآط root أي مود يشتغل رآح تتنفذ الوظيفة CreatCarRandom . السطر 35 كذلك الحال أنت حاط في الحدث root أي ماركر تخشه ومعك سيارة يجيك فلوس وتتنفذ الوظيفة CreatCarRandom ( حتى لو الماركر خارج المود ) . الحل في السطر 14 تحطه كذا local x, y, z = unpack( ca3[ math.random(#ca3) ] ) vehicle_.car = createVehicle( 411, x, y, z ) والحل في السطر 19 تحط بدال root هذي resourceRoot . والسطر الـ 35 نفس الشيء تحط بدال root هذي resourceRoot بشرط أن مايكون فيه ماركر غير الي في المهمة اذا كان فيه يجب تسوي شرط جديد عشان تحقق اذا كان .الماركر هو الي موجود في المهمة كلام سليم , ومشكور على الانتباه (: Link to comment
abu5lf Posted December 24, 2012 Share Posted December 24, 2012 كلام سليم , ومشكور على الانتباه (: العفو ؛ هذا واجبي مساعدة المبتدئين Link to comment
Tete omar Posted December 24, 2012 Share Posted December 24, 2012 العفو ؛ هذا واجبي مساعدة المبتدئين هه طيب يالخبير انت يالخبير p.s. تراها كانت تصريفة مافهمت شي من الكلام اللي تقوله عشان الكلمات الانجليزي ما تضبط مع العربي ثانياً الرجال عطاني الكود عدلت له بعض الاشياء وماركزت في اشياء .. 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