TuRisMo Posted March 4, 2012 Share Posted March 4, 2012 أنا عايز الكود اللي يخليني لما أمشي على المركر ياخذني لمكان تاني أنا أحددو وكيف أدمجو مع الـ .map ومشكورين Link to comment
Sparrow Posted March 4, 2012 Share Posted March 4, 2012 لم أقم بتجريبها بعد ستمشي إلى الموقع 1 1 5 المركر في وسط اللعبة local marker = createMarker(0, 0, 0, "cylinder", 2, 255, 0, 0, 255) function onMarkerEnter(player) setElementPosition(player, 5, 1, 1) outputChatBox("You has been moved to coordinate 5, 1, 1!", player, 0, 255, 0) else outputChatBox("Unknown error!", player, 255, 0, 0) end addEventHandler("onMarkerHit", marker, onMarkerEnter) Link to comment
abu5lf Posted March 4, 2012 Share Posted March 4, 2012 Example 1 This example creates a marker next to the player when they type 'createmarker': server -- this function is called whenever someone types 'createmarker' in the console: function consoleCreateMarker ( thePlayer, commandName ) if ( thePlayer ) then local x, y, z = getElementPosition ( thePlayer ) -- get the player's position -- create a cylindrical marker next to the player: local theMarker = createMarker ( x + 2, y + 2, z, "cylinder", 1.5, 255, 255, 0, 170 ) if ( theMarker ) then -- check if the marker was created successfully outputConsole ( "Marker created successfully", thePlayer ) else outputConsole ( "Failed to create marker", thePlayer ) end end end addCommandHandler ( "createmarker", consoleCreateMarker ) CreateMarker Link to comment
abozhrh Posted March 4, 2012 Share Posted March 4, 2012 جرب هذا client : local marker = createMarker(0, 0, 2, "cylinder", 2, 255, 0, 0, 255) function MarkerHit ( hitPlayer, marker ) outputChatBox ( " تم نقلك " ) setElementPosition(hitPlayer, 11, 5, 5) end addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit ) Link to comment
abozhrh Posted March 4, 2012 Share Posted March 4, 2012 لأضافته مع الماب جرب الطريقة التاليه اضيف ملف الماب مع السكربت ثم اضيف الماب في ملف meta : <meta> <info author="abozhrh" /> <script src="client.lua" type="client" /> <map src="mapname.map" /> </meta> 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