Raised This Month: $ Target: $400
 0% 

SQLx doesnt load after server totally rebooted


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Raizio
Junior Member
Join Date: Oct 2006
Old 11-30-2007 , 07:05   SQLx doesnt load after server totally rebooted
Reply With Quote #1

All works fine, saving and loading when the server is up.. but when the server crashed or just shutted down and i boot it up again, it wont load the information for the player :S.

It's my first time with SQLx so any other fixes orso are welcome too =)


here are the pieces of code
Code:
public client_putinserver(id) {         set_task(0.5,"Load",id)     set_task(1.0,"DisplayInfo",id,"",0,"b")     set_task(1.0,"GainLevel",id,"",0,"b")     set_task(1.0,"ReSpawn",id,"",0,"b")     set_task(1.0,"Replenish",id,"",0,"b")     set_task(0.5,"checkforbuilding",id,"",0,"b")     jutsucooldown[id] = 0     strcomp[id] = 50 + g_iStrengthPoints[id] * 8         } public client_disconnect(id) {     remove_task(id,0)         Save(id,S_HUD);     Save(id,S_MISSION);     Save(id,S_STATS);     Save(id,S_EXP); } public Load(id) {     new Query[256],Authid[32];     get_user_authid(id,Authid,31);     format(Query,255,"SELECT * FROM stats WHERE Authid = '%s'",Authid);     SQL_ThreadQuery(g_SqlTuple,"LoadHandle",Query);     format(Query,255,"SELECT * FROM points WHERE Authid = '%s'",Authid);     SQL_ThreadQuery(g_SqlTuple,"LoadHandle",Query); } public LoadHandle(FailState,Handle:Query,Error[],Errcode,Data[],DataSize) {     if(FailState == TQUERY_CONNECT_FAILED) {         return log_amx("Could not connect to SQL database.  [%d] %s", Errcode, Error);     }     else if(FailState == TQUERY_QUERY_FAILED) {         return log_amx("Load Query failed.  [%d] %s", Errcode, Error);     }     if(Errcode) {         return log_amx("Error on query: %s",Error)     }     new id = str_to_num(Data);     if(!SQL_MoreResults(Query)) {         server_print("Unknown player")         new Authid[32],Query[256];         get_user_authid(id,Authid,31);         format(Query,255,"INSERT INTO stats VALUES('%s','%s','%s','%s','%s','%s')",Authid,g_iLevel[id],g_iExp[id],g_szRank[id],g_szClan[id],g_szMission[id]);         SQL_ThreadQuery(g_SqlTuple,"InsertHandle",Query);         format(Query,255,"INSERT INTO points VALUES('%s','%s','%s','%s','%s','%s','%s','%s','%s')",Authid,g_iBonusPoints[id],g_iChakraPoints[id],g_iSpeedPoints[id],g_iStrengthPoints,g_iStaminaPoints[id],g_iMaxChakra[id],g_iDefencePoints[id],g_iBalance[id]);         SQL_ThreadQuery(g_SqlTuple,"InsertHandle",Query);     }     return PLUGIN_CONTINUE }

it also doesnt give any error.

Last edited by Raizio; 11-30-2007 at 07:13.
Raizio is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:08.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode