MR.GRAND Posted January 23, 2016 Share Posted January 23, 2016 سلآلآلآم كيفكم ي عيال عساكم طيبين المهم انا مسوي مهمة بيع المخدرات طيب الحين وش التفاصيل انك تروح مكان فيه ماركر توقف على الماركر تفتح لك لوحة تشتري منها مخدرات وتبيعهم طيب للحين كل شي تمام الحين كوماند عمل الماركر هوو بيع ... طيب ؟ يوم يجي لآعب ثاني يروح يشتري مخدرات ويبي يكتب نفس الكوماند بيع ... رح يسوي ماركر ثاني المفروض كذا وكل لآعب ماركر خاص فيه يقدر يجي اي لاعب ثاني عليه عشان يفتح له لوحة ويشتري منها اللي يبيه .. بس المشكلة انو لو احد كتب بيع وعمل له ماركر خاص فيه حتى يبيع منه وجاء واحد ثاني كتب بيع رح تصير معارضة بين الماركرات ... مثلآ يكتب الغاء يروح ماركر الاعب والماركر حق الاعب الثاني في طريقة لحل المشكلة ؟؟؟ Link to comment
#DRAGON!FIRE Posted January 23, 2016 Share Posted January 23, 2016 وعليكم السلام المشكلة ي عزيزي انكـ تحتاج تسوي تيبل .. لذلك حط صناعة الماركر بـ جانب سيرفر markers = { } markers [ player ] = createMarker ( ... ) Link to comment
MR.GRAND Posted January 23, 2016 Author Share Posted January 23, 2016 وعليكم السلامالمشكلة ي عزيزي انكـ تحتاج تسوي تيبل .. لذلك حط صناعة الماركر بـ جانب سيرفر markers = { } markers [ player ] = createMarker ( ... ) ممكن توضيح أكثر عن player ? Link to comment
#DRAGON!FIRE Posted January 23, 2016 Share Posted January 23, 2016 البلير مجرد مثال هنا .. لكن ع حسب كودكـ تحطه مثلأ : local markers = { } addCommandHandler ( "sell", function ( player ) markers [ player ] = createMarker ( ... ) end ) بـ هذي الحالة انت ربط الماركر بـ اللاعب يعني راح تنحل المشكلة هذي . Link to comment
MR.GRAND Posted January 23, 2016 Author Share Posted January 23, 2016 البلير مجرد مثال هنا .. لكن ع حسب كودكـ تحطه مثلأ : local markers = { } addCommandHandler ( "sell", function ( player ) markers [ player ] = createMarker ( ... ) end ) بـ هذي الحالة انت ربط الماركر بـ اللاعب يعني راح تنحل المشكلة هذي . وبالنسبة لأحداثيات الاعب ابي اجيب احداثياته داخل حدث عمل الماركر + داخل لوب الاعبين ابي اجيب اللي عمل ألكوماند : بيع من الكلنت Link to comment
MR.GRAND Posted January 23, 2016 Author Share Posted January 23, 2016 addEvent('makeSellMarker', true) addEventHandler('makeSellMarker', root, function(player) for i,playersLoop in ipairs(getElementsByType ( "player" )) do local name = getPlayerFromName(getPlayerName(source)) triggerClientEvent( 'setData', playersLoop ) local playerX, playerY, playerZ = getElementPosition( name ) if isElement(sell_markers[ player ]) then destroyElement(sell_markers[ player ]) sell_markers[ player ] = createMarker(playerX, playerY + 1, playerZ - 1, "Cylinder", 1.1, 255,255,255,255) else sell_markers[ player ] = createMarker(playerX, playerY + 1, playerZ - 1, "Cylinder", 1.1, 255,255,255,255) end end end ) الماركر مايطلع Link to comment
Jupi Posted January 23, 2016 Share Posted January 23, 2016 addEvent('makeSellMarker', true) addEventHandler('makeSellMarker', root, function(player) for i,playersLoop in ipairs(getElementsByType ( "player" )) do local name = getPlayerFromName(getPlayerName(source)) triggerClientEvent( 'setData', playersLoop ) local playerX, playerY, playerZ = getElementPosition( name ) if isElement(sell_markers[ player ]) then destroyElement(sell_markers[ player ]) sell_markers[ player ] = createMarker(playerX, playerY + 1, playerZ - 1, "Cylinder", 1.1, 255,255,255,255) else sell_markers[ player ] = createMarker(playerX, playerY + 1, playerZ - 1, "Cylinder", 1.1, 255,255,255,255) end end end ) الماركر مايطلع player حط مكانه source و جرب Link to comment
MR.GRAND Posted January 23, 2016 Author Share Posted January 23, 2016 addEvent('makeSellMarker', true) addEventHandler('makeSellMarker', root, function(player) for i,playersLoop in ipairs(getElementsByType ( "player" )) do local name = getPlayerFromName(getPlayerName(source)) triggerClientEvent( 'setData', playersLoop ) local playerX, playerY, playerZ = getElementPosition( name ) if isElement(sell_markers[ player ]) then destroyElement(sell_markers[ player ]) sell_markers[ player ] = createMarker(playerX, playerY + 1, playerZ - 1, "Cylinder", 1.1, 255,255,255,255) else sell_markers[ player ] = createMarker(playerX, playerY + 1, playerZ - 1, "Cylinder", 1.1, 255,255,255,255) end end end ) الماركر مايطلع player حط مكانه source و جرب got boolean argumnt 1 Link to comment
Jupi Posted January 23, 2016 Share Posted January 23, 2016 addEvent('makeSellMarker', true) addEventHandler('makeSellMarker', root, function(player) for i,playersLoop in ipairs(getElementsByType ( "player" )) do local name = getPlayerFromName(getPlayerName(source)) triggerClientEvent( 'setData', playersLoop ) local playerX, playerY, playerZ = getElementPosition( name ) if isElement(sell_markers[ player ]) then destroyElement(sell_markers[ player ]) sell_markers[ player ] = createMarker(playerX, playerY + 1, playerZ - 1, "Cylinder", 1.1, 255,255,255,255) else sell_markers[ player ] = createMarker(playerX, playerY + 1, playerZ - 1, "Cylinder", 1.1, 255,255,255,255) end end end ) الماركر مايطلع player حط مكانه source و جرب got boolean argumnt 1 اي سطر =_= وليه مسوي لوب؟ الماركر بيظهر للكل علي اي حال Link to comment
MR.GRAND Posted January 23, 2016 Author Share Posted January 23, 2016 addEvent('makeSellMarker', true) addEventHandler('makeSellMarker', root, function(player) local name = getPlayerFromName(getPlayerName(source)) local playerX = getElementData(name, "pX") local playerY = getElementData(name, "pY") local playerZ = getElementData(name, "pZ") if isElement(sell_markers[ player ]) then destroyElement(sell_markers[ player ]) sell_markers[ player ] = createMarker(tonumber(playerX), tonumber(playerY) + 1, tonumber(playerZ) - 1, "Cylinder", 1.1, 255,255,255,255) else sell_markers[ player ] = createMarker(tonumber(playerX), tonumber(playerY) + 1, tonumber(playerZ) - 1, "Cylinder", 1.1, 255,255,255,255) for i, v in ipairs(getElementsByType("player")) do triggerClientEvent( 'setData', v ) end end end ) صار كذا لآكن يجي في سطر الماركر بالديبوق خلل Table index is nil Link to comment
Abdul KariM Posted January 23, 2016 Share Posted January 23, 2016 addEvent('makeSellMarker', true) addEventHandler('makeSellMarker', root, function(player) local name = getPlayerFromName(getPlayerName(source)) local playerX = getElementData(name, "pX") local playerY = getElementData(name, "pY") local playerZ = getElementData(name, "pZ") if isElement(sell_markers[ player ]) then destroyElement(sell_markers[ player ]) sell_markers[ player ] = createMarker(tonumber(playerX), tonumber(playerY) + 1, tonumber(playerZ) - 1, "Cylinder", 1.1, 255,255,255,255) else sell_markers[ player ] = createMarker(tonumber(playerX), tonumber(playerY) + 1, tonumber(playerZ) - 1, "Cylinder", 1.1, 255,255,255,255) for i, v in ipairs(getElementsByType("player")) do triggerClientEvent( 'setData', v ) end end end ) صار كذا لآكن يجي في سطر الماركر بالديبوق خلل Table index is nil نسيت التيبل sell_markers {} ; Link to comment
MR.GRAND Posted January 24, 2016 Author Share Posted January 24, 2016 addEvent('makeSellMarker', true) addEventHandler('makeSellMarker', root, function(player) local name = getPlayerFromName(getPlayerName(source)) local playerX = getElementData(name, "pX") local playerY = getElementData(name, "pY") local playerZ = getElementData(name, "pZ") if isElement(sell_markers[ player ]) then destroyElement(sell_markers[ player ]) sell_markers[ player ] = createMarker(tonumber(playerX), tonumber(playerY) + 1, tonumber(playerZ) - 1, "Cylinder", 1.1, 255,255,255,255) else sell_markers[ player ] = createMarker(tonumber(playerX), tonumber(playerY) + 1, tonumber(playerZ) - 1, "Cylinder", 1.1, 255,255,255,255) for i, v in ipairs(getElementsByType("player")) do triggerClientEvent( 'setData', v ) end end end ) صار كذا لآكن يجي في سطر الماركر بالديبوق خلل Table index is nil نسيت التيبل sell_markers {} ; مسويه :\ sell_markers {} ; يجي nil value فــ سويته كذا : sell_markers = {} مايطلع الماركر Link to comment
Abdul KariM Posted January 24, 2016 Share Posted January 24, 2016 ^ addEvent('makeSellMarker', true) addEventHandler('makeSellMarker', root, function(player) local name = getPlayerFromName(getPlayerName(player)) local playerX = getElementData(name, "pX") local playerY = getElementData(name, "pY") local playerZ = getElementData(name, "pZ") if isElement(sell_markers[ player ]) then destroyElement(sell_markers[ player ]) end sell_markers[ player ] = createMarker(tonumber(playerX), tonumber(playerY) + 1, tonumber(playerZ) - 1, "Cylinder", 1.1, 255,255,255,255) else sell_markers[ player ] = createMarker(tonumber(playerX), tonumber(playerY) + 1, tonumber(playerZ) - 1, "Cylinder", 1.1, 255,255,255,255) for i, v in ipairs(getElementsByType("player")) do triggerClientEvent( 'setData', v ) end end ) وقلي وش يطلع لك بالدي بوق وباي سطر والتيبل خله كذا sell_markers = { } Link to comment
MR.GRAND Posted January 24, 2016 Author Share Posted January 24, 2016 ^ addEvent('makeSellMarker', true) addEventHandler('makeSellMarker', root, function(player) local name = getPlayerFromName(getPlayerName(player)) local playerX = getElementData(name, "pX") local playerY = getElementData(name, "pY") local playerZ = getElementData(name, "pZ") if isElement(sell_markers[ player ]) then destroyElement(sell_markers[ player ]) end sell_markers[ player ] = createMarker(tonumber(playerX), tonumber(playerY) + 1, tonumber(playerZ) - 1, "Cylinder", 1.1, 255,255,255,255) else sell_markers[ player ] = createMarker(tonumber(playerX), tonumber(playerY) + 1, tonumber(playerZ) - 1, "Cylinder", 1.1, 255,255,255,255) for i, v in ipairs(getElementsByType("player")) do triggerClientEvent( 'setData', v ) end end ) وقلي وش يطلع لك بالدي بوق وباي سطر والتيبل خله كذا sell_markers = { } الديبوق في خطأ عندك في أند + حليته لاكن مايجي الماركر Link to comment
Abdul KariM Posted January 24, 2016 Share Posted January 24, 2016 (edited) ^ اي سطر الاند يقولك ؟ وجرب ذا addEvent('makeSellMarker', true) addEventHandler('makeSellMarker', root, function(player) local name = getPlayerFromName(getPlayerName(player)) local playerX = getElementData(name, "pX") local playerY = getElementData(name, "pY") local playerZ = getElementData(name, "pZ") if isElement(sell_markers[ player ]) then destroyElement(sell_markers[ player ]) end sell_markers[ player ] = createMarker(playerX, playerY + 1, playerZ - 1, "cylinder", 1.1, 255,255,255,255) else sell_markers[ player ] = createMarker(playerX,playerY + 1, playerZ - 1, "cylinder", 1.1, 255,255,255,255) end for i, v in ipairs(getElementsByType("player")) do triggerClientEvent( 'setData', v ) end ) Edited January 24, 2016 by Guest Link to comment
MR.GRAND Posted January 24, 2016 Author Share Posted January 24, 2016 ^اي سطر الاند يقولك ؟ 10 Link to comment
Abdul KariM Posted January 24, 2016 Share Posted January 24, 2016 ^اي سطر الاند يقولك ؟ 10 عدلت ردي رح جرب الكود Link to comment
MR.GRAND Posted January 24, 2016 Author Share Posted January 24, 2016 ^اي سطر الاند يقولك ؟ 10 عدلت ردي رح جرب الكود انا سويت نفس كودك وجربته قبل لاتعطيني كودك = موضابط Link to comment
Abdul KariM Posted January 24, 2016 Share Posted January 24, 2016 ^ طيب اانا وش دراني انك مسوي زيه المهم جرب ذا addEvent('makeSellMarker', true) addEventHandler('makeSellMarker', root, function() local name = getPlayerFromName(getPlayerName(source)) local playerX = getElementData(name, "pX") local playerY = getElementData(name, "pY") local playerZ = getElementData(name, "pZ") if ( isElement ( sell_markers[source] ) ) then destroyElement( sell_markers[source] ) end sell_markers[ source ] = createMarker(playerX, playerY + 1, playerZ - 1, "cylinder", 1.1, 255,255,255,255) for i, v in ipairs(getElementsByType("player")) do triggerClientEvent( 'setData', v ) end end) Link to comment
MR.GRAND Posted January 24, 2016 Author Share Posted January 24, 2016 ^ طيب اانا وش دراني انك مسوي زيه المهم جرب ذا addEvent('makeSellMarker', true) addEventHandler('makeSellMarker', root, function() local name = getPlayerFromName(getPlayerName(source)) local playerX = getElementData(name, "pX") local playerY = getElementData(name, "pY") local playerZ = getElementData(name, "pZ") if ( isElement ( sell_markers[source] ) ) then destroyElement( sell_markers[source] ) end sell_markers[ source ] = createMarker(playerX, playerY + 1, playerZ - 1, "cylinder", 1.1, 255,255,255,255) for i, v in ipairs(getElementsByType("player")) do triggerClientEvent( 'setData', v ) end end) مسوي الكود من قبل > الماركر مايظهر ^ Link to comment
Abdul KariM Posted January 24, 2016 Share Posted January 24, 2016 ^ طيب اانا وش دراني انك مسوي زيه المهم جرب ذا addEvent('makeSellMarker', true) addEventHandler('makeSellMarker', root, function() local name = getPlayerFromName(getPlayerName(source)) local playerX = getElementData(name, "pX") local playerY = getElementData(name, "pY") local playerZ = getElementData(name, "pZ") if ( isElement ( sell_markers[source] ) ) then destroyElement( sell_markers[source] ) end sell_markers[ source ] = createMarker(playerX, playerY + 1, playerZ - 1, "cylinder", 1.1, 255,255,255,255) for i, v in ipairs(getElementsByType("player")) do triggerClientEvent( 'setData', v ) end end) مسوي الكود من قبل > الماركر مايظهر ^ طيب تأكد من الداتا حقت الاحداثيات لو تجيب احداثياته بداتا وحده افضلك بكثير ترا او انك تجيب احداثياته بدون داتا وجرب تحط الماركر باحدااثيات معينه يعني بدون الداتا حقت الاحداثيات وشوفه يطلع ولا لا ؟ هذي طريقة تتأكد ان الماركر يطلع ولا لا Link to comment
MR.GRAND Posted January 24, 2016 Author Share Posted January 24, 2016 ^ طيب اانا وش دراني انك مسوي زيه المهم جرب ذا addEvent('makeSellMarker', true) addEventHandler('makeSellMarker', root, function() local name = getPlayerFromName(getPlayerName(source)) local playerX = getElementData(name, "pX") local playerY = getElementData(name, "pY") local playerZ = getElementData(name, "pZ") if ( isElement ( sell_markers[source] ) ) then destroyElement( sell_markers[source] ) end sell_markers[ source ] = createMarker(playerX, playerY + 1, playerZ - 1, "cylinder", 1.1, 255,255,255,255) for i, v in ipairs(getElementsByType("player")) do triggerClientEvent( 'setData', v ) end end) مسوي الكود من قبل > الماركر مايظهر ^ طيب تأكد من الداتا حقت الاحداثيات لو تجيب احداثياته بداتا وحده افضلك بكثير ترا او انك تجيب احداثياته بدون داتا وجرب تحط الماركر باحدااثيات معينه يعني بدون الداتا حقت الاحداثيات وشوفه يطلع ولا لا ؟ هذي طريقة تتأكد ان الماركر يطلع ولا لا وضح اكثر وش قصدك بداتا واحدة ؟ قصدك اسوي معرف واحد واجيب البوسيشن بالترتيب ؟ وضح مع مثال Link to comment
Abdul KariM Posted January 24, 2016 Share Posted January 24, 2016 ^ تحط داتا وحده على احداثيات الاعب ولابغيت تجيبها تسوي لها استخراج شوف المثال هذا راح يفيدك كثير addEventHandler("onResourceStart",resourceRoot, function ( ) for _, player in ipairs ( getElementsByType ( "player" ) ) do x,y,z = getElementPosition ( player ) setElementData ( player, "Pos", { x, y, z } ) end end ); addCommandHandler("MyPosBefore", function( player ) x,y,z = unpack ( getElementData ( player, "Pos" ) ) outputChatBox(" x "..x.." y "..y.." z "..z , player ) end ); Link to comment
MR.GRAND Posted January 24, 2016 Author Share Posted January 24, 2016 ^تحط داتا وحده على احداثيات الاعب ولابغيت تجيبها تسوي لها استخراج شوف المثال هذا راح يفيدك كثير addEventHandler("onResourceStart",resourceRoot, function ( ) for _, player in ipairs ( getElementsByType ( "player" ) ) do x,y,z = getElementPosition ( player ) setElementData ( player, "Pos", { x, y, z } ) end end ); addCommandHandler("MyPosBefore", function( player ) x,y,z = unpack ( getElementData ( player, "Pos" ) ) outputChatBox(" x "..x.." y "..y.." z "..z , player ) end ); addEventHandler( 'onMarkerHit', root, function(hitElement, player) if (source == sell_markers[ source ]) and (getElementType( hitElement ) == "Marker") then triggerClientEvent('hitMarkerBuy', player) end end ) عندي مشكلة في لمس الماركر لما المسه مايحصل اي شغلة Link to comment
Jupi Posted January 24, 2016 Share Posted January 24, 2016 addEventHandler( 'onMarkerHit', root, function(hitElement) if (source == sell_markers[hitElement]) and (getElementType( hitElement ) == "player") then triggerClientEvent(hitElement, 'hitMarkerBuy', hitElement) end end ) 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