Reports the current crime level of the PC. Can be used to detect whether a crime the PC has committed has been seen
See the "Bill_MT_writxxxxx" scripts for examples of its use.
An alternative was reported by Nigedo:
OnPCHitMe
If you declare OnPCHitMe in an NPC's script, any crime that they are aware of causes this function/variable to return True. The crime does not actually have to be committed against that NPC, they just have to have a high enough Alarm setting to care about a crime being committed within range, and the crime will count as a melee hit on them of zero damage.
Although this makes OnPCHitMe less reliable for detecting just attacks on the NPC it is declared on (I had to use a different method for the script I was actually working on), it is potentially useful for detecting crimes taking place.
It is possible to use this to detect all crime events in one script, without needing an NPC to "report" them, i.e. increase Player's bounty, or needing to check or adjust PCCrimeLevel.
I found that the following alarm settings will (usually) cause OnPCHitMe to return True for the these events:-
Event Minimum Alarm
Any theft 10
Assault of an NPC 90
Murder of an NPC 10
[no fix] GetPCInJail (returns Boolean/short)
Bloodmoon adds a function that can be checked to see if the PC is in Jail. The function will return 1 if traveling/in jail, zero otherwise. This is used in the werewolf change script to stop the PC from changing if either of these states are the case.
Sample script:
if ( PCWerewolf != 1 ) ; DON’ RUN IF PLAYER ISN’T WEREWOLF