Max Ganglockers Problem
#1

Hello, I have gang locker system on my script and was Max 30 locker but i adjusted it to 80 and when i create locker from id 30+ Not saving in the database why?, only i have ID from 1 to 30 in the db how i can add more?

I made it like that
Код:
#define 		MAX_GANGLOCKER 				(80)
This is Screenshot of database
http://prntscr.com/hdaytw
Reply
#2

Can you paste the query?
Reply
#3

query of?
Reply
#4

The query of adding new locker IDs.
Reply
#5

Код:
stock SaveGangLocker(id)
{
	new string[1024];
	format(string, sizeof(string), "UPDATE `ganglockers` SET \
		`PosX`=%f, \
		`PosY`=%f, \
		`PosZ`=%f, \
		`VW`=%d, \
		`Int`=%d, \
		`Type`=%d, \
		`Family`=%d WHERE `id`=%d",
		GangLockers[id][glockerPosX],
		GangLockers[id][glockerPosY],
		GangLockers[id][glockerPosZ],
		GangLockers[id][glockerVW],
		GangLockers[id][glockerInt],
		GangLockers[id][glockerType],
		GangLockers[id][glockerFamily],
		id+1
	);

	mysql_function_query(MainPipeline, string, false, "OnQueryFinish", "i", SENDDATA_THREAD);
}
Idk if this help too
Код:
stock SaveGangLockers()
{
	for(new i = 0; i < MAX_GANGLOCKER; i++)
	{
		SaveGangLocker(i);
	}
	return 1;
}

stock RehashGangLocker(id)
{
	DestroyDynamic3DTextLabel(GangLockers[id][glockerTextID]);
	GangLockers[id][glockerSQLId] = 1;
	GangLockers[id][glockerPosX] = 0.0;
	GangLockers[id][glockerPosY] = 0.0;
	GangLockers[id][glockerPosZ] = 0.0;
	GangLockers[id][glockerVW] = 0;
	GangLockers[id][glockerInt] = 0;
	GangLockers[id][glockerType] = 0;
	GangLockers[id][glockerFamily] = 0;
	LoadGangLocker(id);
}

stock RehashGangLockers()
{
	printf("[RehashGangLockers] Deleting Gang Lockers from server...");
	for(new i = 0; i < MAX_GANGLOCKER; i++)
	{
		RehashGangLocker(i);
	}
	LoadGangLockers();
}

stock LoadGangLocker(id)
{
	new string[128];
	format(string, sizeof(string), "SELECT * FROM `ganglockers` WHERE `id`=%d", id);
	mysql_function_query(MainPipeline, string, true, "OnLoadGangLocker", "i", id);
}

stock LoadGangLockers()
{
	printf("[LoadGangLockers] Loading data from database...");
	mysql_function_query(MainPipeline, "SELECT * FROM `ganglockers`", true, "OnLoadGangLockers", "");
}
Reply
#6

Post your SaveGangLocker code
Reply
#7

I already did

Код:
stock SaveGangLocker(id)
{
	new string[1024];
	format(string, sizeof(string), "UPDATE `ganglockers` SET \
		`PosX`=%f, \
		`PosY`=%f, \
		`PosZ`=%f, \
		`VW`=%d, \
		`Int`=%d, \
		`Type`=%d, \
		`Family`=%d WHERE `id`=%d",
		GangLockers[id][glockerPosX],
		GangLockers[id][glockerPosY],
		GangLockers[id][glockerPosZ],
		GangLockers[id][glockerVW],
		GangLockers[id][glockerInt],
		GangLockers[id][glockerType],
		GangLockers[id][glockerFamily],
		id+1
	);

	mysql_function_query(MainPipeline, string, false, "OnQueryFinish", "i", SENDDATA_THREAD);
}
Reply
#8

This code doesn't help a lot, show us debugs of mysql logs, mysql insert ids, the code where you create the "gang locker" etc.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)