From GTA Network Wiki
Jump to: navigation, search

Server-Side Function

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

Sets an entity's transparency (alpha).


void NAPI.Entity.SetEntityTransparency(NetHandle entity, int newAlpha);

Required Arguments

  • entity: The entity handle to set the alpha. This parameter input should be in NetHandle type.
  • newAlpha: The new alpha value, between 0 and 255, as 0 means invisible and 255 is normally visible. This parameter input should be in int type.

Attention: Changing an entity's transparency will not affect anything "attached" to it, such as an entity's shadow or a player's current weapon.

Usage example(s)


Sets a player's alpha to 50.

NAPI.Entity.SetEntityTransparency(player, 50);

A command to set the player alpha to a specified number.

[Command("alpha", Description = "Sets your transparency")]
public void Command_Alpha(Client player, int alpha)
    if (alpha < 0) alpha = 0;
    if (alpha > 255) alpha = 255;
    NAPI.Entity.SetEntityTransparency(player, alpha);
    NAPI.Notification.SendNotificationToPlayer(player, "Alpha set to ~b~" + alpha);


Version Description
1.0 Release.