Entity::setAlpha

From RAGE Multiplayer Wiki
Jump to navigation Jump to search

skin - everything alpha except skin
Set entity alpha level. Ranging from 0 to 255 but chnages occur after every 20 percent (after every 51).

Syntax

entity.setAlpha(alphaLevel);

Required Arguments

  • alphaLevel: int

Old Arguments

  • alphaLevel: int
  • skin: Boolean
    • The "skin" parameter is not used and will cause argument count exceptions if used.

Return value

  • Undefined

Example

Client-Side
mp.events.add('enableCollisions', () => {
	mp.players.forEach(player => {
		mp.players.local.vehicle.setNoCollision(player.vehicle.handle, true);
		player.vehicle.setAlpha(255);
		player.setAlpha(255);
	});
});

mp.events.add('disableCollisions', () => {
	mp.players.forEach(player => {
		mp.players.local.vehicle.setNoCollision(player.vehicle.handle, false);
		player.vehicle.setAlpha(102);
		player.setAlpha(255);
	});
});

See also