KinG_DrifT Posted July 7, 2013 Share Posted July 7, 2013 السلآآم عليكم,, شباب واجهتني مشكلة مع هذا الكود getElementModel وهي ان مافي له ارقومنت, لان انا مسويه بـ triggerServerEvent هذي كوداتي --Server addEvent("money", true) addEventHandler("money", getRootElement(),function() local id = getElementModel ( hitElement ) if id == 437 or id == 431 then givePlayerMoney (source, 2000) end end) --Client function Spawncar ( hitPlayer ) if hitPlayer == localPlayer then triggerLatentServerEvent ("money", getLocalPlayer() ) end end addEventHandler ( "onClientMarkerHit", root, Spawncar ) Link to comment
iPrestege Posted July 7, 2013 Share Posted July 7, 2013 (edited) -- # Client Side function Spawncar ( hitPlayer ) if hitPlayer == localPlayer then triggerLatentServerEvent ( "money",hitPlayer ) end end addEventHandler ( "onClientMarkerHit", root, Spawncar ) ^^ اي ماركر ينلمس كلنت بتصير الوظيفة انت ماحددت ~ -- # Server Side addEvent("money", true) addEventHandler("money", getRootElement(), function ( ) if getPedOccupiedVehicle( client ) then local id = getElementModel ( getPedOccupiedVehicle( client ) ) if id == 437 or id == 431 then givePlayerMoney ( client, 2000 ) end end end ) Edited July 7, 2013 by Guest Link to comment
iPrestege Posted July 7, 2013 Share Posted July 7, 2013 انسخ السيرفر ثانية توني انتبة للسيارهـ -_-" Link to comment
KinG_DrifT Posted July 7, 2013 Author Share Posted July 7, 2013 --server addEvent("money", true) addEventHandler("money", getRootElement(),function() local id = getElementModel ( hitElement ) if id == 437 or id == 431 then givePlayerMoney (source, 2000) end end) Link to comment
PaiN^ Posted July 7, 2013 Share Posted July 7, 2013 -- # Client Side function Spawncar( hitPlayer ) if hitPlayer == localPlayer then triggerLatentServerEvent( "money",hitPlayer ) end end addEventHandler( "onClientMarkerHit", root, Spawncar ) --server addEvent( "money", true ) addEventHandler( "money", getRootElement(), function( ) local id = getElementModel( source ) if id == 437 or id == 431 then givePlayerMoney( source, 2000 ) end end ) * ! هذا الكود راح يتنفذ على أي ماركر Link to comment
iPrestege Posted July 7, 2013 Share Posted July 7, 2013 -- # Client Side function Spawncar( hitPlayer ) if hitPlayer == localPlayer then triggerLatentServerEvent( "money",hitPlayer ) end end addEventHandler( "onClientMarkerHit", root, Spawncar ) --server addEvent( "money", true ) addEventHandler( "money", getRootElement(), function( ) local id = getElementModel( source ) if id == 437 or id == 431 then givePlayerMoney( source, 2000 ) end end ) * ! هذا الكود راح يتنفذ على أي ماركر انا مثلك حسبتة بيشتغل بس الايدي الله ياخذهـ .. لول ذذ الايدي حق سياره شوف كودي عدلتة -_-" Link to comment
PaiN^ Posted July 7, 2013 Share Posted July 7, 2013 أصلا هو ما قال وش يبي الكود يسوي, عشان كذا متلخبطين Link to comment
iPrestege Posted July 7, 2013 Share Posted July 7, 2013 أصلا هو ما قال وش يبي الكود يسوي, عشان كذا متلخبطين +1 -_-" انا حسبتة للاعب Link to comment
KinG_DrifT Posted July 7, 2013 Author Share Posted July 7, 2013 يعطيكم العافية شبااب ,ضبط كودك فههد, بسس عندي مشكلة صغننة تواجهني دايمـآآ وبعض الاحيان اطفش من المود واتركه وهي اني اسوي نافذ فيه زر ,اذا ضغطته يطلع لك ماركر, هذا كلله سهل, واعرفه بسس المشكلة هي, ان كيف اسسوي له وظيفة؟ حتى لو تلاحظ في كودي حطيت root addEventHandler ( "onClientGUIClick", root, function() if source == GUIEditor.button[1] then guiSetVisible ( GUIEditor.window[1], false ) showCursor ( false ) triggerServerEvent ("Setskin", getLocalPlayer()) triggerServerEvent ("SetTeam", getLocalPlayer()) one = createMarker ( -1696.65, 1320.79, 6.4, "cylinder", 3, 255, 255, 0, 170 ) myBlip = createBlipAttachedTo ( one, 51 ) end end ) function Spawncar ( hitPlayer ) if hitPlayer == localPlayer then triggerLatentServerEvent ( "money",hitPlayer ) end end addEventHandler ( "onClientMarkerHit", root, Spawncar ) --ROOT كيف احدد له وظيفة؟ Link to comment
KinG_DrifT Posted July 7, 2013 Author Share Posted July 7, 2013 addEventHandler ( "onClientGUIClick", root, function() if source == GUIEditor.button[1] then guiSetVisible ( GUIEditor.window[1], false ) showCursor ( false ) triggerServerEvent ("Setskin", getLocalPlayer()) triggerServerEvent ("SetTeam", getLocalPlayer()) one = createMarker ( -1696.65, 1320.79, 6.4, "cylinder", 3, 255, 255, 0, 170 ) myBlip = createBlipAttachedTo ( one, 51 ) end end ) function Spawncar ( hitPlayer ) if hitPlayer == localPlayer then triggerLatentServerEvent ( "money",hitPlayer ) end end addEventHandler ( "onClientMarkerHit", root, Spawncar ) ابي الماركر اللي اسمه "one" يشتغل على الوظيفة ذي function Spawncar ( hitPlayer ) if hitPlayer == localPlayer then triggerLatentServerEvent ( "money",hitPlayer ) end end addEventHandler ( "onClientMarkerHit", root, Spawncar ) --انا كاتب رووت هنا Link to comment
iPrestege Posted July 7, 2013 Share Posted July 7, 2013 addEventHandler ( "onClientMarkerHit", one, Spawncar ) ضيفة تحت الماركر بحدث الضغط + شيل روت الحدث كلة القديم Link to comment
KinG_DrifT Posted July 7, 2013 Author Share Posted July 7, 2013 طيب هذي الوظيفة ماتستوي كامله, يعني الماركر مايتحرك ليه؟ addEventHandler ( "onClientGUIClick", root, function() if source == GUIEditor.button[1] then guiSetVisible ( GUIEditor.window[1], false ) showCursor ( false ) triggerServerEvent ("Setskin", getLocalPlayer()) triggerServerEvent ("SetTeam", getLocalPlayer()) one = createMarker ( -1696.65, 1320.79, 6.4, "cylinder", 3, 255, 255, 0, 170 ) addEventHandler ( "onClientMarkerHit", one, Spawncar ) myBlip = createBlipAttachedTo ( one, 51 ) end end ) function Spawncar ( hitPlayer ) if hitPlayer == localPlayer then triggerLatentServerEvent ( "money",hitPlayer ) setElementPosition (one,-1733.11, 1306.04, 70) --هذا مايحرك الماركر, ولا يطلع لي اي اخطاء في debugscript end end Link to comment
iPrestege Posted July 7, 2013 Share Posted July 7, 2013 addEventHandler ( "onClientGUIClick",GUIEditor.button[1], function ( ) guiSetVisible ( GUIEditor.window[1], false ) showCursor ( false ) triggerServerEvent ("Setskin", getLocalPlayer()) triggerServerEvent ("SetTeam", getLocalPlayer()) one = createMarker ( -1696.65, 1320.79, 6.4, "cylinder", 3, 255, 255, 0, 170 ) myBlip = createBlipAttachedTo ( one, 51 ) addEventHandler ( "onClientMarkerHit", one, Spawncar ) end,false ) function Spawncar ( hitPlayer ) if hitPlayer == localPlayer then triggerLatentServerEvent ( "money",hitPlayer ) if not isElement ( one ) then return outputChatBox ( 'NO MARKER' ) end setElementPosition ( one,-1733.11, 1306.04, 70 ) outputChatBox ( 'MARKER MOVED' ) end end قلي شيجيك بالشات Link to comment
KinG_DrifT Posted July 7, 2013 Author Share Posted July 7, 2013 marker moved, على فكرة الكود عدلت عليه, لانه مو راضي يشتغل Link to comment
iPrestege Posted July 7, 2013 Share Posted July 7, 2013 ماتحرك الماركر؟ | = ديبوق شيء؟ Link to comment
KinG_DrifT Posted July 7, 2013 Author Share Posted July 7, 2013 مدري من الحوول انا ولا انت؟ ههههههههههههههههههههههه setElementPosition ( one,-1733.11, 1306.04, 70) --x, y, 70 عـ العموم مششكؤور يَ الغلآآ, وان شاء الله نشوفكك معرس (مشرف) ضض1 Link to comment
KinG_DrifT Posted July 7, 2013 Author Share Posted July 7, 2013 طيب اخرر سؤال واخلصص المود, ولا برجع لكم ضض1 انا سويت جدول فيه احداثيات, كيف احطه في setElementPosition (one, x, y, z) يعني يجي عشوائي في الاحداثيات اللي مكتوبه بالجدول Link to comment
iPrestege Posted July 7, 2013 Share Posted July 7, 2013 الجدول يكون لة اندكس مثل كذا : vTable = { [ 1 ] = { x,y,z }, } local x,y,z = unpack( vTable [ math.random( #vTable ) ] ) Link to comment
KinG_DrifT Posted July 7, 2013 Author Share Posted July 7, 2013 الجدول يكون لة اندكس مثل كذا : vTable = { [ 1 ] = { x,y,z }, } local x,y,z = unpack( vTable [ math.random( #vTable ) ] ) طيب كيف اسويه؟ Link to comment
iPrestege Posted July 7, 2013 Share Posted July 7, 2013 غير الجدول مثلا تبي تضيف احداثيت انسخ [ 1 ] = { x,y,z }, مع تغيير الاندكس ! Link to comment
KinG_DrifT Posted July 7, 2013 Author Share Posted July 7, 2013 على رتبتك, مدمن ض1 المهم الكود الثاني مافهمته local x,y,z = unpack( vTable [ math.random( #vTable ) ] ) كيف استخدمه؟ وين احطه؟ Link to comment
iPrestege Posted July 7, 2013 Share Posted July 7, 2013 مثال على كودك : addEventHandler ( "onClientGUIClick",GUIEditor.button[1], function ( ) guiSetVisible ( GUIEditor.window[1], false ) showCursor ( false ) triggerServerEvent ("Setskin", getLocalPlayer()) triggerServerEvent ("SetTeam", getLocalPlayer()) local x,y,z = unpack( vTable [ math.random( #vTable ) ] ) one = createMarker ( x,y,z, "cylinder", 3, 255, 255, 0, 170 ) myBlip = createBlipAttachedTo ( one, 51 ) addEventHandler ( "onClientMarkerHit", one, Spawncar ) end,false ) function Spawncar ( hitPlayer ) if hitPlayer == localPlayer then triggerLatentServerEvent ( "money",hitPlayer ) if not isElement ( one ) then return outputChatBox ( 'NO MARKER' ) end setElementPosition ( one,-1733.11, 1306.04, 70 ) outputChatBox ( 'MARKER MOVED' ) 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