Jump to content

كيف أعمل مركر ياخذني لمكان تاني


Recommended Posts

لم أقم بتجريبها بعد

ستمشي إلى الموقع 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

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

جرب هذا

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

لأضافته مع الماب جرب الطريقة التاليه

اضيف ملف الماب

مع السكربت

ثم اضيف الماب في ملف

meta :

<meta> 
<info author="abozhrh" /> 
<script src="client.lua" type="client" /> 
<map src="mapname.map"  /> 
</meta> 

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