Jump to content

Recommended Posts

Posted

Basicamente la idea es poner la id de la cuenta gm en la tabla para bloquearlo, con id me refiero a este numero marcado en azul, por si algunos se confunden y ponen los datos de login: 25u15j8.png

Con esto si la id de su cuenta esta en la tabla, dira que no tiene permiso para comerciar, es algo simple y el codigo puede ser mejorado

exchange.cpp >> debajo de if (victim->IsBlockMode(BLOCK_EXCHANGE)), debe quedar de esta manera:

	if (victim->IsBlockMode(BLOCK_EXCHANGE))
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»ó´ë¹æÀÌ ±³È¯ °ÅºÎ »óÅÂÀÔ´Ï´Ù."));
		return false;
	}

	if (!IsGM())
	{
		if (victim->GetGMLevel() != GM_PLAYER)
		{
			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("No puedes darle comercio a un GM"));
			return false;
		}
	}

	if (IsGM())
	{
		char szQuery[QUERY_MAX_LEN];
		snprintf(szQuery, sizeof(szQuery), "SELECT * FROM comerciogm");
		SQLMsg * pMsg = DBManager::instance().DirectQuery(szQuery);
		SQLResult * pRes = pMsg->Get();
		if (pRes->uiNumRows)
		{
			MYSQL_ROW row;
			while ((row = mysql_fetch_row(pRes->pSQLResult)))
			{
				DWORD datos = 0;
				str_to_number(datos, row[0]);
				if (GetPlayerID()==datos)
				{
				ChatPacket(CHAT_TYPE_INFO, "No tienes permiso para comerciar");
			return false;
			}
		}
	}
}

Sql >> Player:
 


SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for comerciogm
-- ----------------------------
DROP TABLE IF EXISTS `comerciogm`;
CREATE TABLE `comerciogm`  (
  `gm` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`gm`) USING BTREE
) ENGINE = MyISAM CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;

 

Posted
hace 1 minuto, xLordneji dijo:

Se ve super excelente la ídea, para evitar futuros malentendidos con los gms 😄

Pueden tirarlo al suelo, pueden poner los items a la venta a 1, pueden pasar el item por su almacen y comerciarlo con otro personaje en su cuenta, etc etc.

 

Pd: Se ve útil!

  • 1 year later...
Posted
En 20/3/2019 a las 20:51, Dilong dijo:

Basicamente la idea es poner la id de la cuenta gm en la tabla para bloquearlo, con id me refiero a este numero marcado en azul, por si algunos se confunden y ponen los datos de login: 25u15j8.png

Con esto si la id de su cuenta esta en la tabla, dira que no tiene permiso para comerciar, es algo simple y el codigo puede ser mejorado

exchange.cpp >> debajo de if (victim->IsBlockMode(BLOCK_EXCHANGE)), debe quedar de esta manera:


	if (victim->IsBlockMode(BLOCK_EXCHANGE))
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("»ó´ë¹æÀÌ ±³È¯ °ÅºÎ »óÅÂÀÔ´Ï´Ù."));
		return false;
	}

	if (!IsGM())
	{
		if (victim->GetGMLevel() != GM_PLAYER)
		{
			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("No puedes darle comercio a un GM"));
			return false;
		}
	}

	if (IsGM())
	{
		char szQuery[QUERY_MAX_LEN];
		snprintf(szQuery, sizeof(szQuery), "SELECT * FROM comerciogm");
		SQLMsg * pMsg = DBManager::instance().DirectQuery(szQuery);
		SQLResult * pRes = pMsg->Get();
		if (pRes->uiNumRows)
		{
			MYSQL_ROW row;
			while ((row = mysql_fetch_row(pRes->pSQLResult)))
			{
				DWORD datos = 0;
				str_to_number(datos, row[0]);
				if (GetPlayerID()==datos)
				{
				ChatPacket(CHAT_TYPE_INFO, "No tienes permiso para comerciar");
			return false;
			}
		}
	}
}

Sql >> Player:
 



SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for comerciogm
-- ----------------------------
DROP TABLE IF EXISTS `comerciogm`;
CREATE TABLE `comerciogm`  (
  `gm` varchar(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`gm`) USING BTREE
) ENGINE = MyISAM CHARACTER SET = latin1 COLLATE = latin1_swedish_ci ROW_FORMAT = Dynamic;

SET FOREIGN_KEY_CHECKS = 1;

 

Gracias, alguien tendría el codigo para bloquearle comercio, hacer tienda, abrir almacén y tirarlo? ^^

Join the conversation

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

Guest
Reply to this topic...

×   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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

This site uses cookies to enhance your browsing experience and provide relevant content. By continuing to browse, you agree to our We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. and Terms of Use. For more information on how we protect your data, please check our Privacy Policy.