Jump to content

مساعده في كود


Recommended Posts

 /loc playerrname:مثلاcommandفكره عمل الاسكربت : عندما يقوم الاعب بكتابه 

playername = اسم الاعب الذي يجب الذهاب اليه 

commandيقوم الاسكربت بعمل سهم فوق الاعب الذي كتب ال 

والسهم يشير الي اتجاه الاعب 

اخر ما توصلت اليه 

ملحوظه : الاكواد من علي wiki

 

--Client Side

function locatePlayer( sourcePlayer, command, who )
	local targetPlayer = getPlayerFromNick ( who )                
	if ( targetPlayer ) then                                      
		local x,y,z = getElementPosition ( sourcePlayer )     
		local xp,yp,zp = getElementPosition ( targetPlayer )  
		local dir = nil
		if (yp > y) then
			dir = "N"
		else
			dir = "S"
		end
		if (xp > x) then
			dir = dir .. "E"
		else
			dir = dir .. "W"
		end
		local distance = math.ceil ( getDistanceBetweenPoints3D(x, y, z, xp, yp, zp) )
		outputChatBox( who .. " found " .. dir .. " (" .. distance .. ")", sourcePlayer) 
	end
end
addCommandHandler ( "loc", locatePlayer )

 

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