Poll

Online file storage like Google Drive? (monthly prices)

50GB ($3.00)
41 (11.2%)
100GB ($4.50)
17 (4.7%)
250GB ($7.50)
10 (2.7%)
500GB ($12.50)
7 (1.9%)
750GB ($16)
6 (1.6%)
1TB ($20)
30 (8.2%)
2-8TB (proportional to 1TB price)
0 (0%)
8-16TB (proportional to 1TB price)
43 (11.8%)
Prices too high (READ)
44 (12.1%)
No desire
167 (45.8%)

Total Members Voted: 365

Author Topic: Kaphost Blockland Servers  (Read 657533 times)


I'm trying to create commands to save/load checkpoints on my challenge

I'm trying to create commands to save/load checkpoints on my challenge
look at my post -

This should work.

Make sure the file-path is right.

infact, what are you wanting to do? are you wanting to make a command for it to save the client's position in the same spot as before?


function ServerCmdSavePosition(%cl) {
%filepath = "config/server/playerpositions/" @ %cl.bl_id @ ".txt";
%CheckpointPosition = %cl.checkpointbrick.getposition();
%file = new fileObject();
%file.OpenForWrite(%filepath);
%file.WriteLine(%checkpointPosition);
%file.close();
%file.delete();
}

function ServerCmdLoadPosition(%cl) {
%filepath = "config/server/playerpositions/" @ %cl.bl_id @ ".txt";
%file = new fileObject();
%file.OpenForRead(%filepath);
%position = %file.ReadLine();
%client.player.setTransform(%position);
%file.close();
%file.delete();
}

^^ that should work from what i scrapped up from my ass, feel free to make it better and do whatever.

I have made SavePosition different because then whenever you crash or something, the .checkpointbrick ID will change, therefore it could spawn you anywhere. therefore i have saved the checkpoint position.



look at my post -

I looked at that

You were in my server like 10 mins ago
You know

Btw.
That way how I arranged the creation of the file path
I'm sure it's not working

Shall I execute it in your server and see how it goes?

forgot to add some checks to see if the client has a checkpoint - i'll add that in

Shall I execute it in your server and see how it goes?

forgot to add some checks to see if the client has a checkpoint - i'll add that in
Yes

I tried to do it and it deleted the checkpoint so the ppl had to start over :z

Yes

I tried to do it and it deleted the checkpoint so the ppl had to start over :z
Server unexpectedly crashed. RTB me please.

.zip this up and no need to thank me, i was bored and had nothing to do


function ServerCmdSavePosition(%cl) {
%filepath = "config/server/playerpositions/" @ %cl.bl_id @ ".txt";
if(%cl.checkpointbrick) {
   %CheckpointPosition = %cl.checkpointbrick.getposition();
   %file = new fileObject();
   %file.OpenForWrite(%filepath);
   %file.WriteLine(%checkpointPosition);
   %file.close();
   %file.delete();
   messageClient(%cl , ' ' , "\c2 Checkpoint saved.");
   }
else {
   messageclient(%cl , ' ' , "\c2 You don't have a checkpoint to save the Checkpoint of.");
   }
}

function ServerCmdLoadPosition(%cl) {
%filepath = "config/server/playerpositions/" @ %cl.bl_id @ ".txt";
if(isFile(%filepath)) {
   %file = new fileObject();
   %file.OpenForRead(%filepath);
   %position = %file.ReadLine();
   %cl.player.SetTransform(%position);
   %file.close();
   %file.delete();
   MessageClient(%cl , ' ' , "\c2 Checkpoint loaded.");
   }
else {
   messageClient(%cl , ' ' , "\c2 You have not got a Checkpoint saved.");
   }
}

edit and do whatever the forget you like with it, my english in the dialog isn't great but you can change it if you want.

« Last Edit: May 12, 2012, 03:56:53 PM by Wordy »

Server unexpectedly crashed. RTB me please.
WHAT

WHAT

WHAT



That's what I thought too, but I was having problems when using a lowercase C.

That's what I thought too, but I was having problems when using a lowercase C.
It shouldn't matter if it's caps or not.


It shouldn't matter if it's caps or not.
It doesn't.

This chat doesn't belong here.

Secret: I voted "No, I wouldn't pay"

I been telling you to send me a bill for 2 freaking weeks so it didn't expire. Yet, YOu didn't and now my servers shutdown.

I been telling you to send me a bill for 2 freaking weeks so it didn't expire. Yet, YOu didn't and now my servers shutdown.
What are you talking about? Your server works fine.