Jump to content

Handling when the player commits a crime?


StealthDick

Recommended Posts

I don't even know how to phrase this.

 

I would like to create an event handler that runs a UDF whenever the player commits a crime against someone. I'm not sure if it's even possible though.

 

Crimes being: Theft, Murder, and Assault.

 

If I can't do that, I would atleast like to know if theres some variable in the game settings that gets temporarily changed to signify whether or not the player just committed a crime in general.

 

There's gotta be a way I can jury-rig this into existence.

Link to comment
Share on other sites

To detect a murder by the player character you can setup an OnDying event handler to detect any death that occurs.

Then you simply check to see if the player character is the cause of death by using GetActorCrimePlayerEnemy, GetActorFactionPlayerEnemy and IsKiller.

I do exactly this in my mod Leave No Witnesses.

 

 

You can detect if the player has stolen from or assaulted an NPC using the GetActorCrimePlayerEnemy function but I don't recommend it due to it being unreliable.

Edited by IntenseMute
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...