Squirrel/Server/Functions/Players/ForceToSpawnScreen

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with '{{Squirrel/Title|Player.ForceToSpawnScreen}} This ''Player'' class member returns whether the player will be forced to the spawn screen next time they die. == Syntax == You can…')
 
Line 1: Line 1:
 
{{Squirrel/Title|Player.ForceToSpawnScreen}}
 
{{Squirrel/Title|Player.ForceToSpawnScreen}}
This ''Player'' class member returns whether the player will be forced to the spawn screen next time they die.
+
This ''Player'' class member will force the player to the spawn screen.
  
 
== Syntax ==
 
== Syntax ==
 
+
<code>bool Player.ForceToSpawnScreen()</code>
You can either return or set a new value using this member:
+
<code>bool Player.ForceToSpawnScreen</code>
+
<code>Player.ForceToSpawnScreen = bool force</code>
+
  
 
== Arguments ==
 
== Arguments ==
  
* '''force''' - A boolean representing whether the player is being forced to the spawn screen (''true'') or simply respawning (''false'')
+
* '''none'''
  
== Example 1. Returning ==
+
== Example ==
  
 
<code lang="squirrel">
 
<code lang="squirrel">
 +
This example sends the playe to the spawn screen when they type '/spawnscreen'.
 +
 
function onPlayerCommand( pPlayer, szCommand, szText )
 
function onPlayerCommand( pPlayer, szCommand, szText )
 
{
 
{
 
if ( szCommand == "spawnscreen" )
 
if ( szCommand == "spawnscreen" )
 
{
 
{
MessagePlayer( "Your force to spawn screen state is currently set to " + pPlayer.ForceToSpawnScreen, pPlayer );
+
pPlayer.ForceToSpawnScreen();
}
+
+
return 1;
+
}
+
</code>
+
 
+
=== Notes ===
+
 
+
The function [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]] and event [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] were used in this example. More info about them in the corresponding pages.
+
 
+
== Example 2. Setting ==
+
 
+
<code lang="squirrel">
+
function onPlayerCommand( pPlayer, szCommand, szText )
+
{
+
if ( szCommand == "spawnscreen2" )
+
{
+
pPlayer.ForceToSpawnScreen = true;
+
 
}
 
}
 
 

Revision as of 19:04, 1 October 2010

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This Player class member will force the player to the spawn screen.

Syntax

  1. bool Player.ForceToSpawnScreen()

Arguments

  • none

Example

  1.  
  2. This example sends the playe to the spawn screen when they type '/spawnscreen'.
  3.  
  4. function onPlayerCommand( pPlayer, szCommand, szText )
  5. {
  6. if ( szCommand == "spawnscreen" )
  7. {
  8. pPlayer.ForceToSpawnScreen();
  9. }
  10. return 1;
  11. }
  12.  

Notes

The event onPlayerCommand was used in this example. More info about this in the corresponding page.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox