Jump to content

طلب اكواد


Recommended Posts

Posted

السلام عليكم

اشكرا امس الي ساعدوني وامس كان اول يوم لي بالبرمجه واستفدت

واليوم حابب اتعلم 6 شغلات وهم

ربط المود بالماركر يعني لما يلمس الماركر يطلع له المود

ذا اول شي حابب اتعلمه ممكن الاكواد والشرح

وبالأنتضار

 

 

 

 

  • Replies 60
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted (edited)
السلام عليكم

اشكرا امس الي ساعدوني وامس كان اول يوم لي بالبرمجه واستفدت

واليوم حابب اتعلم 6 شغلات وهم

ربط المود بالماركر يعني لما يلمس الماركر يطلع له المود

ذا اول شي حابب اتعلمه ممكن الاكواد والشرح

وبالأنتضار

"onMarkerHit" 

Edited by Guest
Posted (edited)

مثال من الويكي

local myMarker = createMarker(-2596.625, 579.358, 15.626, 'cylinder', 2.0, 255, 0, 0, 150) -- اصنع الماركر 
  
function MarkerHit( hitElement, matchingDimension ) -- تحديد وضيفة تقدر تسوي الايفينت فوق بس لاتغلق ال ) 
    local elementType = getElementType( hitElement ) -- يحصل التايب 
    outputChatBox( elementType.." inside myMarker", getRootElement(), 255, 255, 0 ) -- ندمج نوع الشي مع النص ، و إخراجه 
end 
addEventHandler( "onMarkerHit", myMarker, MarkerHit ) -- طبعا ذة الحدث تقدر تخليه فوق لاكن لاتغلقه 

Edited by Guest
Posted (edited)
local myMarker = createMarker(-2596.625, 579.358, 15.626, 'cylinder', 2.0, 255, 0, 0, 150) -- اصنع الماركر 
      
    function MarkerHit( hitElement, matchingDimension ) -- تحديد وضيفة تقدر تسوي الايفينت فوق بس لاتغلق ال ) 
        local elementType = getElementType( hitElement ) -- يحصل التايب 
        outputChatBox( elementType.." inside myMarker", getRootElement(), 255, 255, 0 ) -- ندمج نوع الشي مع النص ، و إخراجه 
    end 
    addEventHandler( "onMarkerHit", myMarker, MarkerHit ) -- طبعا ذة الحدث تقدر تخليه فوق لاكن لاتغلقه 

اخوي قصدي كذا مثلن اكتب هنا مكان الارقام الاحداثيات

مثال

-2596.625, 579.358, 15.626

تقولي مكان الارقام وش احط وكل سطر فهمت قصدي؟

Edited by Guest

 

 

 

 

Posted
local myMarker = createMarker(-2596.625, 579.358, 15.626, 'cylinder', 2.0, 255, 0, 0, 150) -- اصنع الماركر 
      
    function MarkerHit( hitElement, matchingDimension ) -- تحديد وضيفة تقدر تسوي الايفينت فوق بس لاتغلق ال ) 
        local elementType = getElementType( hitElement ) -- يحصل التايب 
        outputChatBox( elementType.." inside myMarker", getRootElement(), 255, 255, 0 ) -- ندمج نوع الشي مع النص ، و إخراجه 
    end 
    addEventHandler( "onMarkerHit", myMarker, MarkerHit ) -- طبعا ذة الحدث تقدر تخليه فوق لاكن لاتغلقه 

اخوي قصدي كذا مثلن اكتب هنا مكان الارقام الاحداثيات

مثال

-2596.625, 579.358, 15.626

تقولي مكان الارقام وش احط وكل سطر فهمت قصدي؟

-2596.625, 579.358, 15.626 

-2596.625 

هي احداثياث x

----

579.358 

هي احداثيات y

----

15.626 

هي احداثيات z

Posted

اخوي انت مب فاهم قصدي انا اعرف انه هنا الاحداثيات

بس مثلن سطر 3 وش اعدل فيه

وسطر 5 و6 و7 وهكذا

 

 

 

 

Posted
اخوي انت مب فاهم قصدي انا اعرف انه هنا الاحداثيات

بس مثلن سطر 3 وش اعدل فيه

وسطر 5 و6 و7 وهكذا

هذا مثال من الويكي لا اكثر

سطر 3 هو اسم الحدث و الخ ..

اذا كان الحدث فوق الفنكشن يعني مايصير تسميه شي

function MarkerHit() 

هذا اسم الحدث تقدر تغيره لاكن تغيره تحت في الفنكشن

Posted

cleint

GUIEditor = { 
button = {}, 
window = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
function() 
GUIEditor.window[1] = guiCreateWindow(351, 185, 638, 473, "لوحة التحكم", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
guiSetVisible ( GUIEditor.window[1], false) 
  
GUIEditor.button[1] = guiCreateButton(38, 40, 162, 82, "تشغيل طيران السيارة", false, GUIEditor.window[1]) 
GUIEditor.button[2] = guiCreateButton(38, 351, 162, 82, "ايقاف المشي على البحر", false, GUIEditor.window[1]) 
GUIEditor.button[3] = guiCreateButton(38, 245, 162, 82, "المشي على البحر", false, GUIEditor.window[1]) 
GUIEditor.button[4] = guiCreateButton(38, 141, 162, 82, "ايقاف طيران السيارة", false, GUIEditor.window[1]) 
GUIEditor.button[5] = guiCreateButton(223, 141, 162, 82, "اعطاء درع", false, GUIEditor.window[1]) 
GUIEditor.button[6] = guiCreateButton(223, 40, 162, 82, "اعطاء دم", false, GUIEditor.window[1]) 
GUIEditor.button[7] = guiCreateButton(543, 421, 85, 42, "أغلاق", false, GUIEditor.window[1]) 
end 
) 
  
bindKey("f2",'down', function (   ) 
getV = guiSetVisible ( GUIEditor.window[1],not guiGetVisible ( GUIEditor.window[1])) 
showCursor ( guiGetVisible ( GUIEditor.window[1])) 
if getV == true then 
playSound("intro.mp3" ) 
end 
end ) 
  
  
addEventHandler ("onClientGUIClick",resourceRoot, 
 function ( ) 
if ( source == GUIEditor.button[1] ) then 
setWorldSpecialPropertyEnabled ( "aircars", true ) 
  
  
elseif ( source == GUIEditor.button[4] ) then 
setWorldSpecialPropertyEnabled ( "aircars", false ) 
  
  
elseif ( source == GUIEditor.button[3] ) then 
setWorldSpecialPropertyEnabled ( "hovercars", true ) 
  
elseif ( source == GUIEditor.button[2] ) then 
setWorldSpecialPropertyEnabled ( "hovercars", false ) 
  
  
  
elseif source == GUIEditor.button[7] then 
guiSetVisible (wnd,false) 
showCursor (false) 
  
elseif ( source == GUIEditor.button[5]) then 
triggerServerEvent ( "setarmor", localPlayer) 
elseif ( source == GUIEditor.button[6]  ) then 
triggerServerEvent ( "setahealth",localPlayer) 
elseif source == GUIEditor.button[7] then 
guiSetVisible(GUIEditor.window[1] , false) 
end 
end 
) 
  
  
  
  
addEventHandler("onClientResourceStart",resourceRoot , 
function() 
     guiV = guiGetVisible (GUIEditor.window[1] ) 
     if guiV == true then 
     playSound("intro.mp3" ) 
     end 
end) 

server

addEvent("setahealth",true) 
    addEventHandler("setahealth",root, 
    function() 
    setPedStat ( source, 24, 1000 ) 
    setElementHealth ( source, 200 ) 
    end) 
      
    addEvent("setarmor",true) 
    addEventHandler("setarmor",root, 
    function( ) 
    setPedArmor ( source, 100 ) 
    end) 

مثلن ابي المود ذا لما يلمس الماركر الاعب يفتح ذا المود ممكن مثال هوه مود بسيط

 

 

 

 

Posted
local myMarker = createMarker(-2596.625, 579.358, 15.626, 'cylinder', 2.0, 255, 0, 0, 150) 

myMarker في أول سطر قمنا بأنشاء الماركر ووضع متغير له والمتغير هو كلمة

طبعاً تقدر تحط الماركر بدون متغير بس ماراحتقدر تتحكم أو تسوي شيء فيه من وين تجيبه اذا ماله متغير؟

function MarkerHit( hitElement, matchingDimension )  

هنا قمنا بأنشاء وظيفة جديدة ووضععننا لها أسم طبعاً ما تقدر تسوي وظائف نع حدث بدون بداية للوظيفة ذذ وقمنا بتعريف الألمنت الي دخل الماركر

onMarkerHit طبعاً لو تلاحظ الحدث

وتدخل عليه من الويكي

https://wiki.multitheftauto.com/wiki/OnMarkerHit

راح تلاحظ البرامترات حقت الحدث طبعاً لكل حدث برامترات خاصة فيه ذذ برامترات الحدث ذا

element hitElement, bool matchingDimension 

hitElement == الشيء الي دخل الماركر يمكن يكون أوبجكت يمكن يكون سيارة يمكن يكون لاعب ذذ

matchingDimension == هذا يتعلق بالعالم الوهمي وهو الألمنت الي دخل الماركر في أي عالم وهمي؟

local elementType = getElementType( hitElement ) 

بعدها سوينا لوكال وتعريف وجبنا نوع الألمنت الي دخل الماركر

outputChatBox( elementType.." inside myMarker", getRootElement(), 255, 255, 0 )  

بعدها سوينا مخرج شات وحطينا فيه نوع الألمنت يمكن يجيب لك سيارة أو لاعب أو أوبجكت الى آخره

ويحط مخرج الشات للكل

أتمنى تكون فهمت على الشرح أي أستفسار انا حاضر ذذ

"A Year from Now You May Wish You Had Started Today"

Posted

لا ما فهمت احسك تعقد الامور

البرامترات ومدري شنو

شوف الاكواد الي طرحتها كلنت وسيرفر ممكن تعدل عليها وتحط لما يدخل الماركر يشغل اللمود حق الكلنت والسيرفر

كتجربه وانا اشوف المقارنه :)

 

 

 

 

Posted

-- # Client Side : 
  
local myMarker = createMarker(-2596.625, 579.358, 15.626, 'cylinder', 2.0, 255, 0, 0, 150) 
GUIEditor = { 
button = {}, 
window = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
function() 
GUIEditor.window[1] = guiCreateWindow(351, 185, 638, 473, "لوحة التحكم", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
guiSetVisible ( GUIEditor.window[1], false) 
  
GUIEditor.button[1] = guiCreateButton(38, 40, 162, 82, "تشغيل طيران السيارة", false, GUIEditor.window[1]) 
GUIEditor.button[2] = guiCreateButton(38, 351, 162, 82, "ايقاف المشي على البحر", false, GUIEditor.window[1]) 
GUIEditor.button[3] = guiCreateButton(38, 245, 162, 82, "المشي على البحر", false, GUIEditor.window[1]) 
GUIEditor.button[4] = guiCreateButton(38, 141, 162, 82, "ايقاف طيران السيارة", false, GUIEditor.window[1]) 
GUIEditor.button[5] = guiCreateButton(223, 141, 162, 82, "اعطاء درع", false, GUIEditor.window[1]) 
GUIEditor.button[6] = guiCreateButton(223, 40, 162, 82, "اعطاء دم", false, GUIEditor.window[1]) 
GUIEditor.button[7] = guiCreateButton(543, 421, 85, 42, "أغلاق", false, GUIEditor.window[1]) 
end 
) 
  
bindKey("f2",'down', function (   ) 
getV = guiSetVisible ( GUIEditor.window[1],not guiGetVisible ( GUIEditor.window[1])) 
showCursor ( guiGetVisible ( GUIEditor.window[1])) 
if getV == true then 
playSound("intro.mp3" ) 
end 
end ) 
  
 addEventHandler ("onClientMarkerHit",myMarker, 
 function (element) 
  if (element) == localPlayer then 
    guiSetVisible (GUIEditor.window[1],true) 
    showCursor ( true ) 
         end 
    end,false 
  ) 
  
addEventHandler ("onClientGUIClick",resourceRoot, 
 function ( ) 
if ( source == GUIEditor.button[1] ) then 
setWorldSpecialPropertyEnabled ( "aircars", true ) 
elseif ( source == GUIEditor.button[4] ) then 
setWorldSpecialPropertyEnabled ( "aircars", false ) 
elseif ( source == GUIEditor.button[3] ) then 
setWorldSpecialPropertyEnabled ( "hovercars", true ) 
elseif ( source == GUIEditor.button[2] ) then 
setWorldSpecialPropertyEnabled ( "hovercars", false ) 
elseif source == GUIEditor.button[7] then 
guiSetVisible (wnd,false) 
showCursor (false) 
elseif ( source == GUIEditor.button[5]) then 
triggerServerEvent ( "setarmor", localPlayer) 
elseif ( source == GUIEditor.button[6]  ) then 
triggerServerEvent ( "setahealth",localPlayer) 
elseif source == GUIEditor.button[7] then 
guiSetVisible(GUIEditor.window[1] , false) 
end 
end 
) 
  
addEventHandler("onClientResourceStart",resourceRoot , 
function() 
     guiV = guiGetVisible (GUIEditor.window[1] ) 
     if guiV == true then 
     playSound("intro.mp3" ) 
     end 
end) 

"A Year from Now You May Wish You Had Started Today"

Posted
الكود اي سطر؟؟

وين مكان الماركر؟

3 أنشاء الماركر سطر

وظيفة فتح النافذة عند لمس الماركر من سطر 32 الى 39

"A Year from Now You May Wish You Had Started Today"

Posted
طيب وين احصل الماركر قرب وش؟

أنت بدل الأحداثيات سطر 3 أول ثلاث أرقمونتات -_-"

"A Year from Now You May Wish You Had Started Today"

Posted

تم اشتغل لكن في مشاكل معلش اطرحها اغلبك

المود يفتح بالماركر لكن يفتح بأف 2 ايضا الحين ما ابيه يفتح بأف 2 اشيل زر الفتح؟؟

 

 

 

 

Posted
تم اشتغل لكن في مشاكل معلش اطرحها اغلبك

المود يفتح بالماركر لكن يفتح بأف 2 ايضا الحين ما ابيه يفتح بأف 2 اشيل زر الفتح؟؟

يب احذفه

Posted

طيب كيف مثلن ابي احط لون ماركر مثلن معين شلون او شكل الماركر

ولما حذفت زر الي يفتح بأف 2 بطلت الماركر يظهر ممكن تقولي اي سطر احذف؟

 

 

 

 

Posted

bindKey("f2",'down', function ( )

ذا السطر الي حذفته 21

بس الماركر بطل يظهر وبطل يشتغل من اف 2 لكن يشتغل المود

 

 

 

 

Posted
طيب كيف مثلن ابي احط لون ماركر مثلن معين شلون او شكل الماركر

ولما حذفت زر الي يفتح بأف 2 بطلت الماركر يظهر ممكن تقولي اي سطر احذف؟

طيب كيف مثلن ابي احط لون ماركر مثلن معين شلون او شكل الماركر

setMarkerColor لون الماركر أستخدم الوظيفة

سطر 3 في أنشاء الماركر للشكل الي تبيه وهذي قائمة الأشكال cylinder شكل الماركر غير كلمة

--[[ 
"checkpoint" 
"ring" 
"arrow" 
"cylinder" 
"corona" 
  

edit ;

لازم تحذف الوظيفة كاملة

-- # Client Side : 
  
local myMarker = createMarker(-2596.625, 579.358, 15.626, 'cylinder', 2.0, 255, 0, 0, 150) 
GUIEditor = { 
button = {}, 
window = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
function() 
GUIEditor.window[1] = guiCreateWindow(351, 185, 638, 473, "لوحة التحكم", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
guiSetVisible ( GUIEditor.window[1], false) 
  
GUIEditor.button[1] = guiCreateButton(38, 40, 162, 82, "تشغيل طيران السيارة", false, GUIEditor.window[1]) 
GUIEditor.button[2] = guiCreateButton(38, 351, 162, 82, "ايقاف المشي على البحر", false, GUIEditor.window[1]) 
GUIEditor.button[3] = guiCreateButton(38, 245, 162, 82, "المشي على البحر", false, GUIEditor.window[1]) 
GUIEditor.button[4] = guiCreateButton(38, 141, 162, 82, "ايقاف طيران السيارة", false, GUIEditor.window[1]) 
GUIEditor.button[5] = guiCreateButton(223, 141, 162, 82, "اعطاء درع", false, GUIEditor.window[1]) 
GUIEditor.button[6] = guiCreateButton(223, 40, 162, 82, "اعطاء دم", false, GUIEditor.window[1]) 
GUIEditor.button[7] = guiCreateButton(543, 421, 85, 42, "أغلاق", false, GUIEditor.window[1]) 
end 
) 
  
 addEventHandler ("onClientMarkerHit",myMarker, 
 function (element) 
  if (element) == localPlayer then 
    guiSetVisible (GUIEditor.window[1],true) 
    showCursor ( true ) 
         end 
    end,false 
  ) 
  
addEventHandler ("onClientGUIClick",resourceRoot, 
 function ( ) 
if ( source == GUIEditor.button[1] ) then 
setWorldSpecialPropertyEnabled ( "aircars", true ) 
elseif ( source == GUIEditor.button[4] ) then 
setWorldSpecialPropertyEnabled ( "aircars", false ) 
elseif ( source == GUIEditor.button[3] ) then 
setWorldSpecialPropertyEnabled ( "hovercars", true ) 
elseif ( source == GUIEditor.button[2] ) then 
setWorldSpecialPropertyEnabled ( "hovercars", false ) 
elseif source == GUIEditor.button[7] then 
guiSetVisible (wnd,false) 
showCursor (false) 
elseif ( source == GUIEditor.button[5]) then 
triggerServerEvent ( "setarmor", localPlayer) 
elseif ( source == GUIEditor.button[6]  ) then 
triggerServerEvent ( "setahealth",localPlayer) 
elseif source == GUIEditor.button[7] then 
guiSetVisible(GUIEditor.window[1] , false) 
end 
end 
) 
  
addEventHandler("onClientResourceStart",resourceRoot , 
function() 
     guiV = guiGetVisible (GUIEditor.window[1] ) 
     if guiV == true then 
     playSound("intro.mp3" ) 
     end 
end) 

"A Year from Now You May Wish You Had Started Today"

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...