Jump to content

getElementType شرح


Recommended Posts

Posted
لا

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

أفتح الويكي

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

Parameters شوف الـ

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

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

  • Replies 82
  • Created
  • Last Reply

Top Posters In This Topic

Posted

بعد تخبيص طلع معي كذآ :lol:

addEventHandler("onClientCursorMove",root, 
function(commandName, posX, posY, posZ) 
setElementPosition ( getLocalPlayer(), 1801.8786621094, 840.96112060547, 10.650852203369 ) 
end 
) 

Posted

ذا مثال بسيط

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) 

Posted
ذا مثال بسيط
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 ) آحدآثيات وش؟؟

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

Posted

ياليل

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

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

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

-_-""""

Posted
ياليل

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

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

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

-_-""""

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

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

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

Posted
ياليل

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

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

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

-_-""""

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

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

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

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

onClientClick

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

getElementType 
triggerServerEvent 
setVehicleDoorState 

Posted

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

+ الكود هذآ :

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

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

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

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

Posted
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 
) 

-_-

Posted
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 ?? .. تبي الكلام يجي للماركر ؟ ": /

Posted

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

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

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

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

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,?

Posted

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

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

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

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

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

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 

Posted
تنفع بس بتسوي نفسة الوظيفة لكل الماركرات او لا لان لو لآ شغلة معقدهـ :|

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

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

لـ :

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

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

Posted
تنفع بس بتسوي نفسة الوظيفة لكل الماركرات او لا لان لو لآ شغلة معقدهـ :|

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

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

لـ :

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

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

مافهمت وضح

Posted

^ يعني عندك ملف كلنت تبي تشفره,,

وتبي الناس تغير الزر واسماء الازرار...

سويت ملف Test.lua

آبي يكون Name = "Test"

يكون في هذا الملف ,, بس سويتها وخرب,,

Posted
تنفع بس بتسوي نفسة الوظيفة لكل الماركرات او لا لان لو لآ شغلة معقدهـ :|

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

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

لـ :

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

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

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

Posted
تنفع بس بتسوي نفسة الوظيفة لكل الماركرات او لا لان لو لآ شغلة معقدهـ :|

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

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

لـ :

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

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

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

بالضبطط,,

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