[Release] PTTPoliceRadio

Yeah we’ve got it in, havent been able to set that particular animation to a hot key yet

There is IsPedArmed which is what I was trying it with. I want it to be able to play a different animation when a weapon is in your hand and the button is pushed. If there is no weapon then it plays the original.

I’ll see what I can do. :slight_smile:

@xander1998 and @Deziel0495

Xander you have that K9 script that checks if player is certain models, is there anyway you could both implement that into this? It’s just that when it’s bound to my Teamspeak PTT button I don’t want to necessarily be doing the animation when I’m civ.

I’ll mess around with some of the stuff and let you know. I believe I used this in one of my earlier scripts (not released), it’s been a while but I’ll take a look at it again:
http://runtime.fivem.net/doc/reference.html#_0x3A87E44BB9A01D54

1 Like

awesome :star_struck:

@Deziel0495 For some reason using this:

return GetCurrentPedWeapon(PlayerPedId(), GetHashKey("WEAPON_PISTOL"), 1)

Always returns 1 (true) (no matter which weapon you enter in the GetHashKey()) if the player has any type of weapon equipped. If they’re unarmed it returns false. Would this solve the issue or are you looking to check specifically for a gun in someone’s hand?

1 Like

No that should work fine. I’m going to try a few things and see where it gets me.

1 Like

UPDATE: Posted a temporary workaround for being unable to aim until a better solution is drafted.

I’m looking into the option of restricting the script to only work for police/sheriff peds. However I cannot promise this will be implemented. If someone has already done this and would like to share the code, by all means.

1 Like

I don’t mind if my code is used in this script as long as proper credits are set.

You could just make a table then get the players skin, if they match then do …

Don’t believe I know how to do that… I think my code would have to be re-written for it to work anyway.

Not really. Just need to make functions to return true or false and set it in an if statement.

Something like this should do the trick

skins = {
    GetHashKey("s_m_y_cop_01"),
    GetHashKey("s_f_y_cop_01"),
}

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0)
        if checkskin() then
            print("Code goes here!")
        end
    end
end)

function checkskin()
    for i = 1, #skins do
        if skins[i] == GetEntityModel(PlayerPedId()) then
            return true
        end
    end
    return false
end

Tried it, Fixed it :stuck_out_tongue:

Don’t index the value otherwise your script won’t adapt to adding more peds to your table use the k instead.

New version just published that restricts usage to LEO’s only. A very special thank you to @sadboilogan for providing the code.

3 Likes

hey @Deziel0495 can u make a similar script but with the holster as well when to hold the button and release.

I’m actually working on that right now. :slight_smile:

1 Like

Update posted adding the gun holster animation.

1 Like

Heyy… lets see a video or gif of that bad boy!

2 Likes