[Confused] Playing Animation On The Player

@COndor I’m not sure what you are trying to do?
I was talking about my plugin using the commands /arrest /cuff :S
I add the player to an array when they join like this { playerid=“Name” }
so when I join the array will be { “Lex_The_Great”=1 } then I check if the argument playername is in the array

-- Server
Players = {}
function addPlayer(source, name) -- addPlayer(source, "Lex_The_Great") <- Source is from the function onPlayerConnect. "Lex_the_Great" is from GetPlayerName(source)
    if (Players[name] == nil) then
        Players[name] = source
    end
end

function getPlayerByName(name)
    if (Players[name] ~= nil) then
        return Players[name] -- <- Int is the array
    end
    return false
end

Then I check the argument from /arrest with getPlayerByName(playername) for the ID

But @GanjaMonster posted something that might have a better way to get all the players :S

1 Like

try to set 8.00001 instead of 8.0

1 Like

so where would i put that in the server lua file or client lua file?
i have

TriggerClientEvent('ticket', target)

Citizen.CreateThread(function()
    local pid = PlayerPedId()
    RequestAnimDict("amb")
    RequestAnimDict("[email protected]")
    RequestAnimDict("[email protected]@timeofdeath")
    while (not HasAnimDictLoaded("[email protected]@timeofdeath")) do Citizen.Wait(0) end
    TaskPlayAnim(pid,"[email protected]","idle_b_timeofdeath",1.0,-1.0, 5000, 0, 1, true, true, true)
end)

in server.lua should that be in client.lua?

1 Like

keep in mind when you find the " TriggerClientEvent " it means that it currently is on server side
if it was on client side it would be like this for client events " TriggerEvent "
this should solve most of the confusion you will get from some codes on the forum