Command:
(3)if ( cmd == "s" )
(4) {
(5) local pos = player.Pos;
(6) if( text )
(7) {
(8) MessagePlayer( "Saved location: " + pos.x + "," + pos.y + "," + pos.z + " as " + text + ".", player );
(9) WriteIniFloat( "Locations.ini", text, "x", pos.x );
(10) WriteIniFloat( "Locations.ini", text, "y", pos.y );
(11)WriteIniFloat( "Locations.ini", text, "z", pos.z );
(12) }
(13) else MessagePlayer("Error: /s (location_name)",player);
(14) }
The problem is when i type /s (text), It doesn't save the anything in-game instead it prints the following text in Rcon:
<31/01/2012 - 21:07:37> *FUNCTION [onPlayerCommand()] Scripts/Main/main.nut line [9]
<31/01/2012 - 21:07:37> LOCALS
<31/01/2012 - 21:07:37> [pos] INSTANCE
<31/01/2012 - 21:07:37> [text] "Bank"
<31/01/2012 - 21:07:37> [cmd] "s"
<31/01/2012 - 21:07:37> [player] INSTANCE
<31/01/2012 - 21:07:37> [this] TABLE
I have loaded the required module:
function onScriptLoad()
{
LoadModule("lu_ini");
print( "** Scripts loaded sucessfully" );
return 1;
}