Player data not loading
#1

I've been working on a script which saves the player info at logout, and is supposed to spawn them at the coordinates that they logged out at.

The problem is it doesn't. It spawns them at 50,50,50 every time instead of the saved coordinates.

I've looked through the code and can't see any obvious things wrong with it however, I've tried several ways of loading the data, none appear to work at all.
Reply
#2

Well, thanks for sharing..
Reply
#3

I'll put the code snippets up now, hang on. I was in the middle of getting home from work.

Code's attached now.

EDIT: Okay, coding at 3am....bad, bad idea. However, I can't see where I've gone wrong with it, it is designed to simply write the player state to a .ini file. It saves successfully, I have verified the data saves perfectly. When I go to load the data on either a local host, or a server, it loads everything else (money, name, etc) but not the coordinates, instead as said, defaulting to 50, 50, 50.
Reply
#4

Before I look at your problem.. just want to ask.. If you're scripting a script from scratch, why are you using shitty outdated things? Like why not use use ZCMD or YCMD, and why not sscanf?
Reply
#5

Becaise it's my first script, and I was following an outdated tutorial that did not even mention said things. I'll look into them.

I've been told by at least three people that some of the things you said aren't compatible with Linux (which my host is). Cheap windows boxes are a rarity where I am.

Also. I coded this at...2-3am, and was hella tired.
Reply
#6

ZCMD is, and so is sscanf. I'd suggest you look into them.
Reply
#7

I shall. However, I do want to point out that as a long time lurker, that most* (not all) scripts tend to use those, as you called them, 'shitty, outdated things', and are relatively successful.
Reply
#8

Doesn't matter if their successful, they are still coded poorly if they are using strcmp as a "command processor"
Reply
#9

I've recoded it with ZCMD, Sscanf and YCMD

Same problem, spawning people at 50, 50, 50. It works perfectly on localhost however and with two other accounts.

Again, script attached.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)