logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
little help please?

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related
View previous topic :: View next topic  
Author Message
ironhorse



Joined: 02 May 2005
Posts: 13
Location: uk

PostPosted: Mon May 02, 2005 2:06    Post subject: little help please? Reply with quote

I have setup nwnx and tested the demo and it worked, but when I try to start using it in my own file the scripting site doesnt work.

all I want it to do is when someone joins my server it takes their details (name, character name, etc...) so then I can use it to save peoples locations when server restarts.

Can anyone help me on this please?

Ironhorse

p.s. I want to use mySQL for the database, I dont know if you need to change anything apart form puting the details in the file.
Back to top
View user's profile Send private message Visit poster's website
DarkstarsDad



Joined: 17 Jan 2005
Posts: 59
Location: Overland Park, Kansas USA

PostPosted: Mon May 02, 2005 14:20    Post subject: Need some more details Reply with quote

Need more details on what you did/did not do? Did you put the aps on load in your onload script? then you need to write a script to save the data to the data base. more information is needed on what you have done for us to help you. Try the tutorials on the main page for help also.
_________________
Just because you think you can't. Is the best reason to try it anyway.
Back to top
View user's profile Send private message
ironhorse



Joined: 02 May 2005
Posts: 13
Location: uk

PostPosted: Mon May 02, 2005 16:16    Post subject: its working now Reply with quote

I have got it working now and someone sent me a script that saves the persons location, but it doesnt seem to work after the server has reset?

Here is the script

#include "aps_include"
void main()
{
object oPC = GetEnteringObject();
// don't run this script on monsters or NPC's
if (!GetIsPC(oPC)) return;
// Is this the first time the PC has come here?
if (!GetPersistentInt(oPC, "Stripped"))
{
SetPersistentInt(oPC, "Stripped", 1);
// Strip items, set initial DB vars
SetPersistentLocation(oPC, "SavePoint", GetLocation(oPC));
}
// If this isn't the first login, send the PC directly to the savepoint
location lPC = GetPersistentLocation(oPC, "SavePoint");
DelayCommand(2.0f, AssignCommand(oPC, ActionJumpToLocation(lPC)));
}
Back to top
View user's profile Send private message Visit poster's website
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Tue May 03, 2005 17:57    Post subject: Reply with quote

Do you have the players location on client leave ? Also check the odbc log file if it finds the location upon login.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
NoMercy



Joined: 03 Jan 2005
Posts: 123
Location: UK

PostPosted: Wed May 04, 2005 1:50    Post subject: Reply with quote

SetPersistentInt(oPC, "Stripped", 1);

I tend to rely on the fact new players have 0xp, in the event the database fails you don't really want level 40 players ending up nakid with no equipment :)
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group