Jump to content

استفسار بسيط عن احداثيات ماركر


MA[S]RIY

Recommended Posts

السلام عليكم

انا ابي اسوي ماركر سيارات 

والماركر 

هيكون اكثر من واحد

كيف اضع كمان اكثر من احداثيات

------------

يعني 

كيف احط احداثيات اخري تكون لما تدخل الماركر يعطيك سيارة

 

؟؟

#

Link to comment
 

طيب ممكن تساعدني

الاحداثيات العاديه تكون كذا


local car = createMarker ( 2506.92017,-1679.44653,13.54688, "cylinder", 4, 255, 210, 255, 110 )

كيف اضع اكثر من احداثيات

-----------

او سوي الجدول 

؟

#

عندي طريقة افضل
سوي ماركرات عادية

جرب هذا

 

Marker = createMarker ( x,y,z, "cylinder", 2, 255, 255, 0, 0 )
Marker2 = createMarker ( x,y,z, "cylinder", 2, 255, 255, 0, 0 )
Marker3 = createMarker ( x,y,z, "cylinder", 2, 255, 255, 0, 0 )

addEventHandler("onClientMarkerHit",root,
    function (player)
    if source == Marker or source == Marker2 or source == Marker3 then
        if (getElementType (player) == "player") and (player == localPlayer)  then
        if isPedInVehicle (player) then

        -- Your Code ...

        end
        end
    end
    end
)

ملاحظة ما جربت الطريقة سويتها بدون تجربة لأني مشغول بمود آخر

  • Like 1
Link to comment

اخي

هو ما اشتغل ما اعرف ليش شوف 

local window = guiCreateWindow(353, 146, 323, 358, "Cars", false)
guiWindowSetSizable(window, false)
guiSetVisible (window,false)
guiSetAlpha(window, 1.00)

local gridlist = guiCreateGridList(33, 46, 256, 253, false, window)
guiGridListAddColumn(gridlist, "Cars Server Or Group", 0.9)
local button2 = guiCreateButton(29, 311, 68, 35, "Use", false, window)
guiSetProperty(button2, "NormalTextColour", "ffff0000")
local button = guiCreateButton(288, 25, 26, 22, "X", false, window)
guiSetProperty(button, "NormalTextColour", "FFFF0000")    
local car = { 445, 462 }

for _,vehicle in ipairs (car) do
local row = guiGridListAddRow ( gridlist )
guiGridListSetItemText ( gridlist, row, 1,getVehicleNameFromModel (tonumber( vehicle )), false, false )
end
 
addEventHandler("onClientGUIClick",button2, 
function () 
local carxx = guiGridListGetItemText ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 )
 if carxx == "" then return outputChatBox("Please Use Car",255, 0, 0,true) end
triggerServerEvent("carx",localPlayer,carxx) 
guiSetVisible(window,false)
showCursor(false)
end,false
)

-------------------------------
Marker = createMarker ( 2506.92017,-1679.44653,13.54688, "cylinder", 4, 255, 210, 255, 110 )
Marker2 = createMarker ( 1722.75684,-1610.52246,13.54688, "cylinder", 4, 255, 210, 255, 110 )
Marker3 = createMarker ( 1287.40295,-1562.08289,13.55302, "cylinder", 4, 255, 210, 255, 110 )
Marker4 = createMarker ( 1326.32141,-1164.76501,23.82813, "cylinder", 4, 255, 210, 255, 110 )
Marker5 = createMarker ( 1151.03821,-1221.90747,17.73531, "cylinder", 4, 255, 210, 255, 110 )

addEventHandler('onClientMarkerHit', car,
    function (hitPlayer)
    if source == Marker or source == Marker2 or source == Marker3 or source == Marker4 or source == Marker5 then
        if (getElementType (player) == "player") and (player == localPlayer)  then
        if isPedInVehicle (player) then
guiSetVisible ( window ,true )
        showCursor( true )
      guiSetInputEnabled(false)
    end
end
)

addEventHandler( "onClientGUIClick", button ,
function ()
    guiSetVisible(window,false)
    showCursor(false,false)
end

        end
        end
    end
    end
)

 

ارجو ان احد يظبط الاكواد

Link to comment
 

اخي

هو ما اشتغل ما اعرف ليش شوف 


local window = guiCreateWindow(353, 146, 323, 358, "Cars", false)
guiWindowSetSizable(window, false)
guiSetVisible (window,false)
guiSetAlpha(window, 1.00)

local gridlist = guiCreateGridList(33, 46, 256, 253, false, window)
guiGridListAddColumn(gridlist, "Cars Server Or Group", 0.9)
local button2 = guiCreateButton(29, 311, 68, 35, "Use", false, window)
guiSetProperty(button2, "NormalTextColour", "ffff0000")
local button = guiCreateButton(288, 25, 26, 22, "X", false, window)
guiSetProperty(button, "NormalTextColour", "FFFF0000")    
local car = { 445, 462 }

for _,vehicle in ipairs (car) do
local row = guiGridListAddRow ( gridlist )
guiGridListSetItemText ( gridlist, row, 1,getVehicleNameFromModel (tonumber( vehicle )), false, false )
end
 
addEventHandler("onClientGUIClick",button2, 
function () 
local carxx = guiGridListGetItemText ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 )
 if carxx == "" then return outputChatBox("Please Use Car",255, 0, 0,true) end
triggerServerEvent("carx",localPlayer,carxx) 
guiSetVisible(window,false)
showCursor(false)
end,false
)

-------------------------------
Marker = createMarker ( 2506.92017,-1679.44653,13.54688, "cylinder", 4, 255, 210, 255, 110 )
Marker2 = createMarker ( 1722.75684,-1610.52246,13.54688, "cylinder", 4, 255, 210, 255, 110 )
Marker3 = createMarker ( 1287.40295,-1562.08289,13.55302, "cylinder", 4, 255, 210, 255, 110 )
Marker4 = createMarker ( 1326.32141,-1164.76501,23.82813, "cylinder", 4, 255, 210, 255, 110 )
Marker5 = createMarker ( 1151.03821,-1221.90747,17.73531, "cylinder", 4, 255, 210, 255, 110 )

addEventHandler('onClientMarkerHit', car,
    function (hitPlayer)
    if source == Marker or source == Marker2 or source == Marker3 or source == Marker4 or source == Marker5 then
        if (getElementType (player) == "player") and (player == localPlayer)  then
        if isPedInVehicle (player) then
guiSetVisible ( window ,true )
        showCursor( true )
      guiSetInputEnabled(false)
    end
end
)

addEventHandler( "onClientGUIClick", button ,
function ()
    guiSetVisible(window,false)
    showCursor(false,false)
end

        end
        end
    end
    end
)

 

ارجو ان احد يظبط الاكواد

"onClientMarkerHit", car,
شيل اسم الماركر هذا car
ورجعه root 

Edited by Developer Ahmed
Link to comment

اخي بردو ما ظبط

شيك علي الكود وعلي الايند والاكواس

----------

local window = guiCreateWindow(353, 146, 323, 358, "Cars", false)
guiWindowSetSizable(window, false)
guiSetVisible (window,false)
guiSetAlpha(window, 1.00)

local gridlist = guiCreateGridList(33, 46, 256, 253, false, window)
guiGridListAddColumn(gridlist, "Cars Server Or Group", 0.9)
local button2 = guiCreateButton(29, 311, 68, 35, "Use", false, window)
guiSetProperty(button2, "NormalTextColour", "ffff0000")
local button = guiCreateButton(288, 25, 26, 22, "X", false, window)
guiSetProperty(button, "NormalTextColour", "FFFF0000")    
local car = { 445, 462 }

for _,vehicle in ipairs (car) do
local row = guiGridListAddRow ( gridlist )
guiGridListSetItemText ( gridlist, row, 1,getVehicleNameFromModel (tonumber( vehicle )), false, false )
end
 
addEventHandler("onClientGUIClick",button2, 
function () 
local carxx = guiGridListGetItemText ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 )
 if carxx == "" then return outputChatBox("Please Use Car",255, 0, 0,true) end
triggerServerEvent("carx",localPlayer,carxx) 
guiSetVisible(window,false)
showCursor(false)
end,false
)

-------------------------------
Marker = createMarker ( 2506.92017,-1679.44653,13.54688, "cylinder", 4, 255, 210, 255, 110 )
Marker2 = createMarker ( 1722.75684,-1610.52246,13.54688, "cylinder", 4, 255, 210, 255, 110 )
Marker3 = createMarker ( 1287.40295,-1562.08289,13.55302, "cylinder", 4, 255, 210, 255, 110 )
Marker4 = createMarker ( 1326.32141,-1164.76501,23.82813, "cylinder", 4, 255, 210, 255, 110 )
Marker5 = createMarker ( 1151.03821,-1221.90747,17.73531, "cylinder", 4, 255, 210, 255, 110 )

addEventHandler('onClientMarkerHit', root,
    function (hitPlayer)
    if source == Marker or source == Marker2 or source == Marker3 or source == Marker4 or source == Marker5 then
        if (getElementType (player) == "player") and (player == localPlayer)  then
        if isPedInVehicle (player) then
guiSetVisible ( window ,true )
        showCursor( true )
      guiSetInputEnabled(false)
    end
  end
end
end
end
)

addEventHandler( "onClientGUIClick", button ,
function ()
    guiSetVisible(window,false)
    showCursor(false,false)
end      
end
)


 

Link to comment

انا معي مود

لما تدخل مركر

يفتح لك لوحة بها سيارات تختار سياره

في المود مركر واحد

--------------

انا ابي اكثر من مركر 

يعني احط اكثر من احداثي

لما تدخلهم يفتحلك لوحة وتختار منها سياره

؟

#

 

Link to comment
22 minutes ago, MARIY said:

انا معي مود

لما تدخل مركر

يفتح لك لوحة بها سيارات تختار سياره

في المود مركر واحد

--------------

انا ابي اكثر من مركر 

يعني احط اكثر من احداثي

لما تدخلهم يفتحلك لوحة وتختار منها سياره

؟

#

 

جرب تحطها ف اقواس
 

(source == marker)

 

Just now, 3laa33 said:

جرب تحطها ف اقواس
 


(source == marker)

 

+ شغل ال debugscript 3 
من اف8 وشوف وش يقولك لما تشغل المود

Link to comment
PositionsTable = {
	{ x, y, z, 'cylinder', Size, R, G, B, Alpha },
	--{ x, y, z, 'cylinder', Size, R, G, B, Alpha },
	--{ x, y, z, 'cylinder', Size, R, G, B, Alpha },
	--{ x, y, z, 'cylinder', Size, R, G, B, Alpha },
	--{ x, y, z, 'cylinder', Size, R, G, B, Alpha },
}

for _, value in ipairs( PositionsTable ) do
	local Marker = createMarker( value[1], value[2], value[3], value[4], value[5], value[6], value[7], value[8], value[9] )
	setElementData( Marker, 'isCarMarker', 'true' )
end

addEventHandler( 'onClientMarkerHit', getRootElement(  ),
function(  )
	if ( getElementData( source, 'isCarMarker' ) == 'true' ) then
		-- Your functions
	end
end )

سويته لك +

تقدر تضيف احداثيات وكل ماركر وخصائصه ^

لونه وحجمه ونوعه 

بالتوفيق ^_^

Link to comment
 

انا معي مود

لما تدخل مركر

يفتح لك لوحة بها سيارات تختار سياره

في المود مركر واحد

--------------

انا ابي اكثر من مركر 

يعني احط اكثر من احداثي

لما تدخلهم يفتحلك لوحة وتختار منها سياره

؟

#

 

 

s,Gta,_4,u,a = 1, 205, 255, 255, 150

local car1 = createMarker  ( 1624.51648, 1818.91882, 10.8203-1, "cylinder", s,Gta,_4,u,a)
local car2 = createMarker  ( -322.39169, 1056.97058, 19.7422-1, "cylinder", s,Gta,_4,u,a)
local car3 = createMarker  ( -1408.56067, 2630.16528, 55.688-1, "cylinder", s,Gta,_4,u,a)
local car4 = createMarker  ( -2668.42334, 635.54651, 14.4531-1, "cylinder", s,Gta,_4,u,a)
local car5 = createMarker  ( -2190.48022, -2269.93091, 30.60-1, "cylinder", s,Gta,_4,u,a)
local jail = createMarker  ( -311.26492, 1486.46765, 75.9761-1, "cylinder", s,Gta,_4,u,a)
local car6 = createMarker  ( 222.793900, -81.857710, 1.57813-1, "cylinder", s,Gta,_4,u,a)
local car7 = createMarker  ( 1214.30835, 348.603360, 19.4643-1, "cylinder", s,Gta,_4,u,a)
local car8 = createMarker  ( 1188.00977, -1313.1793, 13.5642-1, "cylinder", s,Gta,_4,u,a)
local car9 = createMarker  ( 1535.81140, -1677.00000, 13.383-1, "cylinder", s,Gta,_4,u,a)
local car10 = createMarker ( 2001.44885, -1446.47241, 13.561-1, "cylinder", s,Gta,_4,u,a)
local car11 = createMarker ( 1682.7776, -2289.2639, 13.51236-1, "cylinder", s,Gta,_4,u,a)
local car12 = createMarker ( 1676.2478, -2242.96826, -2.6989-1, "cylinder", s,Gta,_4,u,a)

addEventHandler('onClientMarkerHit', root,
function ( hitPlayer )
if source == car1 or source == car2 or source == car3 or source == car4 or source == car5 or source == jail or source == car6 or source == car7 or source == car8 or source == car9 or source == car10 or source == car11 or source == car12 then
local Invehicle = getPlayerOccupiedVehicle ( localPlayer )
if not Invehicle then
if ( hitPlayer == localPlayer ) then
guiSetVisible ( window ,true )
showCursor( true )
guiSetInputEnabled(false)
end
end
end
end
)



انا مسوي هذا في سيرفري

  • Like 1
Link to comment
On Thursday, November 17, 2016 at 5:54 PM, MR.GRAND said:

PositionsTable = {	{ x, y, z, 'cylinder', Size, R, G, B, Alpha },	--{ x, y, z, 'cylinder', Size, R, G, B, Alpha },	--{ x, y, z, 'cylinder', Size, R, G, B, Alpha },	--{ x, y, z, 'cylinder', Size, R, G, B, Alpha },	--{ x, y, z, 'cylinder', Size, R, G, B, Alpha },}for _, value in ipairs( PositionsTable ) do	local Marker = createMarker( value[1], value[2], value[3], value[4], value[5], value[6], value[7], value[8], value[9] )	setElementData( Marker, 'isCarMarker', 'true' )endaddEventHandler( 'onClientMarkerHit', getRootElement(  ),function(  )	if ( getElementData( source, 'isCarMarker' ) == 'true' ) then		-- Your functions	endend )

سويته لك +

تقدر تضيف احداثيات وكل ماركر وخصائصه ^

لونه وحجمه ونوعه 

بالتوفيق ^_^

تسلم

  • Like 1
Link to comment
On ١٧‏/١١‏/٢٠١٦ at 6:54 PM, MR.GRAND said:

PositionsTable = {	{ x, y, z, 'cylinder', Size, R, G, B, Alpha },	--{ x, y, z, 'cylinder', Size, R, G, B, Alpha },	--{ x, y, z, 'cylinder', Size, R, G, B, Alpha },	--{ x, y, z, 'cylinder', Size, R, G, B, Alpha },	--{ x, y, z, 'cylinder', Size, R, G, B, Alpha },}for _, value in ipairs( PositionsTable ) do	local Marker = createMarker( value[1], value[2], value[3], value[4], value[5], value[6], value[7], value[8], value[9] )	setElementData( Marker, 'isCarMarker', 'true' )endaddEventHandler( 'onClientMarkerHit', getRootElement(  ),function(  )	if ( getElementData( source, 'isCarMarker' ) == 'true' ) then		-- Your functions
	end
end )

سويته لك +

تقدر تضيف احداثيات وكل ماركر وخصائصه ^

لونه وحجمه ونوعه 

بالتوفيق ^_^

 

تقدر تخليه كذا بدال الداتا

 

PositionsTable = {
	--{ x, y, z, 'cylinder', Size, R, G, B, Alpha },
	--{ x, y, z, 'cylinder', Size, R, G, B, Alpha },
}

for _, value in ipairs( PositionsTable ) do
	Marker = createMarker( value[1], value[2], value[3], value[4], value[5], value[6], value[7], value[8], value[9] )
end

addEventHandler( 'onClientMarkerHit', Marker,
function(  )
	-- Your functions
end )

 

Link to comment
5 hours ago, N3xT said:

تقدر تخليه كذا بدال الداتا

 


PositionsTable = {	--{ x, y, z, 'cylinder', Size, R, G, B, Alpha },	--{ x, y, z, 'cylinder', Size, R, G, B, Alpha },}for _, value in ipairs( PositionsTable ) do	Marker = createMarker( value[1], value[2], value[3], value[4], value[5], value[6], value[7], value[8], value[9] )endaddEventHandler( 'onClientMarkerHit', Marker,function(  )	-- Your functionsend )

 

مجرب الطريقة من قبل وتضبط على الماركر الأول فقط !

عشان كذا إستخدمت الداتا ^

هذا كلام عن تجربة سابقة عاد في الزمن الحالي ماعندي علم ;

Link to comment
1 hour ago, MR.GRAND said:

مجرب الطريقة من قبل وتضبط على الماركر الأول فقط !

عشان كذا إستخدمت الداتا ^

هذا كلام عن تجربة سابقة عاد في الزمن الحالي ماعندي علم ;

 

انا حالياً مستخدمها عندي بمود وشغالة معي, مدري عن قبل

  • Like 1
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...