Jump to content

Featured Replies

Posted

Hey guys,

 

I want to disarm NPCs when I got them lasso-ed automatically, but I havent found out yet how to determine wheter I got an NPC lasso-ed or not.

Can anyone give some advice?

 

BR

HJ

Edited by HughJanus

  • Author

Are animation names or IDs known yet? Cant seem to find them.

Or was this just a general hint?

 

Edit:

I found a mod online which uses C# code to do something similar (source: https://www.nexusmods.com/reddeadredemption2/mods/155)

I adapted the code a little and used the following:

Player player = PLAYER::PLAYER_ID();
Ped playerPed = PLAYER::PLAYER_PED_ID();
Entity target = playerPed;
Hash lassoHash = GAMEPLAY::GET_HASH_KEY("WEAPON_LASSO");

if (WEAPON::HAS_PED_GOT_WEAPON(playerPed, lassoHash, 0, 0))
{
	Hash lassoHash2;
	if (WEAPON::GET_CURRENT_PED_WEAPON(playerPed, &lassoHash2, 1, 0, false))
	{
		if (lassoHash == lassoHash2)
		{
			if (target != playerPed)
			{
				//DO SOMETHING WITH LASSO-ED PED
			}
			if (PED::IS_PED_SHOOTING(playerPed))
			{
				Entity playerTarget;
				if (PLAYER::GET_ENTITY_PLAYER_IS_FREE_AIMING_AT(player, &playerTarget))
				{
					target = playerTarget;
				}
			}
		}
	}
}

 

Edited by HughJanus
new information, typo

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...