Jump to content

getElementType شرح


Recommended Posts

  TAPL said:
لا

ذا يجي مع الأفنت

أفتح الويكي

https://wiki.multitheftauto.com/wiki/OnClientCursorMove

Parameters شوف الـ

  Wiki said:
float cursorX, float cursorY, int absoluteX, int absoluteY, float worldX, float worldY, float worldZ 

cursorX: the relative X coordinate of the mouse cursor. 0 = left side of the screen, 1 = right side.

cursorY: the relative Y coordinate of the mouse cursor. 0 = top of the screen, 1 = bottom.

absoluteX: the X coordinate of the mouse cursor, in pixels, measured from the left side of the screen.

absoluteY: the Y coordinate of the mouse cursor, in pixels, measured from the top of the screen.

worldX, worldY, worldZ: the 3D in-game world coordinates that the cursor is pointing at.

(depth) الأفضل تستخدم الفنكشن ذا عشان تقدر تحدد المدى

https://wiki.multitheftauto.com/wiki/GetWorldFromScreenPosition

setElementPosition ( source, posX, posY, posZ ) 

لازم تحدد x , y , z

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

Link to comment
  • Replies 82
  • Created
  • Last Reply

Top Posters In This Topic

ذا مثال بسيط

car = createVehicle(410, -711.33667, 962.23163, 12.36893) 
setElementFrozen(car, true) 
  
addEventHandler("onClientCursorMove", root, 
function() 
    local w, h = guiGetScreenSize() 
    local x, y, z = getWorldFromScreenPosition(w/2, h/2, 10) 
    setElementPosition(car, x, y, z) 
end) 

Link to comment
  TAPL said:
ذا مثال بسيط
car = createVehicle(410, -711.33667, 962.23163, 12.36893) 
setElementFrozen(car, true) 
  
addEventHandler("onClientCursorMove", root, 
function() 
    local w, h = guiGetScreenSize() 
    local x, y, z = getWorldFromScreenPosition(w/2, h/2, 10) 
    setElementPosition(car, x, y, z) 
end) 

( w/2, h/2, 10 ) آحدآثيات وش؟؟

ما لها شرح بالويكي,,

Link to comment

ياليل

ياخي ذي الأحداثيات مو أنت الي تحطها

ذي تجي من الفنكشن

بس انسخ الكود و حطه بالمفكرة و احفظ و شغل المود

-_-""""

Link to comment
  TAPL said:
ياليل

ياخي ذي الأحداثيات مو أنت الي تحطها

ذي تجي من الفنكشن

بس انسخ الكود و حطه بالمفكرة و احفظ و شغل المود

-_-""""

يعطيك العافيهه,,,

المهم بغيت كود اذا ضغطت كلك يمين يكسر الشيء,,

مثلا سياره,, اذا ضغطت كلك يمين يتكسر القزاز ....

Link to comment
  The Best said:
  TAPL said:
ياليل

ياخي ذي الأحداثيات مو أنت الي تحطها

ذي تجي من الفنكشن

بس انسخ الكود و حطه بالمفكرة و احفظ و شغل المود

-_-""""

يعطيك العافيهه,,,

المهم بغيت كود اذا ضغطت كلك يمين يكسر الشيء,,

مثلا سياره,, اذا ضغطت كلك يمين يتكسر القزاز ....

:استخدم الحدث

onClientClick

:واستخدم الوظايف

getElementType 
triggerServerEvent 
setVehicleDoorState 

Link to comment

^ يعطيك العافيهه,,

+ الكود هذآ :

local spawnVeh = spawnVehicle ( RaceVehicle, x+3, y+3, z ) 

الكود بس لسياره محدده,انا ابيه لكل السيارات,

+ ابي كود حذف السيارة,

يعني ماركر يدخل الساحه بالموتر ينسحب,,

Link to comment
marker = createMarker('...') 
   addEventHandler('onMarkerHit', marker, 
function (sVehicle) 
     if(getElementType(sVehicle) == 'vehicle' ) then 
     destroyElement(sVehicle) 
     outputChatBox('You Vehicle Has Been Destroyed For Entering the Marker', source, 255, 0 ,0 ) 
    end 
 end 
) 

-_-

Link to comment
  Max+ said:
marker = createMarker('...') 
   addEventHandler('onMarkerHit', marker, 
function (sVehicle) 
     if(getElementType(sVehicle) == 'vehicle' ) then 
     destroyElement(sVehicle) 
     outputChatBox('You Vehicle Has Been Destroyed For Entering the Marker', source, 255, 0 ,0 ) 
    end 
 end 
) 

-_-

Line Number 6: source ?? .. تبي الكلام يجي للماركر ؟ ": /

Link to comment

^عآرف انه خطأ + اصلآ بس كنت ابي الطريقه لا اكثثر,,

+ ابي شرح بسيط لـ الجدآول مآبي احد يقولي موضوع بوو,,

آبي شرح لهذآ بس::

كود برستيجج,,

local ID = { 
[1] = {x,y,width,height,"Test[1]"}, 
[2] = {x,y,width,height,"Test[2]"} 
} 
  
for _,v in ipairs ( ID ) do 
        Button = guiCreateButton(v[1],v[2],v[3],v[4],v[5],false) 
    end 

اقدر آغير ID ,؟

+ v[1],.... لازم اضيف v,?

Link to comment

local ID = { 
[1] = {x,y,width,height,"Test[1]"}, 
[2] = {x,y,width,height,"Test[2]"} 
} 
  
for _,v in ipairs ( ID ) do 
        Button = guiCreateButton(v[1],v[2],v[3],v[4],v[5],false) 
    end 

[1] = {x,y,width,height,"Test[1]"}, -- Create GUI Button Arguments

for _,v in ipairs ( ID ) do -- ID = the Table

Button = guiCreateButton(v[1],v[2],v[3],v[4],v[5],false)-- get data from table . v[1] = argument[1] from the table #

end

Link to comment
  The Best said:
^عآرف انه خطأ + اصلآ بس كنت ابي الطريقه لا اكثثر,,

+ ابي شرح بسيط لـ الجدآول مآبي احد يقولي موضوع بوو,,

آبي شرح لهذآ بس::

كود برستيجج,,

local ID = { 
[1] = {x,y,width,height,"Test[1]"}, 
[2] = {x,y,width,height,"Test[2]"} 
} 
  
for _,v in ipairs ( ID ) do 
        Button = guiCreateButton(v[1],v[2],v[3],v[4],v[5],false) 
    end 

اقدر آغير ID ,؟

+ v[1],.... لازم اضيف v,?

ID = إسم الجدول

Best في سطر 6 إلى ( ID ) لما تغيره لازم تغير إسم الجدول ، Best يعني يمديك تغير إسم الجدول الي فوق إلى أي اسم تبيه مثلاً تسميه

v أما بالنسبة إلى

( for _, v ) ذي حسب الإختصار الي أنت حاطه بسطر 6

i إلي أي إختصار تبيه ... لنفرض إنكـ تبي تحط مكانه حرف v يعني تقدر تغير حرف

يصير كذا بعد كل التعديلات ,

local Best = { 
    [1] = { x, y, width, height, "Test[1]" }, 
    [2] = { x, y, width, height, "Test[2]" } 
} 
  
for _, i in ipairs ( Best ) do 
    Button = guiCreateButton ( i[1], i[2], i[3], i[4], i[5], false ) 
end 

Link to comment
  Mr.Pres[T]ege said:
تنفع بس بتسوي نفسة الوظيفة لكل الماركرات او لا لان لو لآ شغلة معقدهـ :|

طيب انا الحين ابي اختصر اشياء مثلآ ,,

button = guiCreateButton(131,163,113,46,"Test",false,window) 

لـ :

button = guiCreateButton(131,163,113,46,Name,false,window) 
Name = "Test" 

طيب أبيها بملف لوحدهآ واذا غيرها تتغير من الملف الاصلي,,

Link to comment
  The Best said:
  Mr.Pres[T]ege said:
تنفع بس بتسوي نفسة الوظيفة لكل الماركرات او لا لان لو لآ شغلة معقدهـ :|

طيب انا الحين ابي اختصر اشياء مثلآ ,,

button = guiCreateButton(131,163,113,46,"Test",false,window) 

لـ :

button = guiCreateButton(131,163,113,46,Name,false,window) 
Name = "Test" 

طيب أبيها بملف لوحدهآ واذا غيرها تتغير من الملف الاصلي,,

مافهمت وضح

Link to comment
  The Best said:
  Mr.Pres[T]ege said:
تنفع بس بتسوي نفسة الوظيفة لكل الماركرات او لا لان لو لآ شغلة معقدهـ :|

طيب انا الحين ابي اختصر اشياء مثلآ ,,

button = guiCreateButton(131,163,113,46,"Test",false,window) 

لـ :

button = guiCreateButton(131,163,113,46,Name,false,window) 
Name = "Test" 

طيب أبيها بملف لوحدهآ واذا غيرها تتغير من الملف الاصلي,,

تقصد تبي تسوي مفكرة خارجية .. وتكتب الي تبي تحطه بالزر .. وتلقائياً يتغير بملف الكلنت وكذا ؟

Link to comment
  ===|OSAMA|=== said:
  The Best said:
  Mr.Pres[T]ege said:
تنفع بس بتسوي نفسة الوظيفة لكل الماركرات او لا لان لو لآ شغلة معقدهـ :|

طيب انا الحين ابي اختصر اشياء مثلآ ,,

button = guiCreateButton(131,163,113,46,"Test",false,window) 

لـ :

button = guiCreateButton(131,163,113,46,Name,false,window) 
Name = "Test" 

طيب أبيها بملف لوحدهآ واذا غيرها تتغير من الملف الاصلي,,

تقصد تبي تسوي مفكرة خارجية .. وتكتب الي تبي تحطه بالزر .. وتلقائياً يتغير بملف الكلنت وكذا ؟

بالضبطط,,

Link to comment

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...