[MYSQL] Savegate
#1

i was trying to create an gate system but now the problem is that the gates wont be saving,when i create the gate , it saves okay with the coords but when i edit it , it wont update the coords and reloading it sends back to the old coords at the status where it was created.

Gated edit and Save gates
Код:
stock SaveGate(gateid)
{
	new iQuery[750], iFormat[212];
	strcat(iQuery, "UPDATE `GateInfo` SET ");
	mysql_format(MySQLPipeline, iFormat, sizeof(iFormat), "`ID` = '%d', ", gateid); strcat(iQuery, iFormat);
	mysql_format(MySQLPipeline, iFormat, sizeof(iFormat), "`X` = '%f', ", GateInfo[gateid][gateX]); strcat(iQuery, iFormat);
	mysql_format(MySQLPipeline, iFormat, sizeof(iFormat), "`Y` = '%f', ", GateInfo[gateid][gateY]); strcat(iQuery, iFormat);
	mysql_format(MySQLPipeline, iFormat, sizeof(iFormat), "`Z` = '%f', ", GateInfo[gateid][gateZ]); strcat(iQuery, iFormat);
	mysql_format(MySQLPipeline, iFormat, sizeof(iFormat), "`rotX` = '%f', ", GateInfo[gateid][gaterotX]); strcat(iQuery, iFormat);
	mysql_format(MySQLPipeline, iFormat, sizeof(iFormat), "`rotY` = '%f', ", GateInfo[gateid][gaterotY]); strcat(iQuery, iFormat);
	mysql_format(MySQLPipeline, iFormat, sizeof(iFormat), "`rotZ` = '%f', ", GateInfo[gateid][gaterotZ]); strcat(iQuery, iFormat);
	mysql_format(MySQLPipeline, iFormat, sizeof(iFormat), "`Interior` = %d, `VirtualWorld` = %d, ", GateInfo[gateid][gateInterior], GateInfo[gateid][gateVirtualWorld]); strcat(iQuery, iFormat);
    mysql_format(MySQLPipeline, iFormat, sizeof(iFormat), "`Model` = '%f', ", GateInfo[gateid][gateModel]); strcat(iQuery, iFormat);
	mysql_tquery(MySQLPipeline, iQuery);
	return 1;
}

else if(!strcmp(tmp, "edit", true, 4))
	{
		new atmid = GetClosestGate(playerid);
		if(atmid == -1) return SendClientError(playerid, "No Gate found!");
		if(GetPlayerDistanceToPointEx(playerid, GateInfo[atmid][gateX], GateInfo[atmid][gateY], GateInfo[atmid][gateZ]) < 8)
		{
		    EditDynamicObject(playerid, GateInfo[atmid][gateObject]);
		    gateedit[playerid] = 1;
		}
		else return SendClientError(playerid, "You are not close enough to an Gate right now!");
	}
also reloading command auto saves the gate

EditDyanmicObject
Код:
if(gateedit[playerid] == 1)
		{
			new atmid = GetClosestGate(playerid);
			if(GetPlayerDistanceToPointEx(playerid, GateInfo[atmid][gateX], GateInfo[atmid][gateY], GateInfo[atmid][gateZ]) < 8)
			{
				if(GateInfo[atmid][gateObject] == objectid)
				{
					GateInfo[atmid][gateX] = x;
					GateInfo[atmid][gateY] = y;
					GateInfo[atmid][gateZ] = z;
					GateInfo[atmid][gaterotX] = rx;
					GateInfo[atmid][gaterotY] = ry;
					GateInfo[atmid][gaterotZ] = rz;
					GateInfo[atmid][oldx] = x;
					GateInfo[atmid][oldy] = y;
					GateInfo[atmid][oldz] = z;
					return 1;
				}
			}
		}
Reply


Messages In This Thread
[MYSQL] Savegate - by ThatFag - 25.10.2016, 13:39
Re: [MYSQL] Savegate - by Mister0 - 25.10.2016, 14:07
Re: [MYSQL] Savegate - by oMa37 - 25.10.2016, 14:11
Re: [MYSQL] Savegate - by ThatFag - 25.10.2016, 18:33
Re: [MYSQL] Savegate - by oMa37 - 25.10.2016, 20:17
Re: [MYSQL] Savegate - by ThatFag - 26.10.2016, 12:41

Forum Jump:


Users browsing this thread: 1 Guest(s)