HughJanus 244 Posted January 18, 2020 Posted January 18, 2020 (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 January 19, 2020 by HughJanus Quote
LMS 676 Posted January 18, 2020 Posted January 18, 2020 Perhaps you can check for an animation on either the NPC or the player to see at what stage the lasso-ing is. Quote
HughJanus 244 Posted January 18, 2020 Author Posted January 18, 2020 (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 January 20, 2020 by HughJanus new information, typo 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.