Scripting/Squirrel/Functions/WriteIniNumber: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
LuisModsHD (talk | contribs) |
No edit summary |
||
(4 intermediate revisions by one other user not shown) | |||
Line 16: | Line 16: | ||
create a Pos.ini file on your server | create a Pos.ini file on your server | ||
<code> | |||
<code lang="squirrel"> | |||
function onPlayerPart( player, reason ) | function onPlayerPart( player, reason ) | ||
{ | { | ||
WriteIniNumber( "Pos.ini", "X", player.Name, player.Pos.X ); | WriteIniNumber( "Pos.ini", "X", player.Name, player.Pos.X ); | ||
WriteIniNumber( "Pos.ini", "Y", player.Name, player.Pos.Y ); | WriteIniNumber( "Pos.ini", "Y", player.Name, player.Pos.Y ); | ||
WriteIniNumber( "Pos.ini", "Z", player.Name, player.Pos.Z ); | WriteIniNumber( "Pos.ini", "Z", player.Name, player.Pos.Z ); | ||
} | } | ||
</code> | </code> | ||
Line 28: | Line 34: | ||
{{Scripting/Squirrel/Functions/INI Functions}} | {{Scripting/Squirrel/Functions/INI Functions}} | ||
[[Category:Scripting/Squirrel/Functions/INI_Functions]] |
Latest revision as of 18:16, 30 January 2017
This function writes an integer value to an .ini file. If the file does not exist, the function will create it.
Syntax
bool WriteIniNumber( string filename, string section, string var, int value )
Arguments
- filename This is the name of the file
- section The section that contains the value you want to create/edit
- var The name of the variable
- value The integer value for the variable
Example
create a Pos.ini file on your server
function onPlayerPart( player, reason )
{
WriteIniNumber( "Pos.ini", "X", player.Name, player.Pos.X );
WriteIniNumber( "Pos.ini", "Y", player.Name, player.Pos.Y );
WriteIniNumber( "Pos.ini", "Z", player.Name, player.Pos.Z );
}