Jump to content

Recommended Posts

Posted (edited)

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
Posted

Perhaps you can check for an animation on either the NPC or the player to see at what stage the lasso-ing is.

Posted (edited)

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
  • Like 1

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...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...