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 
 
On PC Enter/Exit script

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules
View previous topic :: View next topic  
Author Message
Rufus Dely



Joined: 12 Feb 2007
Posts: 2

PostPosted: Mon Feb 12, 2007 12:23    Post subject: On PC Enter/Exit script Reply with quote

I made a tabe that records the name and lvl of PCs at enter , and should delete the entry on pc exit, just to store the onlineplayers.

This goes in "on enter":

Code:
string sNome=SQLEncodeSpecialChars(nome);
 string sLvl = IntToString(GetHitDice(oPC));
 SQLExecDirect( "INSERT * INTO onlineplayers(name,lvl,classone,classtwo,classthre) VALUES('"+sNome+
                "', '"+sLvl+"', '"+sClass+"', '"+sClass2+ "', '"+ sClass3+"')");


And this in "on exit":

Code:
string sName = SQLEncodeSpecialChars(nome);
SQLExecDirect("DELETE FROM onlineplayers WHERE name= '"+sName+"'");


The problem is that just sometimes the records are deleted from the list.
Can anyone help me with this ?

I have the suposition that SQLFetch() has to do with it, but I didn't understood what that one does....

Cheers, Rufus
Back to top
View user's profile Send private message Send e-mail
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Mon Feb 12, 2007 23:32    Post subject: Reply with quote

Could you please enable full logging (2) in your DB plugin INI and then post the relevant sql statements. Ideal would be one statement where it works, and one where the row is not deleted after logging out.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Rufus Dely



Joined: 12 Feb 2007
Posts: 2

PostPosted: Wed Feb 14, 2007 10:14    Post subject: Reply with quote

Sorry , X-man, was only my mistake becouse I put the SQLExecDirect function inside of an if statement, wich made the function run only if the players were not at 100 % health.

I appologise for the disturb and thanx for your disponibility.

This rush.....
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules 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