-
Currently, I'm using PedHash pedHash = (PedHash)entity.Entity.GetHashCode(); ...but this wont work as intended and returns a value that won't work for spawning a ped. I've spent some time looking through the source files and I've not been able to find anything helpful so far. If this helps at all, this is my code: PedHash pedHash = (PedHash)entity.Entity.GetHashCode();
if (!Enum.IsDefined(typeof(PedHash), pedHash)) // Stops here, but if I remove it...
{
utils.Log($"Invalid ped hash {pedHash}");
utils.Log($"Entity scheduled for persistence deletion: {pedHash}");
keyDeletionList.Add(entity.Hash);
continue;
}
Ped ped = World.CreatePed(pedHash, entity.Position);
if (ped == null) // ...it would stop here instead.
{
utils.Log($"Failed to create ped with hash {pedHash} at {entity.Position}");
utils.Log($"Entity scheduled for persistence deletion: {pedHash}");
keyDeletionList.Add(entity.Hash);
continue;
} Apologies if this isn't worded well, I just woke up 😅 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Beta Was this translation helpful? Give feedback.
-
I've figured it out, |
Beta Was this translation helpful? Give feedback.
I've figured it out,
entity.Entity.Model.Hash
was the proper way to go about this.