Jump to content

مساعده


Recommended Posts

Just now, A7MEDENO said:

vec = {  }

if ( isElement( vec[source] ) ) then destroyElement( vec[source] ) end
local x, y, z = getElementPosition( root )
vec[source] = createVehicle( carid, x, y, z )
warpPedIntoVehicle( root, vec[source] )

ابيه يوزع سيارات للكل

for i, player in ipairs( getElementsByType("كمل") ) do
	--
	if isElement ( getElementData ( player, "كمل" ) ) then
		destroyElement ( getElementData ( كمل, "playersVehicle" ) )
	end
	--
	x, y, z = getElementPosition ( كمل )
	vehicle = كمل ( id, x, y, z )
	setElementData ( player, "playersVehicle", vehicle )
end

 

Link to comment
1 minute ago, killerProject said:

for i, player in ipairs( getElementsByType("كمل") ) do
	--
	if isElement ( getElementData ( player, "كمل" ) ) then
		destroyElement ( getElementData ( كمل, "playersVehicle" ) )
	end
	--
	x, y, z = getElementPosition ( كمل )
	vehicle = كمل ( id, x, y, z )
	setElementData ( player, "playersVehicle", vehicle )
end

 

 

1 minute ago, killerProject said:

for i, player in ipairs( getElementsByType("كمل") ) do
	--
	if isElement ( getElementData ( player, "كمل" ) ) then
		destroyElement ( getElementData ( كمل, "playersVehicle" ) )
	end
	--
	x, y, z = getElementPosition ( كمل )
	vehicle = كمل ( id, x, y, z )
	setElementData ( player, "playersVehicle", vehicle )
end

 

ترا انا ما اعف للداتا

ممكن تقولي وش اكتب مكان "كمل

Link to comment
9 minutes ago, killerProject said:

الداتا ماهي صعبه ... مكان كمل بتضيفه بنفسك حسب فهمك للكود

انا طفشت

هذي لازم الداتا فيها؟؟

شوف الحين اعتقد ظبطت

 

for i, v in ipairs( getElementsByType("player") ) do
		if isElement ( vec[source] ) then
		destroyElement ( vec[source] )
		end
		local x, y, z = getElementPosition ( v )
		vec[source] = createVehicle( carid, x, y, z )
		warpPedIntoVehicle( v, vec[source] )	
		end	

 

Link to comment

و ليه يستعمل الداتا  @killerProject المفروض يقلل منها + الجداول في الحاله ذي هي اصح طريقه

vec = {  }

for _,player in ipairs(getElementsByType("player")) do
	if ( isElement( vec[player] ) ) then destroyElement( vec[player] ) end
  		if isPedInVehicle(player) then removePedFromVehicle(player) end
		local x, y, z = getElementPosition( player )
		vec[player] = createVehicle( carid, x, y, z )
		warpPedIntoVehicle( player, vec[player] )
 	end
end

 

Edited by #x1AhMeD,-09
Link to comment
14 minutes ago, #x1AhMeD,-09 said:

و ليه يستعمل الداتا  @killerProject المفروض يقلل منها + الجداول في الحاله ذي هي اصح طريقه


vec = {  }

for _,player in ipairs(getElementsByType("player")) do
	if ( isElement( vec[player] ) ) then destroyElement( vec[player] ) end
  		if isPedInVehicle(player) then removePedFromVehicle(player) end
		local x, y, z = getElementPosition( player )
		vec[player] = createVehicle( carid, x, y, z )
		warpPedIntoVehicle( player, vec[player] )
 	end
end

 

هههه

مشكور خلاص ظبط

Edited by A7MEDENO
Link to comment

setElementData

Shared function
 
 

 

This function stores element data under a certain key, attached to an element. Element data set using this is then synced with all clients and the server. The data can contain server created elements, but you should avoid passing data that is not able to be synced such as xmlnodes, acls, aclgroups etc.

As element data is synced to all clients, it can generate a lot of network traffic and consume server CPU. Events are much more efficient for sending data from a client to the server only, or from the server to a specific client.

  • Like 1
Link to comment
Just now, #x1AhMeD,-09 said:

setElementData

Shared function
 
 

 

This function stores element data under a certain key, attached to an element. Element data set using this is then synced with all clients and the server. The data can contain server created elements, but you should avoid passing data that is not able to be synced such as xmlnodes, acls, aclgroups etc.

As element data is synced to all clients, it can generate a lot of network traffic and consume server CPU. Events are much more efficient for sending data from a client to the server only, or from the server to a specific client.

ذا يعتمد على قوة الخادم لكن شكراً على التنبيه على كل حال

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