Jump to content

maksam07

Members
  • Posts

    55
  • Joined

  • Last visited

Posts posted by maksam07

  1. first option:

    function inArea( pos1, pos2, size )
    	x1, y1, _ = getElementPosition ( pos1 )
    	x2, y2, _ = getElementPosition ( pos2 )
    	local dis = getDistanceBetweenPoints2D( x1, y1, x2, y2 )
    	return size > dis
    end
    
    for i, pl in ipairs ( getElementsByType ( "player" ) ) do
    	if inArea( pl, marker, getMarkerSize ( marker ) ) then 
    		--
    	end
    end

    Then it will be possible to use a marker of any type, but the input / output events from the marker may not work correctly ( It does not seem important to me )

    Let me remind you that a bug with transparency only on the marker of the type "checkpoint"

  2. 28 minutes ago, NeXuS™ said:

    @maksam07, the tocolor thing won't work, as the syntax is not what he wrote. About changing the size of a colshape, you can't do it with just changing a variable. This is not a reference variable. After the colshape has been created the variable could be reassigned anything, and it would not effect the size of the colshape at all.

    I know all this. Just decided to prove to them that it will not work by example. Now I will test my sketches.
    By the way, do you understand me well? I use a translator

  3. 13 hours ago, SuperCroz said:

    What do you mean? Why not?

    But it does not work.

    local radius = 520
    local MySphere = createColSphere(0, 0, 3, radius)
    function changeMySphereSize( size )
    	radius = size
    	if ( radius > 10 ) then 
    		setTimer ( changeMySphereSize, 1000, 1, radius-1 )
    	end
    end
    setTimer ( changeMySphereSize, 1000, 1, radius-1 )

     

    error:

    9 hours ago, shay103 said:

    tocolor( r or 255, g or 255, b or 255, a or 0 )

     

  4. 4 minutes ago, SuperCroz said:

    Changing a colshape's size is pretty easy. You will just need to set the shape size at the creation as 'x' which should be globally defined as a number at first, and then create a function that modify x's value which will lead to change the colshapes' size.

    But the size does not change unless you create a collision again

  5. 14 minutes ago, NeXuS™ said:

    No, it's not possible without removing and then recreating it.

    In this and the problem, I would not want to delete. I still have an idea of how to do this with a different type of marker. Only you can not use the input and output events to it. I guess I later unsubscribe about results

  6. 29 minutes ago, NeXuS™ said:

    You can create a function which would do it for ya.

    Function that will change the size? Is this possible without the removal of collisions and creating a new one with a smaller size? I do not see other options

  7. On 10.08.2017 at 16:02, SuperCroz said:

    Why use a checkpoint when you can use colshapes, they are already invisible and come in plenty shapes; a tube, a cubid a sphere...

    I've considered this option before, but the problem is that collision can not change the size, as it can be done with the marker - SetMarkerSize. Or I'm wrong?

  8. 7 hours ago, DonOmar said:

    try this:

    and don't forget to change positions.

    
    function line3d()
    
        dxDrawLine3D(-1196.956, -1065.557, 128.218, -1196.686, -909.289, 128.200, tocolor(255, 255, 0, 255 ), 3)
    
    end
    
    addEventHandler("onClientRender", root, line3d)
    

    yes, i know that. 

    can you give me other a hint

  9. I create a marker and try twice to ask him the alpha

    local marker = createMarker ( ax, ay, 0, "checkpoint", aradius, r or 255, g or 255, b or 255, 0 )
    setElementAlpha(marker, 0)

    For the marker type cylinder it works, but for the checkpoint alpha type it does not work and the marker is visible

    Used:

    setElementVisibleTo( marker, getRootElement(), false ) 

    But then the marker is hidden on the map (I have markers getElementsByType ("marker"))

    Still tried it, but it does not work:

    for i, pl in ipairs ( getElementsByType("player") ) do
    	setElementVisibleTo ( marker, pl, false )
    end

     

    Found this problem on the bugtracker

    https://bugs.mtasa.com/view.php?id=7292

    The bug was discovered back in 2013 but still the problem remained. How can I solve the problem? I need the marker to be without the Z position

  10. Всем привет!

    На сервере в дебаге появляется ошибка при входе на сервер: ERROR "строка" exports: Call to non-running client resource (ресурс) [string '?']

    Дело в том, что ресурс запущен и добавлен в мтасервер перед всеми другими ресурсами. Где-то нагуглил что клиентские скрипты запускаются в разное время а не по порядку и вроде как проблема исправлена, или я просто не правильно понял. Возможно ли как то решить эту проблему? Если нужна еще инфа, говорите - дам.

  11. Кениксу спасибо большое за помощь. Смог написать антимат на сервер, не самый конечно хороший, но все же

    Теперь в чат выводятся сообщения формата: "ты [оск] [оск], понял??7"

    Так же эта функция работает и для англ слов, что очень хорошо. Не каждая такое может (работать и с русскими и англ символами)

  12. Kenix, сделал код по твоему примеру, но оно выводит Not Found. Разве так и должно быть?

    local aWords = 
    { 
        "Привет", 
        "Пока" 
    }; 
      
      
    function comm ( playersource ) 
        local sInputWord = "ПРивет"; 
        sInputWord = utf8.lower( sInputWord ); 
        for i, sWord in ipairs( aWords ) do 
            if sInputWord == sWord then 
                outputDebugString( "Found" ); 
                break; 
            end 
        end 
          
        outputDebugString( "Not Found" ); 
    end 
    addCommandHandler ( "qq", comm ) 
    

  13. Есть ли в луа функция, которая будет проверять слово игнорируя регистр букв?

    То бишь берем слово "привет", и в проверке "Привет", "привет", "ПРИвет" и т.д. функция будет возвращать true?

    Не знаю как лучше объяснить, но надеюсь кто-то меня поймет.

  14. юзалась элементдата в рендере с включенной синхронизацией с сервером

    у меня синхронизация будет выключена. мне только нужно получать значение для одного игрока. я выбрал этот метод, потому что он подходит как для серверной части, так и для клиентской

×
×
  • Create New...