Hi,
The error is generated by the game. There's a list of them here: https://support.rockstargames.com/hc/en-us/articles/200145096-List-of-all-Error-Codes-for-GTA-IV-PC
The game was released in 2008 according to Wikipedia which predates Windows 8.1: https://en.wikipedia.org/wiki/Grand_Theft_Auto_IV
So what you need to do here is to uninstall and then reinstall it in Windows Compatibility mode for Windows 7.
To install a game in Compatibility mode do the following.
- Right click the game's setup file and go to Properties.
- Click the Compatibility tab and then select Windows 7 from the dropdown menu (it may be selected already) and then checkmark the box.
- Further down the same menu, checkmark "Run As Administrator".
- Click Apply/OK.
The game should now run without errors.