Jump to content

[HELP] Teleport all players to admin


Kutlu35

Recommended Posts

Hey , i wan't make teleport all players to admin script.

Example: I type "/getall" and every player in the server comes to me.

Can anybody help me with start ? 

I think that funcitions are usefully:

getElementPosition
setElementPosition
addCommandHandler

 

Link to comment
addCommandHandler('getall',function(plr)
  local acc=getPlayerAccount(plr)
    if not acc then return end
  	local accname=getAccountName(acc)
    if not isObjectInACLGroup('user.'..accname,aclGetGroup('Console')) then return end
  	local elements=getElementsByType('player')
    if #elements==0 then return end
    local x,y,z=getElementPosition(plr)
    local int=getElementInterior(plr)
    local dim=getElementDimension(plr)
    for k,v in ipairs(elements)do
      if v~=plr
      setElementDimension(v,dim)
      setElementInterior(v,int,x,y,z+2)
      outputChatBox('#33ff00you have been warapped to ['..getPlayerName(plr)..'#33ff00] by admin system ',v,255,255,255,true)
   end
      end
  end)

try this

Edited by Master_MTA
  • Thanks 1
Link to comment
5 hours ago, Master_MTA said:

addCommandHandler('getall',function(plr)
  local acc=getPlayerAccount(plr)
    if not acc then return end
  	local accname=getAccountName(acc)
    if not isObjectInACLGroup('user.'..accname,aclGetGroup('Console')) then return end
  	local elements=getElementsByType('player')
    if #elements==0 then return end
    local x,y,z=getElementPosition(plr)
    local int=getElementInterior(plr)
    local dim=getElementDimension(plr)
    for k,v in ipairs(elements)do
      if v~=plr
      setElementDimension(v,dim)
      setElementInterior(v,int,x,y,z+2)
      outputChatBox('#33ff00you have been warapped to ['..getPlayerName(plr)..'#33ff00] by admin system ',v,255,255,255,true)
   end
      end
  end)

try this

Oh thanks i'll test this today :D

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