Scripting/Squirrel/Functions/Player.Immunity

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing

This function will set a player's immunity to whatever % you type want.

Syntax

Player.Immunity = flags;

Flags

1 = bulletproof | 2 = fireproof | 4 = explosion-proof | 8 = collision-proof | 16 = melee-proof

0 means no immunity to any damage, 31 means immunity to all damage. You can add all the numbers together or use bitwise OR/AND to toggle flags.

Example

function onPlayerCommand( player, cmd, text )
{
if ( cmd == "immunity" )
{
MessagePlayer("Now you are immune to bullet/fire/explosion/collision/melee",player);
player.Immunity = 31;
}
}