Jump to content

Recommended Posts

Posted (edited)

UPDATE: The topic is marked as solved in terms of that I wanted to find out how to hogtie the player in singleplayer. The issue relating to how to use TASK::TASK_HOGTIE_TARGET_PED remains unsolved. If you want to hogtie the player then use the following line of code below:

TASK::TASK_KNOCKED_OUT_AND_HOGTIED(PLAYER::PLAYER_PED_ID(), 1, 0); // The last parameter is actually a bool but the native database has it as a int parameter.

 

It may seem odd to some, but does anyone know how to use TASK::TASK_HOGTIE_TARGET_PED correctly? (Please provide example code as it would be much easier that way.). I tried using it after spawning a ped, but it did not work. Here is the code I used:

//Gets the player's coords
Vector3 plCoords = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), true, false);
//Spawns a ped
Ped myped = spawnPed(MISC::GET_HASH_KEY("a_m_m_armtownfolk_01"), plCoords.x + 2, plCoords.y, plCoords.z);
//The function I need help with.
TASK::TASK_HOGTIE_TARGET_PED(myped, PLAYER::PLAYER_PED_ID());

//Custom method(function) I used to spawn ped. It was made by crossed99. Source: https://www.rdr2mods.com/forums/topic/1296-solved-how-to-spawn-ped-from-c-script-hook/
Ped spawnPed(Hash pedModel, float coordX, float coordY, float coordZ)
{
	STREAMING::REQUEST_MODEL(pedModel, true);
	while (!STREAMING::HAS_MODEL_LOADED(pedModel)) WAIT(0);
	Ped pedSpawn = PED::CREATE_PED(pedModel, coordX, coordY, coordZ, 0, 1, 1, 1, 1);
	PED::_SET_RANDOM_OUTFIT_VARIATION(pedSpawn, 1);
	ENTITY::PLACE_ENTITY_ON_GROUND_PROPERLY(pedSpawn, 1);
	ENTITY::FREEZE_ENTITY_POSITION(pedSpawn, 0);
	STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(pedModel);
	return pedSpawn;
}

I am not sure if it makes a difference if you use the function on a player ped instead of a npc ped.

Edited by WesternGamer
Posted

If you wan't the player to hogtie the spawned ped then I think it needs to be the other way around like this: 

TASK::TASK_HOGTIE_TARGET_PED(PLAYER::PLAYER_PED_ID(), myped);

I haven't tried but I guess the target might needs to be knocked out for it to work.

Posted

You could try TASK_MELEE: ped, pedToHogtie, 892442958, 0, 1, 1f, 1, -1082130432

Posted
1 hour ago, LMS said:

You could try TASK_MELEE: ped, pedToHogtie, 892442958, 0, 1, 1f, 1, -1082130432

@LMS Tried that but it did not work. Here is my code:

//Gets the player's coords
Vector3 plCoords = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), true, false);
//Spawns a ped
Ped myped = spawnPed(MISC::GET_HASH_KEY("a_m_m_armtownfolk_01"), plCoords.x + 2, plCoords.y, plCoords.z);
//The function that does not work.
TASK::TASK_MELEE(PLAYER::PLAYER_PED_ID(), myped, 892442958, 0, 1, (FLOAT)1, 1, -1082130432);

//Custom method(function) I used to spawn ped. It was made by crossed99. Source: https://www.rdr2mods.com/forums/topic/1296-solved-how-to-spawn-ped-from-c-script-hook/
Ped spawnPed(Hash pedModel, float coordX, float coordY, float coordZ)
{
	STREAMING::REQUEST_MODEL(pedModel, true);
	while (!STREAMING::HAS_MODEL_LOADED(pedModel)) WAIT(0);
	Ped pedSpawn = PED::CREATE_PED(pedModel, coordX, coordY, coordZ, 0, 1, 1, 1, 1);
	PED::_SET_RANDOM_OUTFIT_VARIATION(pedSpawn, 1);
	ENTITY::PLACE_ENTITY_ON_GROUND_PROPERLY(pedSpawn, 1);
	ENTITY::FREEZE_ENTITY_POSITION(pedSpawn, 0);
	STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(pedModel);
	return pedSpawn;
}

 

Posted (edited)
2 hours ago, crossed99 said:

If you wan't the player to hogtie the spawned ped then I think it needs to be the other way around like this: 


TASK::TASK_HOGTIE_TARGET_PED(PLAYER::PLAYER_PED_ID(), myped);

I haven't tried but I guess the target might needs to be knocked out for it to work.

@crossed99 Your code did work with the ped knocked out but do you know how to do this to the player? I tested the same code on the player but it did not work. Maybe the ped needs to have the lasso in their inventory.

Edited by WesternGamer
Posted (edited)
3 hours ago, WesternGamer said:

@crossed99 Your code did work with the ped knocked out but do you know how to do this to the player? I tested the same code on the player but it did not work. Maybe the ped needs to have the lasso in their inventory.

I have no idea.. There are things like TASK_HOGTIEABLE or SET_PED_CAN_BE_INCAPACITATED that might make the player hogtieable, but they're only wild guesses. I guess it's possible that you can't do it to the player.

Edited by crossed99
Posted
33 minutes ago, crossed99 said:

I have no idea.. There are things like TASK_HOGTIEABLE or SET_PED_CAN_BE_INCAPACITATED that might make the player hogtieable, but they're only wild guesses. I guess it's possible that you can't do it to the player.

I definitely know it is possible to tie the player up as I saw a video that showed Arthur getting hogtied in singleplayer. I will try what you recommended. 

Posted

Came across these while looking for something, maybe you can use them to knock the player out and then hogtie him?

TASK_KNOCKED_OUT(Ped ped, float p1, BOOL permanently) 
TASK_KNOCKED_OUT_AND_HOGTIED(Ped ped, float p1, int p2)

Posted
13 minutes ago, crossed99 said:

Came across these while looking for something, maybe you can use them to knock the player out and then hogtie him?

TASK_KNOCKED_OUT(Ped ped, float p1, BOOL permanently) 
TASK_KNOCKED_OUT_AND_HOGTIED(Ped ped, float p1, int p2)

@crossed99 I did come across those functions but they did not hogtie the player like it would in multiplayer.

Posted
5 minutes ago, WesternGamer said:

@crossed99 I did come across those functions but they did not hogtie the player like it would in multiplayer.

Nevermind, they hogtie the player like in multiplayer.

  • Like 1
  • 3 weeks later...
Posted
On 9/4/2021 at 1:58 PM, WesternGamer said:

Nevermind, they hogtie the player like in multiplayer.

 

Would you mind sharing the way you called the commands to get a ped to hogtie the player like in multiplayer?

Posted
32 minutes ago, enterthemeng said:

 

Would you mind sharing the way you called the commands to get a ped to hogtie the player like in multiplayer?

I actually still don't know how to do it. "They" is actually referring to TASK_KNOCKED_OUT and TASK_KNOCKED_OUT_AND_HOGTIED being used together to hogtie the player without a ped to do it. It is possible to get a ped to hogtie the player as I saw in a video but there are no links to the mod being used and no source code available. I can show the code to you later and maybe even give you the download link for my Visual Studio 2019 project that has the code.

Posted
On 9/20/2021 at 1:33 PM, WesternGamer said:

I actually still don't know how to do it. "They" is actually referring to TASK_KNOCKED_OUT and TASK_KNOCKED_OUT_AND_HOGTIED being used together to hogtie the player without a ped to do it. It is possible to get a ped to hogtie the player as I saw in a video but there are no links to the mod being used and no source code available. I can show the code to you later and maybe even give you the download link for my Visual Studio 2019 project that has the code.

Gotcha. Do you mind sharing the way you call those methods so that the player is hogtied (without a ped doing it)?

Posted
TASK::TASK_KNOCKED_OUT(PLAYER::PLAYER_PED_ID(), 0, false);
TASK::TASK_KNOCKED_OUT_AND_HOGTIED(PLAYER::PLAYER_PED_ID(), 0, false);

The code above is what you need to put in. Do not put the code in update or your player will be repeatedly knocked out. If you can't see the code well, change the theme to light mode. (It is a issue with the recent website graphical upgrade and they are working on it.)

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