Not inplemented or broken native


#1

i cant seem to get this native working

PlayEntityAnim()

i am using this

PlayEntityAnim(vaultDOOR, "bank_vault_door_opens", "anim@heists@fleeca_bank@bank_vault_door", 4.0, false, false, 0, 0.0, 8)

ive tried multiple ways like using the ped animation native to no avail
is there any other way to make an animation play on an object?
and this is from the decompiled scripts

bool func_3548(int iParam0, int iParam1)//Position - 0x139722
{
	if (entity::does_entity_exist(iParam0))
	{
		if (func_3557(iParam1))
		{
			if (!gameplay::is_bit_set(iLocal_10281, 25))
			{
				func_3556();
				if (func_3555())
				{
					entity::play_entity_anim(iParam0, "bank_vault_door_opens", "anim@heists@fleeca_bank@bank_vault_door", 4f, false, 1, 0, 0f, 8);
					entity::force_entity_ai_and_animation_update(iParam0);
					gameplay::set_bit(&iLocal_10281, 25);
				}
			}
			else if (entity::is_entity_playing_anim(iParam0, "anim@heists@fleeca_bank@bank_vault_door", "bank_vault_door_opens", 3))
			{
				if (entity::get_entity_anim_current_time(iParam0, "anim@heists@fleeca_bank@bank_vault_door", "bank_vault_door_opens") >= 1f)
				{
					entity::freeze_entity_position(iParam0, true);
					entity::stop_entity_anim(iParam0, "bank_vault_door_opens", "anim@heists@fleeca_bank@bank_vault_door", -1000f);
					entity::set_entity_rotation(iParam0, entity::get_entity_rotation(iParam0, 2) + Vector(-80f, 0f, 0f), 2, 1);
					entity::force_entity_ai_and_animation_update(iParam0);
					streaming::set_model_as_no_longer_needed(func_3549(16, 0));
					return true;
				}
			}
		}
	}
	return false;
}

#2

show your full code

also this isnt a feature request, moved to scripting


#3
 local doorToggle = true
 local animStep = 0
 local t = true
	while true do
		 
	if not HasAnimDictLoaded("anim@heists@fleeca_bank@bank_vault_door") then
          RequestAnimDict("anim@heists@fleeca_bank@bank_vault_door")
	 Citizen.Wait(1)
	end
	
		Citizen.Wait(0)	 
	if DoesEntityExist(GetClosestObjectOfType(-104.6049, 6473.444, 31.79532, 20.0, -1185205679, 0, 1, 0)) then
	 vaultDOOR = GetClosestObjectOfType(-104.6049, 6473.444, 31.79532, 20.0, -1185205679, 0, 0, 0)
     --netVaultDOOR = NetworkGetNetworkIdFromEntity(vaultDOOR)
     SetNetworkIdExistsOnAllMachines(vaultDOOR, 1)
	 netVaultDOOR = NetworkGetNetworkIdFromEntity(vaultDOOR)
	      entityHeading = GetEntityHeading(vaultDOOR)
		  netEntityHeading = GetEntityHeading(netVaultDOOR)
--this gets the entity coords
		entityCoords = GetEntityCoords(vaultDOOR)
		entityCoords1 = GetEntityCoords(netVaultDOOR)
        vaultDOORClosedCoords = {}
		vaultDOORClosedCoords.x = -104.6049
		vaultDOORClosedCoords.y = 6473.444
		vaultDOORClosedCoords.z = 31.79532
		vaultDOORClosedHeading = 43.995
		vaultDOOROPenHeading = 155.994
--this splits up the coords 
		entityX = entityCoords.x
		entityY = entityCoords.y
		entityZ = entityCoords.z
		entityX1 = entityCoords1.x
		entityY1 = entityCoords1.y
		entityZ1 = entityCoords1.z		  
--this gets the entity rotation
		entityRot = GetEntityRotation(vaultDOOR, 2, 1)
		entityRot1 = GetEntityRotation(netVaultDOOR, 2, 1)		
--this splits up the rotation 
		entityRotX = entityRot.x
	    entityRotY = entityRot.y
		entityRotZ = entityRot.z
		entityRotX1 = entityRot1.x
	    entityRotY1 = entityRot1.y
		entityRotZ1 = entityRot1.z

	 if doorToggle == true and t == true then
     	 Citizen.Trace("--------------------- "..tostring(t))
          --Citizen.Trace("vault door animation step "..tostring(animStep))
	  	  --SetEntityHeading(vaultDOOR, vaultDOORClosedHeading + animStep)
		  --SetEntityHeading(netVaultDOOR, vaultDOORClosedHeading + animStep)
		  PlayEntityAnim(vaultDOOR, "bank_vault_door_opens", "anim@heists@fleeca_bank@bank_vault_door", 1, 0, 0, 0, 0, 0)
		  --PlayEntityAnim(vaultDOOR, "bank_vault_door_opens", "anim@heists@fleeca_bank@bank_vault_door", 4.0, false, 1, 0, 0.0, 8)
		  ForceEntityAiAndAnimationUpdate(vaultDOOR)
		  --PlayEntityAnim(netVaultDOOR, "bank_vault_door_opens", "anim@heists@fleeca_bank@bank_vault_door", 4.0, false, 1, 0, 0.0, 8)
		  --ForceEntityAiAndAnimationUpdate(netVaultDOOR)
		t = false  
	 end
	 if doorToggle == true then
	  --SetEntityHeading(vaultDOOR, vaultDOOROPenHeading)
	  --SetEntityHeading(netVaultDOOR, vaultDOOROPenHeading)
	 end
     if IsControlJustPressed(0, 38) then
	   doorToggle = not doorToggle
	    t = not t
       --FreezeEntityPosition(vaultDOOR, false)
	   --SetEntityHeading(vaultDOOR, entityHeading +2.0)
	   --SetEntityHeading(netVaultDOOR, netEntityHeading +2.0)
	   --SetEntityHeading(vaultDOOR, vaultDOORClosedHeading)
	   --SetEntityHeading(netVaultDOOR, vaultDOORClosedHeading)
	    Citizen.Trace("vault door animation step "..tostring(animStep))
	    Citizen.Trace("vault door toggle "..tostring(doorToggle))
	    Citizen.Trace("vault door local ID "..vaultDOOR)
		Citizen.Trace('vault door net ID '..netVaultDOOR)
		Citizen.Trace('vault door local heading '..entityHeading)
		Citizen.Trace('vault door net heading '..vaultDOOROPenHeading)
	 end
     if IsControlJustPressed(0, 21) then
		RefreshInterior(GetInteriorFromEntity(GetPlayerPed()))
	 end	
    end
	end
end)```

#4

hello? i posted my whole code?