12.02.2011, 22:39
yeah, I'm trying to create a mySQL house system for my server, it's going pretty well, but I got struck on this problem, I've been trying to solve it for 3 hours now, used all kinds of method and right now I really can't seem to fix it myself, so I hope someone is ready to help me.
So the problem is, that the checkpoint doesn't show up when I restart the server.
Also I was wondering if this could be done without timer, because I'm having an exact same stock function, no differences between the stock function LoadHouses and public function LoadHouses2. Except that the LoadHouses can't be used for the SetTimer.
Maybe something like this?
Code:
forward LoadHouses2(iPlayer); public LoadHouses2(iPlayer) { new Query[700], dHouseID, dHouseOwner[24], Float:houseX, Float:houseY, Float:houseZ; if(mysql_fetch_row(Query)) { sscanf(Query, "e<p<|>ds[24]fff>", dHouseID, dHouseOwner, houseX, houseY, houseZ); // Remember to update this if you add more info... mysql_free_result(); HouseCount ++; new h = HouseCount; HouseCPOut[h] = CreateDynamicCP(houseX, houseY, houseZ, 1.5, 0, 0, -1, 5.0); } return 1; } // --------------------------------------------------------------------------------------------------------- public OnGameModeInIt(); { SetTimer("LoadHouses2", 500, 0); return 1; }
Also I was wondering if this could be done without timer, because I'm having an exact same stock function, no differences between the stock function LoadHouses and public function LoadHouses2. Except that the LoadHouses can't be used for the SetTimer.
Maybe something like this?
Code:
forward LoadHouses3(); public LoadHouses3() { new iPlayer; // I know this is probably wrong... but my mind is sort of "fucked" right now.. can't think straight. LoadHouses(iPlayer); return 1; } stock LoadHouses(iPlayer) { new Query[700]; if(mysql_fetch_row(Query)) { sscanf(Query, "e<p<|>ds[24]fff>", PVar2[iPlayer]); // Remember to update this if you add more info... mysql_free_result(); // foreach(Player, i) HouseCount ++; new h = HouseCount; HouseCPOut[h] = CreateDynamicCP(PVar2[h][hX], PVar2[h][hY], PVar2[h][hZ], 1.5, 0, 0, -1, 5.0); } return 1; }