Scripting/Squirrel/Functions/Player.Frozen: Difference between revisions

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
No edit summary
No edit summary
Line 7: Line 7:
player.IsFrozen = false;</pre>
player.IsFrozen = false;</pre>


'''Example'''
function onPlayerCommand( player, cmd, text )
{
if ( cmd == "free" )
    {
      local plr = FindPlayer( text ); // text is the name of the player
      if ( !plr ) MessagePlayer( "Error: Player '" + text + "' is not online.", player );//Check status of player
      else player.IsFrozen = true;//Finally freeze him
    }
'''OR'''
if ( cmd == "free" )
    {
      local plr = FindPlayer( 0 ); // id of the player
      if ( !plr ) MessagePlayer( "Error: Player '" + text + "' is not online.", player );//Check status of player
      else player.IsFrozen = true;//Finally freeze him
    }
}
'''Note''' - FindPlayer can be worked out with text/name or id of the player'''
{{Scripting/Needs_Example}}
{{Scripting/Needs_Example}}

Revision as of 11:23, 8 January 2015


This page needs a description, or needs a better one. Please help us complete the wiki by writing one.


Syntax

player.IsFrozen = true;
player.IsFrozen = false;

Example

function onPlayerCommand( player, cmd, text ) {

if ( cmd == "free" )
    {
     local plr = FindPlayer( text ); // text is the name of the player
     if ( !plr ) MessagePlayer( "Error: Player '" + text + "' is not online.", player );//Check status of player
     else player.IsFrozen = true;//Finally freeze him
    }

OR

if ( cmd == "free" )

    {
     local plr = FindPlayer( 0 ); // id of the player
     if ( !plr ) MessagePlayer( "Error: Player '" + text + "' is not online.", player );//Check status of player
     else player.IsFrozen = true;//Finally freeze him
    }

}

Note - FindPlayer can be worked out with text/name or id of the player

This page needs an example. We will try our best to complete the wiki as soon as possible.