House System Problem
#8

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:

Код:
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;
	}
i put only the model = 1 because the rest is same
Reply


Messages In This Thread
House System Problem - by C0oL3r - 06.02.2018, 22:38
Re: House System Problem - by MarkNelson - 06.02.2018, 22:59
Re: House System Problem - by C0oL3r - 06.02.2018, 23:04
Re: House System Problem - by MarkNelson - 06.02.2018, 23:06
Re: House System Problem - by PepsiCola23 - 06.02.2018, 23:07
Re: House System Problem - by C0oL3r - 07.02.2018, 17:22
Re: House System Problem - by jasperschellekens - 07.02.2018, 17:56
Re: House System Problem - by C0oL3r - 07.02.2018, 18:05
Re: House System Problem - by jasperschellekens - 07.02.2018, 20:21
Re: House System Problem - by Mugala - 08.02.2018, 10:22

Forum Jump:


Users browsing this thread: 1 Guest(s)