Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Savelines =o (https://forums.graalonline.com/forums/showthread.php?t=67179)

fowlplay4 07-06-2006 09:05 PM

Savelines =o
 
Okay, so I am trying to save lines but this isnt really working. Help Appreciated.
Edit: Fixed for anyone who may have this problem in the future!
PHP Code:

function onActionServerSide() {
 if (
params[0]=="savelines") {
   
file params[1];                  //levels/test/text.txt
   
contents params[2];        //{"test1=3","lol wtf","howdy partner"};
   
contents.saveLines(file,0);
   
player.chat "Saved Contents to" SPC file
   
// Your chat on player would say, Saved Contents to levels/test/text.txt
  
}
 }

//#CLIENTSIDE
function onCreated() {
 
temp.path "levels/test/text.txt";
 
temp.lines = {"test1=3","lol wtf","howdy partner"};
triggeraction(player.x,player.y,"serverside",name,"savelines",temp.path,temp.lines);
 } 


Yen 07-06-2006 09:27 PM

array.savelines(path, true/false)

Array is the array it saves as text.
Path is the path to the file.
true/false is either append or overwrite, not sure.. I'd assume append.

I'm pretty sure you have to put arrays into new variables when you pass them.
You might wanna try something like...
lines = params[2];

fowlplay4 07-06-2006 09:43 PM

^^ There we go got it working!


All times are GMT +2. The time now is 06:27 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.