Log in to reply
 

How to get rid of ped 'after image'?



  • Consider the following snippet of code:

                Game.Player.ChangeModel(PedHash.Bevhills02AFY);
                Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 0, 1, 0, 2);
                Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 1, 0, 0, 2);
                Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 2, 1, 1, 2);
                Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 3, 1, 2, 2);
                Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 4, 0, 0, 2);
                Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 5, 0, 0, 2);
                Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 6, 0, 0, 2);
                Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 7, 0, 0, 2);
                Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 8, 1, 0, 2);
                Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 9, 0, 0, 2);
                Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 10, 0, 0, 2);
                Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 11, 0, 0, 2);
    

    It works, kinda; but when I change like this from Franklin, often (after walking around a bit) I'll find a 'ghost' Franklin ped at the original location. How do I get rid of that? I must have missed something.



  • Looks like I needed to mark both peds as no longer needed:

                var Franklin = new Model(PedHash.Franklin);
                var Beverly = new Model(PedHash.Bevhills02AFY);
                Game.Player.ChangeModel(Beverly);
                Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 0, 1, 0, 2);
                Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 1, 0, 0, 2);
                Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 2, 1, 1, 2);
                Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 3, 1, 2, 2);
                Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 4, 0, 0, 2);
                Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 5, 0, 0, 2);
                Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 6, 0, 0, 2);
                Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 7, 0, 0, 2);
                Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 8, 1, 0, 2);
                Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 9, 0, 0, 2);
                Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 10, 0, 0, 2);
                Function.Call(Hash.SET_PED_COMPONENT_VARIATION, Game.Player.Character, 11, 0, 0, 2);
                Franklin.MarkAsNoLongerNeeded();
                Beverly.MarkAsNoLongerNeeded();

Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.