Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Player created by script? (https://forums.graalonline.com/forums/showthread.php?t=134263760)

callimuc 07-05-2011 12:22 PM

Player created by script?
 
Hey there.
I was browsing through the scripthelp and found something ... let´s say interesting (at least for me). It looks like there are commands to create a player by script? How would that work? Here are two scripts/commands I found with having it included:

TServerPlayer.destroy() - deletes the player, only works for players created by script
TServerPlayer.loadaccount() - loads the player, only works for players created by script; this function is called automatically when creating a player

ffcmike 07-05-2011 12:29 PM

This doesn't create an actual player, just the object.
It allows you to do stuff like read (I believe you can only read the level name right now) and write to offline players.
There's TServerPlayer.saveaccount(); in order to do this.

callimuc 07-05-2011 12:32 PM

So is there any use for it?

ffcmike 07-05-2011 12:44 PM

Quote:

Originally Posted by callimuc (Post 1657452)
So is there any use for it?

I don't think there is beyond reading/writing data for offline players no.
One good example for this I can think of would be to have an sqlite database storing each player that has logged on to the server, and eventually you'd be able to retrieve all of those accounts and write stuff to them if you want to apply an update to everyone.
This is somewhat better than having an if(condition){} within the login function for each player.

callimuc 07-05-2011 01:16 PM

Hmm ok thx


All times are GMT +2. The time now is 09:44 AM.

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