View previous topic :: View next topic |
Author |
Message |
Rufus Dely
Joined: 12 Feb 2007 Posts: 2
|
Posted: Mon Feb 12, 2007 12:23 Post subject: On PC Enter/Exit script |
|
|
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 |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Mon Feb 12, 2007 23:32 Post subject: |
|
|
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 |
|
|
Rufus Dely
Joined: 12 Feb 2007 Posts: 2
|
Posted: Wed Feb 14, 2007 10:14 Post subject: |
|
|
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 |
|
|
|