14.05.2012, 09:08
I have an dynamic house system that works great so far, except the part when the server restart's, The houses do not load in game.
They save perfectly into MYSQL with the right position, but thats it.
Heres the code where the house's gets loaded.
Any ideas on how to fix this?
They save perfectly into MYSQL with the right position, but thats it.
Heres the code where the house's gets loaded.
Код:
stock MySQL_House(playerid) { new query[300], pname[24], savingstring[20],string1[128]; GetPlayerName(playerid, pname, 24); format(query, sizeof(query), "SELECT * FROM house WHERE houseid = <0"); mysql_query(query); mysql_store_result(); while(mysql_fetch_row_format(query,"|")) { mysql_fetch_field_row(savingstring, "houseid"); HouseID[playerid] = strval(savingstring); mysql_fetch_field_row(savingstring, "Owner"); HouseOwner[playerid] = strval(savingstring); mysql_fetch_field_row(savingstring, "xHPos"); zHPos[playerid] = strval(savingstring); mysql_fetch_field_row(savingstring, "yHPos"); yHPos[playerid] = strval(savingstring); mysql_fetch_field_row(savingstring, "zHPos"); zHPos[playerid] = strval(savingstring); new X = xHPos[playerid]; new Y = yHPos[playerid]; new Z = zHPos[playerid]; format(string1,sizeof string1,"House Owner: %s\nX:%d, Y:%d,Z:%d\nHouse ID:%d",HouseOwner,xHPos,yHPos,zHPos,HouseID); CreatePickup(1273,1,X,Y,Z); Create3DTextLabel(string1, 0xFFFFFFFF, X,Y,Z, 10.0, 0, 0); } mysql_free_result(); return 1; }