[Ajuda] O que tem de errado com esse salvamento de casas?
#1

Fiz o de carro e ta funcionando normal...
Mas o de casa e nгo salva de jeito nenhum, tem algo errado?

Код:
stock SalvarCasas() {
	for(new houseid = 1; houseid < MAX_HOUSES; houseid++) {
		new rows, fields;
		cache_get_row_count(rows);
		cache_get_field_count(fields);
		if(rows) {
			new query[1030];
		    mysql_format(ConnectMYSQL, query, sizeof(query), "UPDATE `houses` SET `hType` = '%d', `hOwner` = '%d', `hOutPosX` = '%f', `hOutPosY` = '%f', `hOutPosZ` = '%f', `hLocked` = '%d', `hAlarm` = '%d', `hMoney` = '%d', `hMaconha` = '%d', `hMaterial` = '%d', `FHQ` = '%d' WHERE `hID` = '%i'",
				HouseInfo[houseid][hType],
				HouseInfo[houseid][hOwner],
				HouseInfo[houseid][hOutPosX],
				HouseInfo[houseid][hOutPosY],
				HouseInfo[houseid][hOutPosZ],
				HouseInfo[houseid][hLocked],
				HouseInfo[houseid][hAlarm],
				HouseInfo[houseid][hMoney],
				HouseInfo[houseid][hMaconha],
				HouseInfo[houseid][hMaterial],
				HouseInfo[houseid][FHQ],
		    houseid);
		    mysql_pquery(ConnectMYSQL, query);
		}
	}
}
Reply
#2

Retire essa checagem de rows, jб que nгo tem nenhum query antes, ficando assim:
Код:
stock SalvarCasas() {
    new query[1030];
	for(new houseid = 1; houseid < MAX_HOUSES; houseid++) {
	    mysql_format(ConnectMYSQL, query, sizeof(query), "UPDATE `houses` SET `hType` = '%d', `hOwner` = '%d', `hOutPosX` = '%f', `hOutPosY` = '%f', `hOutPosZ` = '%f', `hLocked` = '%d', `hAlarm` = '%d', `hMoney` = '%d', `hMaconha` = '%d', `hMaterial` = '%d', `FHQ` = '%d' WHERE `hID` = '%i'",
			HouseInfo[houseid][hType],
			HouseInfo[houseid][hOwner],
			HouseInfo[houseid][hOutPosX],
			HouseInfo[houseid][hOutPosY],
			HouseInfo[houseid][hOutPosZ],
			HouseInfo[houseid][hLocked],
			HouseInfo[houseid][hAlarm],
			HouseInfo[houseid][hMoney],
			HouseInfo[houseid][hMaconha],
			HouseInfo[houseid][hMaterial],
			HouseInfo[houseid][FHQ],
	    houseid);
	    mysql_pquery(ConnectMYSQL, query);
	}
}
Reply
#3

Quote:
Originally Posted by RodrigoMSR
Посмотреть сообщение
Retire essa checagem de rows, jб que nгo tem nenhum query antes, ficando assim:
Код:
stock SalvarCasas() {
    new query[1030];
	for(new houseid = 1; houseid < MAX_HOUSES; houseid++) {
	    mysql_format(ConnectMYSQL, query, sizeof(query), "UPDATE `houses` SET `hType` = '%d', `hOwner` = '%d', `hOutPosX` = '%f', `hOutPosY` = '%f', `hOutPosZ` = '%f', `hLocked` = '%d', `hAlarm` = '%d', `hMoney` = '%d', `hMaconha` = '%d', `hMaterial` = '%d', `FHQ` = '%d' WHERE `hID` = '%i'",
			HouseInfo[houseid][hType],
			HouseInfo[houseid][hOwner],
			HouseInfo[houseid][hOutPosX],
			HouseInfo[houseid][hOutPosY],
			HouseInfo[houseid][hOutPosZ],
			HouseInfo[houseid][hLocked],
			HouseInfo[houseid][hAlarm],
			HouseInfo[houseid][hMoney],
			HouseInfo[houseid][hMaconha],
			HouseInfo[houseid][hMaterial],
			HouseInfo[houseid][FHQ],
	    houseid);
	    mysql_pquery(ConnectMYSQL, query);
	}
}
Mas eu li num tutorial que sempre tem que ter rows ao dar update, pq checa se tem essa coluna lб, se nгo pode dar merda, nгo й?
Reply
#4

Esqueci de comentar ontem, estб funcionando, mas /\
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)