First check if player isn't null. The following is for lite-c but might also work for c-script:

if (player == null) error("player pointer is null");


And also try;

if (!player) error("player pointer is not valid");


If no error message pops up, than you have some kind of weird memory error or such, or it is some bug (older version?).
If an error message does pop up, if it is for the if() than you haven't set the player pointer correctly or is set null somewhere in your code.
If an error message pops up and it is in the second if() than the pointer to the player is not valid anymore. Perhaps after loading a savegame??

Last edited by Reconnoiter; 04/04/16 11:17.