Scripting/Squirrel/Client Functions/Console::Print: 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
(This example prins "Script unloaded" when scripts have unloaded.)
No edit summary
 
Line 1: Line 1:
[code]function Script::ScriptUnload()
This function writes text to the game console.
 
== Syntax ==
 
<pre>Console.Print( szText )</pre>
 
== Arguments ==
 
* '''STRING''' '''szText''' The message to print.
 
== Example ==
This will message 'player has died.' whenever a player dies.
 
<code lang="squirrel">
function Player::PlayerDeath( player )
{
{
    PrintTheDrop()
 
Console.Print( player.Name + " has died." );
 
}
}
function PrintTheDrop()
</code>
{
 
    Console.Print("Script unloaded!") //console::print
=== Notes ===
}[/code]
 
The event [http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Client_Events/Player::PlayerDeath Player::PlayerDeath] was used in in this example. More info about them in the corresponding pages.

Latest revision as of 05:13, 14 July 2016

This function writes text to the game console.

Syntax

Console.Print( szText )

Arguments

  • STRING szText The message to print.

Example

This will message 'player has died.' whenever a player dies.

function Player::PlayerDeath( player ) {

Console.Print( player.Name + " has died." );

}

Notes

The event Player::PlayerDeath was used in in this example. More info about them in the corresponding pages.