Перейти к содержанию

OnEntityModelChange

Материал из RAGE MP Wiki Archive

This event is triggered when a entity has changed model.


<syntaxhighlight lang="csharp"> [ServerEvent(Event.EntityModelChange)] </syntaxhighlight>

Parameters

  • handle: parameter input should be in NetHandle type
  • oldModel: parameter input should be in uint type

Example

<syntaxhighlight lang="csharp"> [ServerEvent(Event.EntityModelChange)] public void OnEntityModelChange(NetHandle handle, uint oldModel) {

   switch (handle.Type)
   {
       case EntityType.Player:
       {
           var player = handle.Entity<Client>();
           player.SendChatMessage($"Your model has changed from {oldModel} to {player.Model}!");
           break;
       }
   }

} </syntaxhighlight>