Jump to content

= [ طلب فانكشنات ] =


Recommended Posts

السلام عليكم ورحمة الله وبركاته

يآشباب انا عامل  لوحه في 2 قريد ليست

و كل قريد ليست فيه كولمن

القريد لست الاول

 ابي يجي فيه

مثل

البدايه و  النخيل

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

 

و الثاني فيه

3 شخصيات

ممكن الفانكشنات الي احتاجهم 

مع شرح النقطه الي ذكرته فوق ^^

Link to comment
table = {} -- تسوي جدول في احدثيات الامكان مثال

table = {

{ "Al bdaidh", x,y,},

}

in ipairs

guiGridListAddRow

guiGridListSetItemText

guiGridListSetItemData

addEventHandler + "onClientGUIClick"

guiGridListGetSelectedItem

unpack + guiGridListGetItemData

setElementPosition

 

Edited by Le3bA
  • Like 2
Link to comment
Just now, Le3bA said:

 


table = {} -- تسوي جدول في احدثيات الامكان مثال

table = {

{ "Al bdaidh", x,y,},

}

in ipairs

guiGridListAddRow

guiGridListSetItemText

guiGridListSetItemData

addEventHandler + "onClientGUIClick"

guiGridListGetSelectedItem

unpack + guiGridListGetItemData

setElementPosition

طيب و الشخصيات

+ وضح شوي للآمآكن

Link to comment

سوي جدول

وحط فيه اسم المكان والاحداثيات .. 

مثال 

local Palces = { 
{ "Place (1)",X,Y,Z},
}

والشخصيات نفس الشيء . 

ثم سوي لوب

واستخدم الوظائف هاذي

 

guiGridListAddRow
guiGridListSetItemText
guiGridListSetItemData

 

ثم سوي يوم يظغط الزر 

guiGridListGetSelectedItem
guiGridListGetItemData
triggerServerEvent
setElementData 
spwnPlayer

--- Server : 

onPlayerWasted 
getElementData 
spawnPlayer
setCameraTarget

اعذرني م ادري وش فيه البوست !!

Edited by Default
.
  • Like 2
Link to comment
Just now, Default said:

سوي جدول

وحط فيه اسم المكان والاحداثيات .. 

مثال 


local Palces = { 
{ "Place (1)",X,Y,Z},
}

والشخصيات نفس الشيء . 

ثم سوي لوب

واستخدم الوظائف هاذي

 


guiGridListAddRow
guiGridListSetItemText
guiGridListSetItemData

 

ثم سوي يوم يظغط الزر 


guiGridListGetSelectedItem
guiGridListGetItemData
triggerServerEvent
setElementData 
spwnPlayer

--- Server : 

onPlayerWasted 
getElementData 
spawnPlayer
setCameraTarget

اعذرني م ادري وش فيه البوست !!

اوك اخوي مشكور بحآول 

 

Link to comment

سويت كذا لكن مايظهر شيء بي الجريد ليست

 ! للآمآكن سويت فقط

كلنت

Table = {

{ P = "البدايه",Px = -3414.95605, Py = -2990.36646, Pz = 15.06875 },
{ P = "النخيل", Px = 2122.06396 , py = 1410.29590 , Pz = 10.82031 },

}










		
		 for k,v in ipairs( Table ) do
     local row = guiGridListAddRow (GUIEditor.gridlist[1])
	 guiGridListSetItemText (GUIEditor.gridlist[1],row,1,v['p'] ,false,false)
   	 guiGridListSetItemText (GUIEditor.gridlist[1],row,1,v['Px,Py,Pz'],false,false)
	 guiGridListSetItemData (GUIEditor.gridlist[1],row,1,v['p'])
	 guiGridListSetItemData ( GUIEditor.gridlist[1],row,1,v['Px,Py,Pz'])
     guiGridListSetItemColor ( GUIEditor.gridlist[1],row,1, 255, 0, 0 )
     guiGridListSetItemColor ( GUIEditor.gridlist[1],row,1, 0, 255, 255 )

	end





 addEventHandler("onClientGUIClick",root,
		function ()
	
 if ( source == GUIEditor.button[22] ) then
	if guiGridListGetSelectedItem(GUIEditor.gridlist[1]) ~= -1 then
	 local x1,y1,z1 = guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1]), 1)
	 local myIData = guiGridListGetItemData ( GUIEditor.gridlist[1], row, 1 )
		
			end
		end
	end
)
				
	   triggerServerEvent('ReSp',localPlayer,x1,y1,z1)

سيرفر

addEvent("ReSp",true)
addEventHandler("ReSp",root,
	function ( x1,y1,z1 )
	
	setElementData(source,'DataRe','p')
	
	 spawnPlayer ( source, x1,y1, z1, 0, 46)
	
	
	end
)



addEventHandler( "onPlayerWasted", getRootElement( ),
	function()
	
		getElementData(source,'DataRe','p')
		
		setTimer( spawnPlayer, 2000, 1, source, x1,y1, z1 )
		setCameraTarget ( source )
	end
)

 

Edited by back!_
Link to comment

لمم تتم التجربة

 

-- Client

local Table = { 
{ "البدايه" , -3414.95605,-2990.36646,15.06875 },
{ "النخيل" , 2122.06396 , 1410.29590 , 10.82031 },
}

for index,value in ipairs ( Table ) do 
local row = guiGridListAddRow ( GUIEditor.gridlist[1] )
guiGridListSetItemText ( GUIEditor.gridlist[1] , row , 1 , value[1] , false , false )
guiGridListSetItemData ( GUIEditor.gridlist[1] , row , 1 , {value[2],value[3],value[4]} )
end

addEventHandler ( "onClientGUIClick" , root, function ( )
if ( source == GUIEditor.button[22] ) then 
local Selector = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) 
if ( Selector ~= -1 ) then 
local PositonX,PositionY,PositionZ = unpack ( guiGridListGetItemData ( GUIEditor.gridlist[1] , Selector , 1 ) )
triggerServerEvent ( "onSelectSpawn" , localPlayer , PositonX,PositionY,PositionZ )
end
end
end );

------ Server

addEvent ( "onSelectSpawn" , true )
addEventHandler ( "onSelectSpawn" , root , function ( PositonX,PositionY,PositionZ )
setElementData ( source , "SpawnPositions" , {PositonX,PositionY,PositionZ} )
spawnPlayer ( source , PositonX,PositionY,PositionZ , 0 , 0 , 0 )
setCameraTarget ( source , source )
end );

addEventHandler ( "onPlayerWasted" , root , function ( )
local x,y,z = unpack ( getElementData ( source , "SpawnPositions" ) )
if ( x and y and z ) then 
setTimer( spawnPlayer , 2000, 1, source, x,y, z )
setCameraTarget ( source , source )
end
end );

 

  • Like 1
Link to comment
Just now, Default said:

لمم تتم التجربة

 


-- Client

local Table = { 
{ "البدايه" , -3414.95605,-2990.36646,15.06875 },
{ "النخيل" , 2122.06396 , 1410.29590 , 10.82031 },
}

for index,value in ipairs ( Table ) do 
local row = guiGridListAddRow ( GUIEditor.gridlist[1] )
guiGridListSetItemText ( GUIEditor.gridlist[1] , row , 1 , value[1] , false , false )
guiGridListSetItemData ( GUIEditor.gridlist[1] , row , 1 , {value[2],value[3],value[4]} )
end

addEventHandler ( "onClientGUIClick" , root, function ( )
if ( source == GUIEditor.button[22] ) then 
local Selector = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) 
if ( Selector ~= -1 ) then 
local PositonX,PositionY,PositionZ = unpack ( guiGridListGetItemData ( GUIEditor.gridlist[1] , Selector , 1 ) )
triggerServerEvent ( "onSelectSpawn" , localPlayer , PositonX,PositionY,PositionZ )
end
end
end );

------ Server

addEvent ( "onSelectSpawn" , true )
addEventHandler ( "onSelectSpawn" , root , function ( PositonX,PositionY,PositionZ )
setElementData ( source , "SpawnPositions" , {PositonX,PositionY,PositionZ} )
spawnPlayer ( source , PositonX,PositionY,PositionZ , 0 , 0 , 0 )
setCameraTarget ( source , source )
end );

addEventHandler ( "onPlayerWasted" , root , function ( )
local x,y,z = unpack ( getElementData ( source , "SpawnPositions" ) )
if ( x and y and z ) then 
setTimer( spawnPlayer , 2000, 1, source, x,y, z )
setCameraTarget ( source , source )
end
end );

 

مشكور زبطت وش الغلط الي كان عندي 

+

يآ الغالي

لوآبي احط كذا سبآون 

عادي؟

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