fowlplay4
07-06-2006, 10:05 PM
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!
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);
}
Edit: Fixed for anyone who may have this problem in the future!
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);
}