Scripting/Squirrel/Functions/Player.Immunity

From Vice City Multiplayer
Revision as of 10:38, 27 August 2015 by Xmair (talk | contribs) (Created page with "This function will ,make a player immune. == Syntax == '''1''' <pre>player.Immunity = //Amount here, Max 255.</pre> == Arguments == '''1''' * ''player'' <= This will find...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 ,make a player immune.

Syntax

1

player.Immunity = //Amount here, Max 255.

Arguments

1

  • player <= This will find the player.
  • Immunity <= This is the immunity you need to set.

Example

The following example will make a player's immunity 255%

function onPlayerCommand( player, cmd, text );
{
 if ( cmd == "im" )
 {
 if (!text) ClientMessage("/"+cmd+" <Nick> <Immunity>",255,255,0);
 else
 {
 local plr = GetPlayer(GetTok( text, " ", 1)
 local im = GetTok( text, " ", 2)
 ClientMessage(player.Name+" has set "+plr.Name+"'s immunity to "+im+"!",198,213,0);
 plr.Immunity = im
 }
}

Notes

Call onPlayerCommand were used in this example. More info about them in the corresponding pages.