PDA

View Full Version : my own save wont work :O?



tijny
June 27th, 2010, 10:24
i'm using afgscape 3.0 for a long time now and i still didnt have a auto char save so i made one
this is what i did:

i made a public int:


public int lastSave = 0;

i pasted that int under


public boolean adglow = false;
public boolean modglow = false;
public boolean ownerglow = false;
public boolean afkzzz = false;
public boolean darkglow = false;

it didnt gave me errors so it should be at the right place ther.

and this is the other part of the code:


if (System.currentTimeMillis() - lastSave > ####){//automatic safe
savemoreinfo();
savechar();
PlayerHandler.messageToAll = "game has been succesfully saved for all players!";
}

but i only is safing once's so i added


lastSave = 0;

like this:


if (System.currentTimeMillis() - lastSave > 2000){//automatic safe
savemoreinfo();
savechar();
PlayerHandler.messageToAll = "game has been succesfully saved for all players!";
lastSave = 0;
}

but now it still doesnt work :O it only is saving one time (at 2000 milisec) and than nothing :O
please help me to fix :P

Canownueasy`
June 27th, 2010, 10:30
long time = System.currentTimeMillis();
long lastSave = 1;
if((time - lastSave) > 3000) {
savemoreinfo();
savechar();
lastSave = System.currentTimeMillis();
}

tijny
June 27th, 2010, 10:36
thanx,

tijny
June 27th, 2010, 17:39
wont work :O stil only one time saving and than nothing :O someone help me plz