Jump to content
  • 0

Dummy Character Don't Appear


nasagnilac

Question


  • Group:  Members
  • Topic Count:  89
  • Topics Per Day:  0.02
  • Content Count:  232
  • Reputation:   15
  • Joined:  11/02/13
  • Last Seen:  

We currently working on dummy characters but when the server restart and load the dummy. All of the characters cant be seen in the map and it was based on do_init_vending_autotrade. I hope that someone can help me about showing the characters in the map.

This is the code.

void do_init_autoafk(void)
{
	if (Sql_Query(mmysql_handle,
		"SELECT c.char_id, c.dummy, c.account_id, c.sex FROM `char` as c INNER JOIN `login` as l ON c.account_id = l.account_id AND c.dummy = 1 AND l.dummy = 1;") != SQL_SUCCESS)
	{
		Sql_ShowDebug(mmysql_handle);
		return;
	}

	if (Sql_NumRows(mmysql_handle) > 0) {
		struct s_afk *afk = NULL;

		while (SQL_SUCCESS == Sql_NextRow(mmysql_handle)) {
			char* data;

			afk = NULL;
			CREATE(afk, struct s_afk, 1);
			Sql_GetData(mmysql_handle, 0, &data, NULL); afk->char_id = atoi(data);
			Sql_GetData(mmysql_handle, 2, &data, NULL); afk->account_id = atoi(data);
			Sql_GetData(mmysql_handle, 3, &data, NULL); afk->sex = atoi(data);

			// initialize player
			CREATE(afk->sd, struct map_session_data, 1);
			pc_setnewpc(afk->sd, afk->account_id, afk->char_id, 0, gettick(), afk->sex, 0);
			afk->sd->state.autoafk = 1;
			chrif_authreq(afk->sd, true);
		}
		Sql_FreeResult(mmysql_handle);

		ShowStatus("Done loading '" CL_WHITE "%d" CL_RESET "' afkers.\n");
	}
}

 

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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

×
×
  • Create New...