SA-MP Forums Archive
error load some map from mysql - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: error load some map from mysql (/showthread.php?tid=624106)



error load some map from mysql - kloning1 - 11.12.2016

script
Код:
forward MapLoad();
public MapLoad()
{
	new query[254], jet;
	mysql_format(mysql, query, sizeof(query), "SELECT * FROM `maps` WHERE `mapid` = '%d' LIMIT 1", MapInfo[mapid]);
	mysql_tquery(mysql, query, "LoadMaps", "i", jet);
	return 1;
}
forward LoadMaps(jet);
public LoadMaps(jet)
{
	new jans[45];
	MapInfo[mapid] = cache_get_field_content_int(0,"mapid");
	cache_get_field_content(0, "Mapname", MapInfo[NamaMap], mysql, 50);
		   
	cache_get_field_content(0, "HumanS", jans, mysql, 35);
	sscanf(jans, "p<,>fff",MapInfo[HumanX],MapInfo[HumanY],MapInfo[HumanZ]);

	cache_get_field_content(0, "ZombieS", MapInfo[ZombieX], mysql, 35);
	sscanf(jans, "p<,>fff",MapInfo[ZombieX],MapInfo[ZombieY],MapInfo[ZombieZ]);
		   
	MapInfo[Durasi] = cache_get_field_content_int(0,"Duration");
	MapInfo[Deadtime] = cache_get_field_content_int(0,"Deadtime");
	MapInfo[Time] = cache_get_field_content_int(0,"Time");
	MapInfo[Weather] = cache_get_field_content_int(0,"Weather");
	MapInfo[Interior] = cache_get_field_content_int(0,"Interior");
	cache_get_field_content(0, "Filterscript", MapInfo[Filterscript], mysql, 30);
	new str[128];
	format(str,90,"loadfs %s",MapInfo[Filterscript]);
	SendRconCommand(str);
	format(str,90,"Map Name : ~y~%s(%d)",MapInfo[NamaMap],MapInfo[mapid]);
	TextDrawSetString(Zombie_TextDraw[3],str);
	TextDrawShowForAll(Zombie_TextDraw[3]);
	format(str, sizeof(str), "ZM v1.2 (%d/%d)", mapid, MAXMAP);
 	SetGameModeText(str);
	SetWorldTime(MapInfo[Time]);
	SetWeather(MapInfo[Weather]);
	PlayerLoop(i) SpawnPlayer(i);
	return 1;
}
no error at compile (pawn)

but error at mysql
this error
Код:
[10:11:47] [DEBUG] CMySQLQuery::Execute[LoadMaps] - starting query execution
[10:11:47] [DEBUG] CMySQLQuery::Execute[LoadMaps] - query was successfully executed within 0.378 milliseconds
[10:11:47] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[10:11:47] [DEBUG] Calling callback "LoadMaps"..
[10:11:47] [DEBUG] cache_get_field_content_int - row: 0, field_name: "mapid", connection: 1
[10:11:47] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[10:11:47] [ERROR] cache_get_field_content_int - invalid datatype
[10:11:47] [DEBUG] cache_get_field_content - row: 0, field_name: "Mapname", connection: 1, max_len: 50
[10:11:47] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[10:11:47] [DEBUG] cache_get_field_content - row: 0, field_name: "HumanS", connection: 1, max_len: 35
[10:11:47] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[10:11:47] [DEBUG] cache_get_field_content - row: 0, field_name: "ZombieS", connection: 1, max_len: 35
[10:11:47] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[10:11:47] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Duration", connection: 1
[10:11:47] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[10:11:47] [ERROR] cache_get_field_content_int - invalid datatype
[10:11:47] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Deadtime", connection: 1
[10:11:47] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[10:11:47] [ERROR] cache_get_field_content_int - invalid datatype
[10:11:47] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Time", connection: 1
[10:11:47] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[10:11:47] [ERROR] cache_get_field_content_int - invalid datatype
[10:11:47] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Weather", connection: 1
[10:11:47] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[10:11:47] [ERROR] cache_get_field_content_int - invalid datatype
[10:11:47] [DEBUG] cache_get_field_content_int - row: 0, field_name: "Interior", connection: 1
[10:11:47] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[10:11:47] [ERROR] cache_get_field_content_int - invalid datatype
[10:11:47] [DEBUG] cache_get_field_content - row: 0, field_name: "Filterscript", connection: 1, max_len: 30
[10:11:47] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[10:11:47] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
thanks before


Re: error load some map from mysql - kloning1 - 11.12.2016

bump


Re: error load some map from mysql - benjenden - 11.12.2016

This could be several things..Have you already created the tables and rows??
If so make sure the index for the row is correct. The error from MySQL is saying that the index for the row doesn't exist. In other words, it cannot connect to it because it doesn't exist. Make sure you set up the actual MySQL database correctly.