Jump to content

[Q]Scripthook GTA IV 1.7 Specific Relations Coding


Recommended Posts



I've been trying to enjoy my game play on Grand Theft Auto IV but people calling me and texting me complaining that I'm dead and stuff is getting really annoying. I'm anti-social in life, why can't I be in game also?! So I was looking around in Visual Studio at things I could possibly do with relationships in game.


I see this:



Player.Character.ChangeRelationship(RelationShip group, Relationship level);



So I think oh, maybe all Niko's friends are in a collection! Neat! But whilest looking at a relationship group I see:

  • RelationshipGroup.Bum;
  • RelationshipGroup.Civillian_Female - Male;
  • RelationshipGroup.Cop;
  • RelationshipGroup.Criminal;
  • RelationshipGroup.Dealer;
  • Etc.
Sadly I do not find any of his friends among this list, it appears to be more of a faction or something to segregate entities in the game. So I decide to look at a relationship and see that it has levels that appear that they should be used for friends and enemies. It seems like something I would need to influence relationship levels with Niko's friends!
  • Relationship.Companion;
  • Relationship.Dislike;
  • Relationship.Hate;
  • Relationship.Like;
  • Relationship.Neutral;
  • Relationship.Respect;
I then see that you can alter whether or not someone in the same/different relationship can/can't hurt you furthering my faction-like idea:



Player.Character.CantBeDamagedByRelationshipGroup(RelationshipGroup group, bool value);Player.Character.CanBeDamagedByRelationshipGroup(RelationshipGroup group, bool value);



My question though is, is there something I've overlooked in ScriptHook that will allow me to modify friendship respect and like levels? All I've found are things that modify the character's faction confused.gif . If you know anything about this topic I would really appreciate the help.




Nevermind I figured out how to do it on my own, I'll explain how to do it here so that anybody looking for how to do this in the future won't have to look any further then this topic..


There are enumerations of all your statistics, The ones I was specifically looking for are in FloatStatistic. There are other statistics you can modify such as IntegerStatistic. You just have to make sure you use the right method to get and set them.


Getting and setting float and integer statistics:





int iMyStatistic = Game.GetIntegerStatistic(IntegerStatistic stat);Game.SetIntegerStatistic(IntegerStatistic stat, int value);






float fMyStatistic = Game.GetFloatStatistic(FloatStatistic stat);Game.SetFloatStatistic(FloatStatistic stat, float value);






            float fMyStatistic = Game.GetFloatStatistic(FloatStatistic.ROMAN_LIKE);           if (fMyStatistic < 100.0f)               Game.SetFloatStatistic(FloatStatistic.ROMAN_LIKE, 100.0f);           int iMyStatistic = Game.GetIntegerStatistic(IntegerStatistic.MISSIONS_FAILED);           if (iMyStatistic > 0)               Game.SetIntegerStatistic(IntegerStatistic.MISSIONS_FAILED, 0);


Edited by Tsproggy
Link to comment
Share on other sites

You could also use a trainer (Simple Native Trainer) to make everyone like you so they'll shut up. As for phonecalls, try setting you ingame phone on sleep mode or something similar, stops them from calling you.

Link to comment
Share on other sites

Yea I've used that trainer before, I just like making my own mods and scripts. I'm interested to see if it's possible to do this with Scripthook as I don't think the native trainer was made using it. I've used sleep mode before but doesn't it turn back on after missions?

Link to comment
Share on other sites


There is a .Net ScriptHook IRC Channel made by MulleDK19, you can join that for some help, he's usually in there and so am I. Sometimes a couple other people join aswell.


I think if you click my signature it'll take you to a page where you can join the channel in your browser or a dedicated IRC client, give it a try!


Edit: Nope, just tried it, download a free IRC client (I use ChatZilla on Firefox) and join the channel #gtaivnetscripthook on irc.freenode.org

Edited by lindsayslorach
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.