[RELEASE] Animation Doorlock Car

Today I have for you an animation script for the key, it is normally under the U button but you can change it for download: https://github.com/AnonimowyXD/Animacja-Kluczyk

4 Likes

Hello, this is a friendly reminder because this is your first time creating a topic (or it has been a while since your last topic) in this category.

Please note that most of the support is provided by the FiveM community on a voluntary basis. We ask you to be patient; there is no guarantee we have a solution to your problem(s). To avoid unnecessary/duplicate topics, please browse the forums before creating a topic.

To improve your chances of your issue(s) being solved, please provide as much information as possible about the issue(s) you are having. Also —whenever possible— please use the template given to you when creating a topic.

Thanks for keeping these forums tidy!
:mascot:

1 Like

Screenshots? Videos? Information? Hello?

So this simply just plays an animation when you press “U”, alright… these topics are just getting worse and worse.

And what’s up with: StopAnimTask = true there’s seriously no point of having that in your code, it doesn’t do anything, you have not even defined its value in the beginning. Same with: if not lock then because you’ve never set lock to true, therefore you don’t even need that row.

1 Like

the animation is done for the key I was inspired by the Polish server where you can find something like this after clicking U opens or closes you car if you have the key you can change it and I did it because a few people asked on the forum.

I think you’re relating to this topic: [Release] LockSystem 3.1 (Updated the 07/16/2018) [BETA]
Why don’t you post your improvement in that section, where it actually belongs?

Either way, I think this might be one of your first releases, thank you for making new stuff for the community but please, check your code before releasing it because this is just… a mess…

You may use the following code:

Citizen.CreateThread(function()
    local dict = "anim@mp_player_intmenu@key_fob@"
    
    RequestAnimDict(dict)
    while not HasAnimDictLoaded(dict) do
        Citizen.Wait(0)
    end

    while true do
        Citizen.Wait(0)
        if IsControlJustPressed(1, 303) then -- When you press "U"
               TaskPlayAnim(GetPlayerPed(-1), dict, "fob_click_fp", 8.0, 8.0, -1, 48, 1, false, false, false)
        end
    end
end)
1 Like

okay, I understand this is my first job I did and I wanted to share it with people because I also wanted to see how it will be picked up and whether it will motivate to do other work

1 Like

could you create a function to check if the player is inside the car and block the animation?

I do not know, I will try and do not promise anything

Very Good but why a other script to start.
in your vehiclelock
add this in the last line

Citizen.CreateThread(function()
    local dict = "anim@mp_player_intmenu@key_fob@"
    
    RequestAnimDict(dict)
    while not HasAnimDictLoaded(dict) do
        Citizen.Wait(0)
    end

    while true do
        Citizen.Wait(0)
        if IsControlJustPressed(1, 303) then -- When you press "U"
               TaskPlayAnim(GetPlayerPed(-1), dict, "fob_click_fp", 8.0, 8.0, -1, 48, 1, false, false, false)
        end
    end
end)
	

Here:

Citizen.CreateThread(function()
    local dict = "anim@mp_player_intmenu@key_fob@"
    local playerped = GetPlayerPed(PlayerId())
    
    RequestAnimDict(dict)
    while not HasAnimDictLoaded(dict) do
        Citizen.Wait(0)
    end

    while true do
        Citizen.Wait(0)
        if IsControlJustPressed(1, 303) then -- When you press "U"
             if not IsPedInAnyVehicle(playerped, true) then 
               TaskPlayAnim(playerped, dict, "fob_click_fp", 8.0, 8.0, -1, 48, 1, false, false, false)
              else
                TriggerEvent("chatMessage", "", { 200, 0, 0 }, "You must be out of a vehicle to use this!") -- Shows this message when you are not in a vehicle in the chat
             end
        end
    end
end)

did not work for me

I will say the script works in 100% it is under u but you can change it to another button

Its amaizing what classifies as a release these days… Gonna release a print script next?

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0)
        if IsControlJustReleased(0, 38) then 
              print('give me admin')
        end
    end
end)

BUT ITS TRIGGERED BY A COMMAND! :upside_down_face:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.