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

OnEntityModelChange

Материал из RAGE MP Wiki Archive
Версия от 01:22, 30 ноября 2019; imported>Spotify (Created page with "This event is triggered when a entity has changed model. {{CSharpContainer| {{#tag:syntaxhighlight| [ServerEvent(Event.EntityModelChange)] |lang=csharp }} {{Parameters}} *''...")
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)

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>