ShadowCoderKing Posted May 8, 2017 Share Posted May 8, 2017 (edited) i want the spawned ped to shoot/attack the player without using task.fightagainst how can i set a peds relationship to hate the the player ? GTA.Native.Function.Call(GTA.Native.Hash.SET_PED_AS_ENEMY, Enemy1, true); will the ped attack the player on sight and if the player is not near by then the ped will stay idle with this code ? Edited May 8, 2017 by SpiderMight Link to comment Share on other sites More sharing options...
Tarackgame Posted May 8, 2017 Share Posted May 8, 2017 First. You have to set the relationship grouP: PED::ADD_RELATIONSHIP_GROUP(char* name, Any* out_hash) name = anything you want, any* out_hash the group out hash. and this: PED::SET_RELATIONSHIP_BETWEEN_GROUPS(1, out_hash, 0x6F0783F5)PED::SET_RELATIONSHIP_BETWEEN_GROUPS(5, 0x6F0783F5, out_hash) 0x6F0783F5 is the player default relationship hash, so don't modify. and out_hash is the out_hash (see 1.) PED::SET_PED_RELATIONSHIP_GROUP_HASH(Any ped_id, Any hash) And set the ped with the group. any ped id is the ped, and any hash is the out_hash(see first!) Link to comment Share on other sites More sharing options...
ShadowCoderKing Posted May 10, 2017 Author Share Posted May 10, 2017 (edited) thanks tarackgame, for anyone wanting the the c# code here its is: int EnemyRelationShipGroup = Function.Call<int>(Hash.GET_HASH_KEY, "HATES_PLAYER"); Function.Call(Hash.SET_PED_RELATIONSHIP_GROUP_HASH, NPC1, EnemyRelationShipGroup); Edited May 10, 2017 by SpiderMight Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now