البوابه
Team = "اسم الفريق"
local Object = createObject ( ID, x, y, z, rx, ry, rz )
local Marker = createMarker ( -11.482395172119, 2071.0393066406, 17.4921875, "cylinder", size, 0, 0, 0, 80 )
function OpenObject ( player )
if isElementWithinMarker ( player, Marker ) then
if ( getTeamName( getPlayerTeam( player ) ) == Team ) then
if not Open then
moveObject ( Object, 1500, moveX, moveY, moveZ )
else
moveObject ( Object, 1500, x, y, z )
end
Open = not Open
else
outputChatBox ( "* You aren't in ["..Team.."] team !", player, 200, 0, 0, true )
end
end
end
addEventHandler ( "onResourceStart", resourceRoot,
function ( )
for _, v in ipairs ( getElementsByType ( "player" ) ) do
bindKey ( v, "tab", "down", OpenObject )
end
end
)
addEventHandler ( "onPlayerJoin", root,
function ( )
bindKey ( source, "tab", "down", OpenObject )
end
)