SQLite COUNT()
#1

My server crashes when this code executes.

Код:
stock CreatePlayerHouse(playerid, sellprice, HouseLvl)
{
		new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z);
		new DBResult: ID, Query[256];

       	format(Query, sizeof(Query), "SELECT COUNT * FROM `HOUSES`");
 		ID = 1 + db_query(Database, Query);
 		new string[128];
		format(string, sizeof (string), "ID = %d", ID);
		printf(string);
      	
      	format(Query, sizeof(Query), "INSERT INTO `HOUSES` ('NAME') VALUES('Grad')");
 		db_query(Database, Query);

		format(Query, sizeof(Query), "UPDATE `HOUSES` SET FOR_SELL = '1', SELL_PRICE = '%d', RENTPRICE = '1000', HOUSE_LEVEL = '%d', X = '%f', Y = '%f', Z = '%f' WHERE `ID` = '%d' ", sellprice, HouseLvl, X, Y, Z, ID);
 		db_query(Database, Query);
      	
      	LoadPlayerHouse(ID);
       	SendClientMessage(playerid, COLOR_WHITE, ".:: [HOUSE]: House has been Successfully created.");
		return true;
}
Код:
SA-MP Dedicated Server
----------------------
v0.3x, ©2005-2013 SA-MP Team

[21:34:52] filterscripts = ""  (string)
[21:34:52] 
[21:34:52] Server Plugins
[21:34:52] --------------
[21:34:52]  Loading plugin: streamer
[21:34:52] 

*** Streamer Plugin v2.6.1 by Incognito loaded ***

[21:34:52]   Loaded.
[21:34:52]  Loading plugin: sscanf
[21:34:52] 

[21:34:52]  ===============================

[21:34:52]       sscanf plugin loaded.     

[21:34:52]          Version:  2.8.1        

[21:34:52]    © 2012 Alex "******" Cole  

[21:34:52]  ===============================

[21:34:52]   Loaded.
[21:34:52]  Loaded 2 plugins.

[21:34:52] 
[21:34:52] Filterscripts
[21:34:52] ---------------
[21:34:52]   Loaded 0 filterscripts.

[21:34:52] 
----------------------------------
[21:34:52] -----Balkan Life Roleplay v0.2.2-----
[21:34:52] ----------------------------------

[21:34:52] Number of vehicle models: 49
[21:35:11] Incoming connection: 192.168.1.2:54665
[21:35:11] [join] Dado_Marcana has joined the server (0:192.168.1.2)
[21:35:31] RCON (In-Game): Player #0 (Dado_Marcana) has logged in.
[21:35:34] ID = 1
Reply


Messages In This Thread
SQLite COUNT() - by Danijel. - 07.07.2013, 19:33
Re: SQLite COUNT() - by Jefff - 07.07.2013, 19:46
Re: SQLite COUNT() - by ReVo_ - 07.07.2013, 19:48
Re: SQLite COUNT() - by Danijel. - 07.07.2013, 20:03
Re: SQLite COUNT() - by Konstantinos - 07.07.2013, 20:10
Re: SQLite COUNT() - by Danijel. - 07.07.2013, 20:31
Re: SQLite COUNT() - by Konstantinos - 07.07.2013, 20:38
Re: SQLite COUNT() - by Danijel. - 07.07.2013, 20:53
Re: SQLite COUNT() - by Konstantinos - 07.07.2013, 20:59
Re: SQLite COUNT() - by Danijel. - 07.07.2013, 21:00

Forum Jump:


Users browsing this thread: 1 Guest(s)