22.01.2011, 08:27
how do you make mysql save data when the player crashes or server restarts?
SavePlayer(playerid) { if(!PlayerLogged[playerid]) return 0; Money[playerid] = GetPlayerMoney(playerid); skin[playerid] = GetPlayerSkin(playerid); GetPlayerPos(playerid, X[playerid],Y[playerid],Z[playerid]); GetPlayerFacingAngle(playerid, Ang[playerid]); CheckMySQL(); new string[256]; format(string, sizeof(string), "UPDATE Users SET Money='%d',skin='%d',X='%f',Y='%f',Z='%f',Angle='%f',dlic='%d' WHERE Name='%s'", Money[playerid], skin[playerid],X[playerid],Y[playerid],Z[playerid],Ang[playerid],dlic[playerid], Name[playerid]); mysql_query(string); return 1; }