OnEntityModelChange

From GTA Network Wiki
Jump to: navigation, search

OnEntityModelChange
Server-Side Function

utilities-terminal.png Server-Side csharp.png C#

This event is triggered when an entity has changed model.

Attribute

[ServerEvent(Event.EntityModelChange)]

Required Parameteres

  • NetHandle: the entity handle.
  • uint: the old model.

Usage example(s)

[ServerEvent(Event.EntityModelChange)]
public void OnEntityModelChange(NetHandle entityHandle, uint oldModel)
{
    switch (entityHandle.Type)
    {
        case EntityType.Player:
        {
            var player = entityHandle.Entity<Client>();
            player.SendChatMessage($"Your model has changed from {oldModel} to {player.Model}!");
            break;
        }
        // and so on..
    }
}

Changelog

Version Description
0.3.0.3 API Update, OnPlayerModelChange is OnEntityModelChange now.
1.0 Release.

References