Aktarus Posted August 26, 2017 Share Posted August 26, 2017 (edited) Hello everyone, I am stuck with some zombies . I am currently making a script in Lua. This is about zombie vs human. So the script spawn some zombies around the player (this work well) but they just not fight players. I mean they don't attack players except if you attack them (when SetBlockingOfNonTemporaryEvents is not activated). It seems that something is wrong with groups and relationship. Could you help me guys? SetPedRelationshipGroupHash(GetPlayerPed(-1), GetHashKey("PLAYER")) AddRelationshipGroup("zombieGroup") SetRelationshipBetweenGroups(5, GetHashKey("zombieGroup"), GetHashKey("PLAYER")) SetAiMeleeWeaponDamageModifier(50.0) zombie = CreatePed(5, 0xC5FEFADE, newCoordX, newCoordY, 13.0801, 123.98, true, true) SetBlockingOfNonTemporaryEvents(zombie, true) SetPedSeeingRange(zombie, 1000000.0) SetPedHearingRange(zombie, 1000000.0) SetPedCombatAttributes(zombie, 5, true) SetPedCombatMovement(zombie, 3) SetPedCombatRange(zombie, 2) SetPedAccuracy(zombie, 100) SetPedFleeAttributes(zombie, 0, false) DisablePedPainAudio(zombie, true) PlayAmbientSpeech1(zombie, "DYING_MOAN", "SPEECH_PARAMS_FORCE") StopPedSpeaking(zombie, true) SetPedEnableWeaponBlocking(zombie, true) SetPedRelationshipGroupHash(zombie, GetHashKey("zombieGroup")) SetPedKeepTask(zombie, true) SetPedAsNoLongerNeeded(zombie) TaskWanderStandard(zombie, 1.0, 10) RegisterHatedTargetsAroundPed(zombie, 50.0) Edited August 26, 2017 by Aktarus Link to comment Share on other sites More sharing options...
ins1de Posted August 26, 2017 Share Posted August 26, 2017 Create a 'hate' relationship type with the PLAYER_GROUP. Also, SetBlockingOfNonTemporaryEvents will totally block the ped from doing anything unless you task him something, hence use TASK_... something natives. Link to comment Share on other sites More sharing options...
Aktarus Posted August 26, 2017 Author Share Posted August 26, 2017 Create a 'hate' relationship type with the PLAYER_GROUP. Also, SetBlockingOfNonTemporaryEvents will totally block the ped from doing anything unless you task him something, hence use TASK_... something natives. Thank you for your answer. It seems that PLAYER_GROUP is limited to 8 peds, right? Here is a Native function I have found about it: PED::CREATE_GROUPHashes: 0x90370EBE0FEE1A3D 0x8DC0368Dint CREATE_GROUP(int unused) // 0x90370EBE0FEE1A3D 0x8DC0368DCreates a new ped group.Groups can contain up to 8 peds. So how can I create groups of zombies while they are more that 8? I can't get my head around it. If you have an example for me... thank you Link to comment Share on other sites More sharing options...
aimless Posted August 27, 2017 Share Posted August 27, 2017 The relationshipgroup and group are different things. The relationshipgroup sets who they like, hate exc.You set it for both relationshipgroups to fight each other.SetRelationshipBetweenGroups(5, GetHashKey("zombieGroup"), GetHashKey("PLAYER"))SetRelationshipBetweenGroups(5, GetHashKey("PLAYER"), GetHashKey("zombieGroup")) A group can only have 8.A group can have 1 leader.Group members fallow leader and fight with leader as in bodyguard mods. Link to comment Share on other sites More sharing options...
Aktarus Posted August 29, 2017 Author Share Posted August 29, 2017 Ok guys! Thanks 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