07.02.2018, 18:05
Oh, the coords are not correct, if i check my position, for example is:
1941.3182, 1314.4194, 9.2578
and in database is
1156753967, 1151618412, 1091837952
The /addhouse command:
i put only the model = 1 because the rest is same
1941.3182, 1314.4194, 9.2578
and in database is
1156753967, 1151618412, 1091837952
The /addhouse command:
Код:
CMD:addhouse(playerid, params[]) { new model; if(sscanf(params, "d", model)) return SendClientMessage(playerid, COLOR_WHITE, ""dr"Usage: "w"/addhouse [1-small 2-medium 3-big]"); if(model > 3 || model < 1) return SendClientMessage(playerid, COLOR_WHITE, ""dr"Usage: "w"/addhouse [1-small 2-medium 3-big]"); new Float:px, Float:py, Float:pz, Float:pinterior; GetPlayerPos(playerid, px, py, pz); pinterior = GetPlayerInterior(playerid); if(model == 1) { new randomsmall = random(sizeof(SmallHouses)); new DB_Query[600]; mysql_format(Database, DB_Query, sizeof(DB_Query), "INSERT INTO `HOUSES` (`EnterX`, `EnterY`, `EnterZ`, `ExitX`, `ExitY`, `ExitZ`, `InsideInt`, `OutsideInt`, `Level`, `Owner`, `Price`) \ VALUES ('%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', 'None', '%d')", \ px, py, pz, SmallHouses[randomsmall][EH_X], SmallHouses[randomsmall][EH_Y], SmallHouses[randomsmall][EH_Z], SmallHouses[randomsmall][EH_Interior], pinterior, 5, 50000000, 1, 1); mysql_query(Database, DB_Query); mysql_query(Database, "SELECT * FROM `HOUSES`"); new rows = cache_num_rows(); new string[255]; format(string, sizeof(string), ""dr"Small House added (%d) at %d, %d, %d", rows, px, py, pz); SendClientMessage(playerid, COLOR_WHITE, string); LoadHouses(); return 1; }