Jump to content

Saml1er

Retired Staff
  • Posts

    1,058
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Saml1er

  1. You were banned for sharing a leaked gamemode that contained backdoors. In fact, you were even threatening the server owner that you'll leak his server database and you were boasting about it on your discord. It's pretty clear that you knew what you were doing. Your ban is temporary, you'll have to wait for it to expire. Appeal denied.

  2. local gateCommandWaitInMs = 3000 -- 3000 milliseconds. You can increase or decrease this value to meet your requirements
    local objectMovingTick = getTickCount() + gateCommandWaitInMs -- we are adding this to tick, so we don't have to wait for 3 seconds in first use
    gateLSPD = false
    x, y, z = getElementPosition ( source )
    if getDistanceBetweenPoints3D ( x, y, z, 1544.24707, -1631.90906, 13.38281 ) <= 2 then
        if (objectMovingTick - getTickCount()) < gateCommandWaitInMs then -- check if 3000 milliseconds have passed
            return 
        end 
        if gateLSPD == false then
            local rotX, rotY, rotZ = getElementRotation(shlagLSPD)
            moveObject ( shlagLSPD, 2000, 1544.6999511719, -1630.9000244141, 13.10000038147, 0, -80, 0 )
            gateLSPD = true
            else
            local rotX, rotY, rotZ = getElementRotation(shlagLSPD)
            moveObject ( shlagLSPD, 2000, 1544.6999511719, -1630.9000244141, 13.10000038147, 0, 80, 0 )
            gateLSPD = false
        end
      
        objectMovingTick = getTickCount()
    end

    You can use getTickCount to fix the problem.

  3. Delete all of your code from server.lua and client.lua. Copy-paste everything from ifp_demo and put this in client.lua at bottom of the file:

    addEventHandler("onClientResourceStart", resourceRoot,
        function()
            local ifpIndex = 7       
            ReplacePedBlockAnimations ( localPlayer, ifpIndex )
            triggerServerEvent ( "onCustomAnimationReplace", resourceRoot, localPlayer, ifpIndex )
        end
    )

     

  4. 3 hours ago, greentumbleweed said:

    my last question and the one i should have started with is what is "ifpIndex" is that the number or is that the block name

    
    --TestaddEventHandler("onClientResourceStart", resourceRoot,    function()        startingAnimations() -- call the function    end)function startingAnimations()    ReplacePedBlockAnimations ( source, 7 )end --ENDReplacePedBlockAnimations ( player, ifpIndex )-- i do not understand i tried 7 and nothing happens, also tried "GTA IV" still nothing

     

    "ifpIndex" is the index of the ifp file you want to load from globalLoadedIfps table, the table contains IFP data, like file path, new block name, the animations of the ifp file, etc.. Instead of sending an entire table via triggerServerEvent or triggerClientEvent which will use more internet bandwidth, we simply send an index of the required table for ifp which will be much faster. Also, can you please login as admin and execute /debugscript 3 on your server? It will show you errors within code on screen if there are any. Also, I just realized that source is also not defined here:

    function startingAnimations()
        ReplacePedBlockAnimations ( source, 7 ) -- Where is source defined? It is not a predefined variable.
    end 

    Correction:

    function startingAnimations()
        ReplacePedBlockAnimations ( localPlayer, 7 )
    end 

    localPlayer is a predefined variable on client side. It will always be valid. localPlayer is YOU. 

    More about predefined variables: https://wiki.multitheftauto.com/wiki/Predefined_variables_list

  5. 7 hours ago, greentumbleweed said:

    its at the bottom of the client

    Nope. You have only defined the function, you never call it. It's like you sit in a vehicle with no driver and you expect it to magically take you to your destination, that won't happen. You have to drive the vehicle, in the same way, you have to call this function. You call the function like this:

    startingAnimations()

    Ok, calling this function before the download will not work because the IFP has not loaded, so we'll use an event for it. Put this code snippet at the bottom of client.lua:

    addEventHandler("onClientResourceStart", resourceRoot,
        function()
            startingAnimations() -- call the function
        end
    )

     

  6. Okay, I can see everything's right here. Now tell me where you are calling startingAnimations function? You have defined the function but you never call it anywhere within the code which means the code never executes.

  7. 26 minutes ago, greentumbleweed said:

    so if i use ^ on client side will everything still be synchronize server side?

    No, I was talking to NmLa. I asked you a question but you didn't respond:

    12 hours ago, Saml1er said:

    where are you calling startingAnimations function? Also, can you show how globalLoadedIfps is defined? 

     

  8. 2 hours ago, NmLa said:

    is there are chance to add ninja's ifp for running?

    You can load any IFP file that was created for GTA VC and SA using:

    engineLoadIFP

    So yes, you can load the ifp file to MTA if you have it.

    • Like 1
×
×
  • Create New...