Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define THREAD_LOADHOUSES 100
- public OnFilterScriptInit()
- {
- //MySQL Connection
- MySQLConnect(MySQL_Hostname, MySQL_Username, MySQL_Database, MySQL_Password, MySQL_Connection, true);
- //Load Houses
- mysql_query("SELECT * FROM `houses`", THREAD_LOADHOUSES, -1);
- return 1;
- }
- public OnMysqlQuery(resultid, spareid, MySQL:handle)
- {
- switch(resultid)
- {
- case THREAD_LOADHOUSES:
- {
- mysql_store_result(handle);
- new HouseCount = 0, MySQL_Load[150];
- while(mysql_fetch_row(MySQL_Load, "|", handle))
- {
- new ID, Owner[24], HName[128], HPass[128], Float:X, Float:Y, Float:Z, Float:eX, Float:eY, Float:eZ, Float:eA, Doors, InteriorModel, Cost;
- sscanf(MySQL_Load, "p<|>ds[24]s[128]s[128]fffffffddd",
- ID,
- Owner,
- HName,
- HPass,
- X,
- Y,
- Z,
- eX,
- eY,
- eZ,
- eA,
- Doors,
- InteriorModel,
- Cost);
- CreateHouse(true, ID, Owner, HName, HPass, X, Y, Z, eX, eY, eZ, eA, Doors, InteriorModel, Cost);
- HouseCount ++;
- }
- printf("Number of created Houses: %d", HouseCount);
- mysql_free_result(handle);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment