Jump to content

entityModelChange(entity, oldModel) how to trigger this events give an example


randzhamiya

Recommended Posts

As example:

player.model = mp.joaat('player_zero')

 

Will trigger this event:

[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..
    }
}

It's a C# server-side example.

Source: gtanet wiki, ragemp wiki

 

Zepenthium~

Edited by Zepenthium
Link to comment
Share on other sites

В 06.08.2020 в 07:00, Zepenthium сказал:

As example:


player.model = mp.joaat('player_zero')

 

Will trigger this event:


[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..
    }
}

It's a C# server-side example.

Source: gtanet wiki, ragemp wiki

 

Zepenthium~

can you show an example on node.js?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...