Squirrel/Server/Functions/SpawnClass/Skin
From Liberty Unleashed Wiki
(Difference between revisions)
(New page: __NOTOC__ This ''SpawnClass'' class member returns or sets the skin selected for the given spawn class. == Syntax == You can either return or set a new value using this member...) |
(→Example 1. Returning) |
||
Line 13: | Line 13: | ||
== Example 1. Returning == | == Example 1. Returning == | ||
− | |||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | function onPlayerCommand( player, cmd, text ) | |
+ | { | ||
+ | if ( cmd == "getskin" ) | ||
+ | { | ||
+ | local skin = p_SpawnClass.Skin; | ||
+ | MessagePlayer( "The current spawn class skin is: " + skin, player ); | ||
+ | } | ||
+ | } | ||
</code> | </code> | ||
− | + | This example will return the skin of the spawn class, that we found earlier in [[Squirrel/Server/Functions/SpawnClass/FindSpawnClass|FindSpawnClass]]. | |
− | + | ||
− | + | ||
== Example 2. Setting == | == Example 2. Setting == |
Revision as of 17:46, 8 March 2010
This SpawnClass class member returns or sets the skin selected for the given spawn class.
Syntax
You can either return or set a new value using this member:
int SpawnClass.Skin
SpawnClass.Skin = int skin
Arguments
- skin - The new skin for the spawn class
Example 1. Returning
function onPlayerCommand( player, cmd, text ) { if ( cmd == "getskin" ) { local skin = p_SpawnClass.Skin; MessagePlayer( "The current spawn class skin is: " + skin, player ); } }
This example will return the skin of the spawn class, that we found earlier in FindSpawnClass.
Example 2. Setting
This function needs an example. You can help us complete the wiki by writing one, or maybe even more :o
-- todo
Notes
-- Example notes/used functions here