Funkis

Saugojimas . krovimas

Recommended Posts

stock savePlayer(pid)
{
	static Float:x, Float:y, Float:z;
	GetPlayerPos(pid, x,y,z);

	format(g_szBuffer, sizeof g_szBuffer, 

		"UPDATE "MySQL_PLAYERS_TABLE" SET \
\
			Newbie = %i, 	\
			pMoney = %i, 	\
			pXp = %i, 		\
			pAdmin = %i,	\
			x = %f,			\
			y = %f,			\
			z = %f,			\
			pSkin = %i		\
			Leader = %i		\
			SubLeader = %i		\
			WorkId = %i		\
			WorkStatus = %i		\
			WorkSkin = %i		\
			WorkContract = %i		\
\
		WHERE id = %i",
		player[pid][pNewbie],
		getPlayerMoney(pid), 
		getPlayerXp(pid), 
		getPlayerAdmin(pid),
		x,
		y,
		z,
		GetPlayerSkin(pid), 
		player[pid][pWorkLeader],
		player[pid][pWorkSubLeader],
		player[pid][pWorkClothes],
		player[pid][pWorkStatus],
		player[pid][pWork],
		player[pid][pWorkContract],
		

		getPlayerSqlID(pid) // šitas privalo likti paskutinis
	);

	sql_query(sql, g_szBuffer, QUERY_THREADED); // threaded naudoti kai neimi duomenų iš mysql
}

stock loadPlayer(pid)
{
	new const Result:r = sql_query(sql, 

		f("SELECT * FROM "MySQL_PLAYERS_TABLE" WHERE id = '%i'", getPlayerSqlID(pid)), 
		QUERY_CACHED // cached naudoti kai imi duomenis iš mysql
	);
	player[pid][pNewbie] = sql_get_field_assoc_int(r, "Newbie");
	setPlayerMoney(pid, sql_get_field_assoc_int(r, "pMoney"));
	setPlayerXp(pid, sql_get_field_assoc_int(r, "pXp"));
	setPlayerAdmin(pid, sql_get_field_assoc_int(r, "pAdmin"));
	SetSpawnInfo(pid, 0, 
		sql_get_field_assoc_int(r, "pSkin"),
		sql_get_field_assoc_float(r, "x"),
		sql_get_field_assoc_float(r, "y"),
		sql_get_field_assoc_float(r, "z"),
		0,0,0,0,0,0,0);
	player[pid][pWorkLeader] = sql_get_field_assoc_int(r, "Leader");
	player[pid][pWorkSubLeader] = sql_get_field_assoc_int(r, "SubLeader");
	player[pid][pWorkClothes] = sql_get_field_assoc_int(r, "WorkSkin");
	player[pid][pWorkStatus] = sql_get_field_assoc_int(r, "WorkStatus");
	player[pid][pWork] = sql_get_field_assoc_int(r, "WorkId");
	player[pid][pWorkContract] = sql_get_field_assoc_int(r, "WorkContract");
}

idk. nenustat─Ś nei pozicijos, nei skino.

 

log:

[10:19:26][debug] Natives::sql_query: Executing statement (stmt->id = 4, stmt->query = SELECT id FROM users WHERE pName = 'Papisk_Isikna')...
[10:19:26][debug] Natives::sql_query: Statement executed (stmt->id = 4, stmt->error = 0). No callback found!
[10:19:26][debug] Natives::sql_num_rows: Retrieving the count of rows (stmt->id = 4)...
[10:19:28][debug] Natives::sql_query: Executing statement (stmt->id = 5, stmt->query = SELECT pPw FROM users WHERE id = 1)...
[10:19:28][debug] Natives::sql_query: Statement executed (stmt->id = 5, stmt->error = 0). No callback found!
[10:19:28][debug] Natives::sql_query: Executing statement (stmt->id = 6, stmt->query = SELECT * FROM users WHERE id = '1')...
[10:19:28][debug] Natives::sql_query: Statement executed (stmt->id = 6, stmt->error = 0). No callback found!
[10:19:43][debug] Natives::sql_query: Scheduling statement (stmt->id = 7, stmt->query = UPDATE users SET Newbie = 0, 	pMoney = 0, 	pXp = 0, 		pAdmin = 0,	x = 2024.137329,			y = 1343.058105,			z = 10.820312,			pSkin = 0		Leader = 0		SubLeader = 0		WorkId = 0		WorkStatus = 0		WorkSkin = 0		WorkContract = 2014		WHERE id = 1, stmt->callback = ) for execution...
[10:19:43][debug] SQL_Worker[1]: Executing query (stmt->id = 7, stmt->query = UPDATE users SET Newbie = 0, 	pMoney = 0, 	pXp = 0, 		pAdmin = 0,	x = 2024.137329,			y = 1343.058105,			z = 10.820312,			pSkin = 0		Leader = 0		SubLeader = 0		WorkId = 0		WorkStatus = 0		WorkSkin = 0		WorkContract = 2014		WHERE id = 1)...
[10:19:43][debug] ProccessTick: Executing query callback (stmt->id = 7, stmt->error = 1064, stmt->callback = )...
[10:19:43][debug] ProccessTick: Erasing query (stmt->id = 7)...

Dalintis ┼í─» prane┼íim─ů


Nuoroda iki šio pranešimo
Dalintis per kit─ů puslap─»

 

 

pSkin = %i        \

            Leader = %i        \

            SubLeader = %i        \

            WorkId = %i        \

            WorkStatus = %i        \

            WorkSkin = %i        \

            WorkContract = %i        \

Kur kableliai po stulpeli┼│ pavadinim┼│?

Dalintis ┼í─» prane┼íim─ů


Nuoroda iki šio pranešimo
Dalintis per kit─ů puslap─»

Kur kableliai po stulpeli┼│ pavadinim┼│?

o tarkim ┼żaid─Śjo darbo kontrakto laik─ů kaip saugoti int ar timestramp? Nes su timestamp, ten man mysql ka┼żkas ne to gaunasi :D

stock savePlayer(pid)
{
	static Float:x, Float:y, Float:z;
	GetPlayerPos(pid, x,y,z);

	format(g_szBuffer, sizeof g_szBuffer, 

		"UPDATE "MySQL_PLAYERS_TABLE" SET \
\
			Newbie = %i, 	\
			pMoney = %i, 	\
			pXp = %i, 		\
			pAdmin = %i,	\
			x = %f,			\
			y = %f,			\
			z = %f,			\
			pSkin = %i,		\
			Leader = %i,	\
			SubLeader = %i,		\
			WorkId = %i,		\
			WorkStatus = %i,		\
			WorkSkin = %i,		\
			WorkContract = %i		\
\
		WHERE id = %i",
		player[pid][pNewbie],
		getPlayerMoney(pid), 
		getPlayerXp(pid), 
		getPlayerAdmin(pid),
		x,
		y,
		z,
		GetPlayerSkin(pid), 
		player[pid][pWorkLeader],
		player[pid][pWorkSubLeader],
		player[pid][pWorkClothes],
		player[pid][pWorkStatus],
		player[pid][pWork],
		player[pid][pWorkContract],
		

		getPlayerSqlID(pid) // šitas privalo likti paskutinis
	);

	sql_query(sql, g_szBuffer, QUERY_THREADED); // threaded naudoti kai neimi duomenų iš mysql
}

skin ir koord. išsaugojo, bet vis tiek neveikia. 

Dalintis ┼í─» prane┼íim─ů


Nuoroda iki šio pranešimo
Dalintis per kit─ů puslap─»

Pawn'e timestamp ir yra int. Jei kalbi apie lentel─Śs tip─ů, irgi naudok INT.

 

 

Parodyk kaip dabar atrodo mysql log.

Dalintis ┼í─» prane┼íim─ů


Nuoroda iki šio pranešimo
Dalintis per kit─ů puslap─»

Pawn'e timestamp ir yra int. Jei kalbi apie lentel─Śs tip─ů, irgi naudok INT.

 

 

Parodyk kaip dabar atrodo mysql log.


[10:12:08][debug] ProccessTick: Executing query callback (stmt->id = 3, stmt->error = 1064, stmt->callback = )...
[10:12:08][debug] ProccessTick: Erasing query (stmt->id = 3)...
[10:17:18][warning] Natives::sql_debug: Switching the log levels to (1, 3)...
[10:17:18][warning] Natives::sql_connect: The `pass` field is empty.
[10:17:18][info] Natives::sql_connect: Connecting to database (type = 1) root:***@localhost:0/uRPG...
[10:17:18][info] Natives::sql_connect: Connection (conn->id = 1) was succesful!
[10:17:18][debug] Natives::sql_ping: Pinging conn (conn->id = 1)...
[10:17:45][debug] Natives::sql_query: Executing statement (stmt->id = 1, stmt->query = SELECT id FROM users WHERE pName = 'Papisk_Isikna')...
[10:17:45][debug] Natives::sql_query: Statement executed (stmt->id = 1, stmt->error = 0). No callback found!
[10:17:45][debug] Natives::sql_num_rows: Retrieving the count of rows (stmt->id = 1)...
[10:17:48][debug] Natives::sql_query: Executing statement (stmt->id = 2, stmt->query = INSERT INTO users (pName, pPw) VALUES ('Papisk_Isikna', '68628A9D5ADF54B3284471A50790358C7F70156C019B82BDA2697081FD4BB7C5A12D7FA66CF59E5BF31F7D4F46424F1C423A3923A63ED693DAB08E1AE4C7ABF4'))...
[10:17:48][debug] Natives::sql_query: Statement executed (stmt->id = 2, stmt->error = 0). No callback found!
[10:17:48][debug] Natives::sql_insert_id: Retrieving insert ID (stmt->id = 2)...
[10:18:10][debug] Natives::sql_query: Scheduling statement (stmt->id = 3, stmt->query = UPDATE users SET Newbie = 0, 	pMoney = 0, 	pXp = 0, 		pAdmin = 0,	x = -1983.175415,			y = 132.609344,			z = 30.408462,			pSkin = 46		Leader = 0		SubLeader = 0		WorkId = 0		WorkStatus = 0		WorkSkin = 0		WorkContract = 0		WHERE id = 1, stmt->callback = ) for execution...
[10:18:10][debug] SQL_Worker[1]: Executing query (stmt->id = 3, stmt->query = UPDATE users SET Newbie = 0, 	pMoney = 0, 	pXp = 0, 		pAdmin = 0,	x = -1983.175415,			y = 132.609344,			z = 30.408462,			pSkin = 46		Leader = 0		SubLeader = 0		WorkId = 0		WorkStatus = 0		WorkSkin = 0		WorkContract = 0		WHERE id = 1)...
[10:18:10][debug] ProccessTick: Executing query callback (stmt->id = 3, stmt->error = 1064, stmt->callback = )...
[10:18:10][debug] ProccessTick: Erasing query (stmt->id = 3)...
[10:19:26][debug] Natives::sql_query: Executing statement (stmt->id = 4, stmt->query = SELECT id FROM users WHERE pName = 'Papisk_Isikna')...
[10:19:26][debug] Natives::sql_query: Statement executed (stmt->id = 4, stmt->error = 0). No callback found!
[10:19:26][debug] Natives::sql_num_rows: Retrieving the count of rows (stmt->id = 4)...
[10:19:28][debug] Natives::sql_query: Executing statement (stmt->id = 5, stmt->query = SELECT pPw FROM users WHERE id = 1)...
[10:19:28][debug] Natives::sql_query: Statement executed (stmt->id = 5, stmt->error = 0). No callback found!
[10:19:28][debug] Natives::sql_query: Executing statement (stmt->id = 6, stmt->query = SELECT * FROM users WHERE id = '1')...
[10:19:28][debug] Natives::sql_query: Statement executed (stmt->id = 6, stmt->error = 0). No callback found!
[10:19:43][debug] Natives::sql_query: Scheduling statement (stmt->id = 7, stmt->query = UPDATE users SET Newbie = 0, 	pMoney = 0, 	pXp = 0, 		pAdmin = 0,	x = 2024.137329,			y = 1343.058105,			z = 10.820312,			pSkin = 0		Leader = 0		SubLeader = 0		WorkId = 0		WorkStatus = 0		WorkSkin = 0		WorkContract = 2014		WHERE id = 1, stmt->callback = ) for execution...
[10:19:43][debug] SQL_Worker[1]: Executing query (stmt->id = 7, stmt->query = UPDATE users SET Newbie = 0, 	pMoney = 0, 	pXp = 0, 		pAdmin = 0,	x = 2024.137329,			y = 1343.058105,			z = 10.820312,			pSkin = 0		Leader = 0		SubLeader = 0		WorkId = 0		WorkStatus = 0		WorkSkin = 0		WorkContract = 2014		WHERE id = 1)...
[10:19:43][debug] ProccessTick: Executing query callback (stmt->id = 7, stmt->error = 1064, stmt->callback = )...
[10:19:43][debug] ProccessTick: Erasing query (stmt->id = 7)...
[10:28:19][warning] Natives::sql_debug: Switching the log levels to (1, 3)...
[10:28:19][warning] Natives::sql_connect: The `pass` field is empty.
[10:28:19][info] Natives::sql_connect: Connecting to database (type = 1) root:***@localhost:0/uRPG...
[10:28:20][info] Natives::sql_connect: Connection (conn->id = 1) was succesful!
[10:28:20][debug] Natives::sql_ping: Pinging conn (conn->id = 1)...
[10:28:47][debug] Natives::sql_query: Executing statement (stmt->id = 1, stmt->query = SELECT id FROM users WHERE pName = 'Papisk_Isikna')...
[10:28:47][debug] Natives::sql_query: Statement executed (stmt->id = 1, stmt->error = 0). No callback found!
[10:28:47][debug] Natives::sql_num_rows: Retrieving the count of rows (stmt->id = 1)...
[10:30:41][debug] Natives::sql_query: Executing statement (stmt->id = 4, stmt->query = SELECT id FROM users WHERE pName = 'Papisk_Isikna')...
[10:30:41][debug] Natives::sql_query: Statement executed (stmt->id = 4, stmt->error = 0). No callback found!
[10:30:41][debug] Natives::sql_num_rows: Retrieving the count of rows (stmt->id = 4)...
[10:30:44][debug] Natives::sql_query: Executing statement (stmt->id = 5, stmt->query = SELECT pPw FROM users WHERE id = 1)...
[10:30:44][debug] Natives::sql_query: Statement executed (stmt->id = 5, stmt->error = 0). No callback found!
[10:30:44][debug] Natives::sql_query: Executing statement (stmt->id = 6, stmt->query = SELECT * FROM users WHERE id = '1')...
[10:30:44][debug] Natives::sql_query: Statement executed (stmt->id = 6, stmt->error = 0). No callback found!
[10:30:53][debug] Natives::sql_query: Scheduling statement (stmt->id = 7, stmt->query = UPDATE users SET Newbie = 0, 	pMoney = 0, 	pXp = 0, 		pAdmin = 0,	x = 1966.387695,			y = 1340.849975,			z = 16.698804,			pSkin = 0,		Leader = 0,	SubLeader = 0,		WorkId = 0,		WorkStatus = 0,		WorkSkin = 0,		WorkContract = 0		WHERE id = 1, stmt->callback = ) for execution...
[10:30:53][debug] SQL_Worker[1]: Executing query (stmt->id = 7, stmt->query = UPDATE users SET Newbie = 0, 	pMoney = 0, 	pXp = 0, 		pAdmin = 0,	x = 1966.387695,			y = 1340.849975,			z = 16.698804,			pSkin = 0,		Leader = 0,	SubLeader = 0,		WorkId = 0,		WorkStatus = 0,		WorkSkin = 0,		WorkContract = 0		WHERE id = 1)...
[10:30:53][debug] ProccessTick: Executing query callback (stmt->id = 7, stmt->error = 0, stmt->callback = )...
[10:30:53][debug] ProccessTick: Erasing query (stmt->id = 7)...
Redaguota , nario Funkis

Dalintis ┼í─» prane┼íim─ů


Nuoroda iki šio pranešimo
Dalintis per kit─ů puslap─»

Prisijungti prie diskusijos

Palikti atsakym─ů galite i┼í karto, o u┼żsiregistruoti v─Śliau. Jeigu jau turite paskyr─ů m┼źs┼│ forume, Prisijunkite.

Sve─Źias
Atsakyti šioje temoje...

×   ─«klijuotas tekstas turi teksto formatavim─ů.   Pa┼íalinti teksto formatavim─ů

  Galimi tik 75 veidukai.

×   Nuoroda buvo automati┼íkai ─»terpta.   ─«terpti nuorod─ů paprastai

×   J┼źs┼│ ankstesnis prane┼íimas buvo atkurtas.   I┼ívalyti redaktori┼│

×   You cannot paste images directly. Upload or insert images from URL.


  • ┼áiame puslapyje nar┼ío:   0 nariai

    N─Śra registruot┼│ nari┼│ per┼żi┼źrin─Źi┼│ ┼í─» forum─ů.


  • SuperGames programele
  • SuperGames programele