Jump to content

overlocus

Members
  • Posts

    61
  • Joined

  • Last visited

Posts posted by overlocus

  1. 3 minutes ago, Mahlukat said:

    can you try this?

    
    addEventHandler("onClientChatMessage", getRootElement(),function(text)
    	if text == "login: You successfully logged in" then
    		cancelEvent() 
    	end
    end)
    

     

    client or server ?

  2. 30 minutes ago, Patrick2562 said:

    https://wiki.multitheftauto.com/wiki/Meta.xml

     

    Example: hide .lua file wich type is client

    
    <script src="client.lua" type="client" cache="false"/>	
    

     

     

    Or try to use 'fileDelete' function.

    https://wiki.multitheftauto.com/wiki/FileDelete

    I don't want fileDelete function because players don't want download server scripts again

    Do you have an another suggestion?

    MTA PUBG servers how hide their scripts?

    I want like their.

  3. local animationManagerWindow = false
    local replaceAnimationLabel, playAnimationLabel = nil, nil
    local restoreDefaultsButton, stopAnimationButton = nil, nil
    local replaceAnimationGridList, playAnimationGridList = nil, nil
    
    local isShowingAnimationBlocksInPlayGridList = true
    local currentBlockNameSelected = nil
    
    local isLocalPlayerAnimating = false
    
    local function PopulatePlayAnimationGridListWithBlocks ()
        isShowingAnimationBlocksInPlayGridList = true
        currentBlockNameSelected = nil
    
        guiGridListClear ( playAnimationGridList )
    
        -- Add IFP blocks to the play animation gridlist
        for customAnimationBlockIndex, customAnimationBlock in ipairs ( globalLoadedIfps ) do 
            local rowIndex = guiGridListAddRow ( playAnimationGridList, " + "..customAnimationBlock.friendlyName )
            guiGridListSetItemData ( playAnimationGridList, rowIndex, 1, customAnimationBlockIndex )
        end
    end
    
    local function PopulatePlayAnimationGridListWithCustomBlockAnimations ( ifpIndex )
        isShowingAnimationBlocksInPlayGridList = false
        currentBlockNameSelected = globalLoadedIfps [ifpIndex].blockName
    
        guiGridListClear ( playAnimationGridList )
        guiGridListAddRow ( playAnimationGridList, ".." )
    
        -- Add IFP blocks to the play animation gridlist
        for _, customAnimationName in ipairs ( globalLoadedIfps [ifpIndex].animations ) do 
            local rowIndex = guiGridListAddRow ( playAnimationGridList, "  "..customAnimationName )
            guiGridListSetItemData ( playAnimationGridList, rowIndex, 1, customAnimationName )
        end
    end
    
    addEventHandler("onClientResourceStart", resourceRoot,
        function()
            triggerServerEvent ( "onCustomAnimationSyncRequest", resourceRoot, localPlayer )
    
            outputChatBox ("#ffffff[#0080FF ✭ Dolunay ✭ #ffffff]#ffffff X #0080FFtusuna animasyon menüsünü kapatabilirsin.", 255, 255, 255,true)
    
            showCursor ( true )
    
            animationManagerWindow = guiCreateWindow(118, 116, 558, 371, "Animation Manager", false)
            guiWindowSetSizable(animationManagerWindow, false)
    
            replaceAnimationLabel = guiCreateLabel(12, 26, 245, 19, "Replace Animations With", false, animationManagerWindow)
            guiSetFont(replaceAnimationLabel, "default-bold-small")
            guiLabelSetHorizontalAlign(replaceAnimationLabel, "center", false)
    
            replaceAnimationGridList = guiCreateGridList(12, 49, 245, 255, false, animationManagerWindow)
            guiGridListAddColumn(replaceAnimationGridList, "Animation Blocks", 0.9)
            
            restoreDefaultsButton = guiCreateButton(49, 314, 174, 41, "Restore Defaults", false, animationManagerWindow)
            playAnimationLabel = guiCreateLabel(294, 26, 245, 19, "Play Animation", false, animationManagerWindow)
            guiSetFont(playAnimationLabel, "default-bold-small")
            guiLabelSetHorizontalAlign(playAnimationLabel, "center", false)
            
            stopAnimationButton = guiCreateButton(329, 314, 174, 41, "Stop Animation", false, animationManagerWindow)
            playAnimationGridList = guiCreateGridList(294, 49, 245, 255, false, animationManagerWindow)
            guiGridListAddColumn(playAnimationGridList, "Animation Blocks", 0.9)
    
            -- load IFP files and add them to the play animation gridlist
            for customAnimationBlockIndex, customAnimationBlock in ipairs ( globalLoadedIfps ) do 
                local ifp = engineLoadIFP ( customAnimationBlock.path, customAnimationBlock.blockName )
                if not ifp then
                end
            end
    
            -- now add replaceable ifps to the other grid list
            for _, ifpIndex in ipairs ( globalReplaceableIfpsIndices ) do 
                local customAnimationBlock = globalLoadedIfps [ ifpIndex ]
                local rowIndex = guiGridListAddRow ( replaceAnimationGridList, customAnimationBlock.friendlyName )
                guiGridListSetItemData ( replaceAnimationGridList, rowIndex, 1, ifpIndex )
            end
    
            PopulatePlayAnimationGridListWithBlocks ()
        end
    ) 
    
    local function ReplacePedBlockAnimations ( player, ifpIndex )
        local customIfpBlockName = globalLoadedIfps [ ifpIndex ].blockName
        for _, animationName in pairs ( globalPedAnimationBlock.animations ) do 
            -- make sure that we don't replace a partial animation
            if not globalPedAnimationBlock.partialAnimations [ animationName ] then 
                engineReplaceAnimation ( player, "ped", animationName, customIfpBlockName, animationName )
            end
        end
    end 
    
    local function HandleReplacedAnimationGridListDoubleClick ()
        local replacedAnimGridSelectedRow, replacedAnimGridSelectedCol = guiGridListGetSelectedItem ( replaceAnimationGridList ); 
        if replacedAnimGridSelectedRow and replacedAnimGridSelectedRow ~= -1 then 
            local ifpFriendlyName = guiGridListGetItemText( replaceAnimationGridList, replacedAnimGridSelectedRow, replacedAnimGridSelectedCol ) 
            local ifpIndex = guiGridListGetItemData(replaceAnimationGridList, replacedAnimGridSelectedRow, replacedAnimGridSelectedCol )
            ReplacePedBlockAnimations ( localPlayer, ifpIndex )
            triggerServerEvent ( "onCustomAnimationReplace", resourceRoot, localPlayer, ifpIndex )
        end
    end 
    
    local function HandlePlayAnimationGridListDoubleClick ()
        local playAnimGridSelectedRow, playAnimGridSelectedCol = guiGridListGetSelectedItem ( playAnimationGridList ); 
        if playAnimGridSelectedRow and playAnimGridSelectedRow ~= -1 then 
            local itemText = guiGridListGetItemText( playAnimationGridList, playAnimGridSelectedRow, playAnimGridSelectedCol )
            if isShowingAnimationBlocksInPlayGridList then  
                local ifpIndex = guiGridListGetItemData(playAnimationGridList, playAnimGridSelectedRow, playAnimGridSelectedCol )
                PopulatePlayAnimationGridListWithCustomBlockAnimations ( ifpIndex )
            else
                if itemText == ".." then 
                    PopulatePlayAnimationGridListWithBlocks ( )
                else
                    local animationName = guiGridListGetItemData(playAnimationGridList, playAnimGridSelectedRow, playAnimGridSelectedCol )
                    setPedAnimation ( localPlayer, currentBlockNameSelected, animationName )
                    triggerServerEvent ( "onCustomAnimationSet", resourceRoot, localPlayer, currentBlockNameSelected, animationName )
                    isLocalPlayerAnimating = true
                end
           end
        end 
    end 
    
    addEventHandler( "onClientGUIDoubleClick", resourceRoot,
        function ( button, state, absoluteX, absoluteY )
            if button == "left" and state == "up" then 
                if source == replaceAnimationGridList then 
                    HandleReplacedAnimationGridListDoubleClick ( )
                elseif source == playAnimationGridList then 
                    HandlePlayAnimationGridListDoubleClick ( )
                end 
            end
        end 
    )
    
    addEventHandler( "onClientGUIClick", resourceRoot,
        function ( button, state )
            if button == "left" and state == "up" then 
                if source == restoreDefaultsButton then 
                    -- restore all replaced animations of "ped" block
                    engineRestoreAnimation ( localPlayer, "ped" )
                    triggerServerEvent ( "onCustomAnimationRestore", resourceRoot,  localPlayer, "ped" )
                    outputChatBox ("Restored ped block animations", 255, 255, 255)
                elseif source == stopAnimationButton then 
                    setPedAnimation ( localPlayer, false )
                    triggerServerEvent ( "onCustomAnimationSet", resourceRoot, localPlayer, false, false )
                end 
            end
        end 
    )
     
    bindKey ( "X", "down", 
        function ( key, keyState )
            if ( keyState == "down" ) then
                local isAnimationMangerWindowVisible = guiGetVisible ( animationManagerWindow )
                guiSetVisible ( animationManagerWindow, not isAnimationMangerWindowVisible )
                showCursor ( not isAnimationMangerWindowVisible )
            end
        end
    )
    
    addEvent ("onClientCustomAnimationSyncRequest", true )
    addEventHandler ("onClientCustomAnimationSyncRequest", root,
        function ( playerAnimations )
            for player, anims in pairs ( playerAnimations ) do 
                if isElement ( player ) then 
                    if anims.current then 
                        setPedAnimation ( player, anims.current[1], anims.current[2] ) 
                    end
                    if anims.replacedPedBlock then 
                        ReplacePedBlockAnimations ( player, anims.replacedPedBlock )
                    end
                end
            end 
        end 
    )
    
    addEvent ("onClientCustomAnimationSet", true )
    addEventHandler ("onClientCustomAnimationSet", root,
        function ( blockName, animationName )
            if source == localPlayer then return end
            if blockName == false then 
                setPedAnimation ( source, false )
                return
            end 
            setPedAnimation ( source, blockName, animationName )
        end 
    )
    
    addEvent ("onClientCustomAnimationReplace", true )
    addEventHandler ("onClientCustomAnimationReplace", root,
        function ( ifpIndex )
            if source == localPlayer then return end
            ReplacePedBlockAnimations ( source, ifpIndex )
        end 
    )
    
    addEvent ("onClientCustomAnimationRestore", true )
    addEventHandler ("onClientCustomAnimationRestore", root,
        function ( blockName )
            if source == localPlayer then return end
            engineRestoreAnimation ( source, blockName )
        end 
    )
    
    
    setTimer ( 
        function ()
            if isLocalPlayerAnimating then 
                if not getPedAnimation (localPlayer) then
                    isLocalPlayerAnimating = false
                    triggerServerEvent ( "onCustomAnimationStop", resourceRoot, localPlayer )
                end
            end
        end, 100, 0
    )

    I didn't find this event handlers.

  4. On 21/10/2018 at 14:06, DeadthStrock said:

    did you checkout IFP_demo before ? because you can get an idea about how to synchronize a custom anim from it.

    Is this script prove all player can see everyone's animations?

    Can everyone see each other's animations?

  5. I have custom walking animations. (ped anim)

    But this script seems only me too. No one else can see

    I want everyone can see all players animations see

    (Sorry my bad english.)

    local animTable = {
    
    	ifp = {},
    
    	anims = {
    		"abseil",  (EXAMPLE)
    		"WOMAN_walkshop",
    		"XPRESSscratch"
    	}
    
    }
    
    addEventHandler("onClientResourceStart", resourceRoot,
    	function()
    
    		animTable.ifp["block"] = "ped"
    		animTable.ifp["ifp"] = engineLoadIFP("ped.ifp", animTable.ifp["block"])
    
    		for _, v in ipairs(animTable.anims) do
    			engineReplaceAnimation(localPlayer, "ped", v, animTable.ifp["block"], v)
    		end
    
    	end
    )

     

  6. 12 hours ago, ZoNe said:
    
    addEventHandler("onPlayerCommand", root, 
    function(command) 
         if command == "me" then 
              cancelEvent() 
         end 
    end) 
    

     

    Is there no way to find this script?

  7. This is my spawnmanager script but i have a problem.

    addEventHandler("onResourceStart", resourceRoot,
    	function()
    		resetMapInfo()
    		for i,player in ipairs(getElementsByType("player")) do
    			spawn(player)
    		end
    	end
    )
    
    function spawn(player)
    	if not isElement(player) then return end
    	repeat until spawnPlayer ( player, 835.6+math.random(1,5), -2081.6000976563+math.random(5,9), 12.59999961853, 180, 290, 0, 0)
    	fadeCamera(player, true)
    	setCameraTarget(player, player)
    	showChat(player, true)
    end
    
    addEventHandler("onPlayerJoin", root,
    	function()
    		spawn(source)
    	end
    )
    
    addEventHandler("onPlayerWasted", root,
    	function()
    		setTimer(spawn, 1800, 1, source)
    	end
    )

    How can i change spawn skin?

    I want the starting character to be the character before the die. 

    pls help

×
×
  • Create New...