Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-06-2006, 09:05 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
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);
 } 
__________________
Quote:

Last edited by fowlplay4; 07-06-2006 at 09:47 PM..
Reply With Quote
  #2  
Old 07-06-2006, 09:27 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
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];
Reply With Quote
  #3  
Old 07-06-2006, 09:43 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
There we go got it working!
__________________
Quote:
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:26 AM.


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