+Source|> Posted August 22, 2017 Share Posted August 22, 2017 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] ) ابيه يوزع سيارات للكل Link to comment
AHMED MOSTAFA Posted August 22, 2017 Share Posted August 22, 2017 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
+Source|> Posted August 22, 2017 Author Share Posted August 22, 2017 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
AHMED MOSTAFA Posted August 22, 2017 Share Posted August 22, 2017 Just now, A7MEDENO said: ترا انا ما اعف للداتا ممكن تقولي وش اكتب مكان "كمل الداتا ماهي صعبه ... مكان كمل بتضيفه بنفسك حسب فهمك للكود Link to comment
+Source|> Posted August 22, 2017 Author Share Posted August 22, 2017 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
SycroX Posted August 22, 2017 Share Posted August 22, 2017 (edited) و ليه يستعمل الداتا @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 August 22, 2017 by #x1AhMeD,-09 Link to comment
+Source|> Posted August 22, 2017 Author Share Posted August 22, 2017 (edited) 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 August 22, 2017 by A7MEDENO Link to comment
+Source|> Posted August 22, 2017 Author Share Posted August 22, 2017 (edited) 2 minutes ago, #x1AhMeD,-09 said: وش يقولك الدي بق ؟ ظبط خلاص انا كنت حاط البلاير فالفنكشن شلته وظبط مشكور Edited August 22, 2017 by A7MEDENO Link to comment
SycroX Posted August 22, 2017 Share Posted August 22, 2017 (edited) اوك Edited August 22, 2017 by #x1AhMeD,-09 Link to comment
AHMED MOSTAFA Posted August 22, 2017 Share Posted August 22, 2017 Just now, #x1AhMeD,-09 said: و ليه يستعمل الداتا @killerProject المفروض يقلل منها + الجداول في الحاله ذي هي اصح طريقه لماذا ؟ Link to comment
SycroX Posted August 22, 2017 Share Posted August 22, 2017 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. 1 Link to comment
AHMED MOSTAFA Posted August 22, 2017 Share Posted August 22, 2017 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now