Jump to content
metin2dev
ѕeмa™

[RELEASE] Coins in InventoryWindow.

Recommended Posts

All working but constantly 0 mds.

 

It's because coin column named cash ?

I modified that quest, but it is the same...

 

Modified quest :

Version 1 :

quest mds begin
    state start begin
        when login begin
            loop_timer("carga_mds", 10)
        end
     
        when carga_mds.timer begin
            local coins = mysql_query("SELECT cash from account.account WHERE id="..pc.get_account_id().." LIMIT 1;")[1][1]
            cmdchat("Mds "..coins)
        end
    end
end

Version 2 :

quest mds begin
    state start begin
        when login begin
            loop_timer("carga_mds", 10)
        end
     
        when carga_mds.timer begin
            local coins = mysql_query("SELECT cash from account.account WHERE id="..pc.get_account_id().." LIMIT 1;")[1][1]
            cmdchat("Mds "..cash)
        end
    end
end

I doesn't have the mysql module, someone can give me a link for this ?

 

Solved, it's about mysql module.

Share this post


Link to post
Share on other sites

Hello can everyone pls help me ?

How i can change that :

RyitpKX.png

the main content was longer that the inventory slots above and mds under the slots

 

Share this post


Link to post
Share on other sites
0710 23:33:22988 ::   File "
0710 23:33:22988 :: <string>
0710 23:33:22988 :: ", line 
0710 23:33:22988 :: 2070
0710 23:33:22988 :: 

0710 23:33:22988 ::     
0710 23:33:22988 :: constInfo.mds = int(coins)
0710 23:33:22988 :: 

0710 23:33:22988 ::     
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 :: ^

0710 23:33:22988 :: SyntaxError
0710 23:33:22988 :: : 
0710 23:33:22988 :: invalid syntax
0710 23:33:22988 :: 

How resolve it?

Share this post


Link to post
Share on other sites
0710 23:33:22988 ::   File "
0710 23:33:22988 :: <string>
0710 23:33:22988 :: ", line 
0710 23:33:22988 :: 2070
0710 23:33:22988 :: 

0710 23:33:22988 ::     
0710 23:33:22988 :: constInfo.mds = int(coins)
0710 23:33:22988 :: 

0710 23:33:22988 ::     
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 ::  
0710 23:33:22988 :: ^

0710 23:33:22988 :: SyntaxError
0710 23:33:22988 :: : 
0710 23:33:22988 :: invalid syntax
0710 23:33:22988 :: 

How resolve it?

 

 

What about lom? Anyway you've done something wrong..."Invalid syntax"

Share this post


Link to post
Share on other sites

All working but constantly 0 mds.

 

It's because coin column named cash ?

I modified that quest, but it is the same...

 

Modified quest :

Version 1 :

quest mds begin
    state start begin
        when login begin
            loop_timer("carga_mds", 10)
        end
     
        when carga_mds.timer begin
            local coins = mysql_query("SELECT cash from account.account WHERE id="..pc.get_account_id().." LIMIT 1;")[1][1]
            cmdchat("Mds "..coins)
        end
    end
end

Version 2 :

quest mds begin
    state start begin
        when login begin
            loop_timer("carga_mds", 10)
        end
     
        when carga_mds.timer begin
            local coins = mysql_query("SELECT cash from account.account WHERE id="..pc.get_account_id().." LIMIT 1;")[1][1]
            cmdchat("Mds "..cash)
        end
    end
end

I doesn't have the mysql module, someone can give me a link for this ?

 

Solved, it's about mysql module.

when carga_mds.timer begin

            local cash = mysql_query("SELECT cash from account.account WHERE id="..pc.get_account_id().." LIMIT 1;")[1][1]

            cmdchat("Mds "..cash)

  • Like 1

Share this post


Link to post
Share on other sites

0711 19:26:40246 :: Traceback (most recent call last):
 
0711 19:26:40246 ::   File "networkModule.py", line 237, in SetGamePhase
 
0711 19:26:40246 ::   File "system.py", line 130, in __pack_import
 
0711 19:26:40246 ::   File "
0711 19:26:40246 :: <string>
0711 19:26:40246 :: ", line 
0711 19:26:40246 :: 68
0711 19:26:40246 :: 
 
0711 19:26:40246 ::     
0711 19:26:40246 :: SCREENSHOT_DIR = "YT2W"
 
0711 19:26:40246 ::     
0711 19:26:40246 :: ^
 
0711 19:26:40246 :: SyntaxError
0711 19:26:40246 :: : 
0711 19:26:40246 :: invalid syntax
0711 19:26:40247 :: 
 

Share this post


Link to post
Share on other sites

C+ Form

 

Add this function in input_login.cpp

static void _send_coins(LPCHARACTER ch)
{
	if (ch)
	{
		SQLMsg * pMsg = DBManager::instance().DirectQuery("select coins from account%s WHERE id = %u", get_table_postfix(), ch->GetAID());
		if (pMsg->Get()->uiNumRows > 0)
		{
			MYSQL_ROW  row = mysql_fetch_row(pMsg->Get()->pSQLResult);
			ch->ChatPacket(CHAT_TYPE_COMMAND, "BINARY_Update_Coins %s", row[0]);
			delete pMsg;
		}
	}
}

And search ; 

_send_bonus_info(ch);

Add this under that

_send_coins(ch);

Part of Python ; 

 

Add this command under "mall"

			"mall"			: self.__InGameShop_Show,
			"BINARY_Update_Coins"	: self.Binary_Update_Coins

like this

 

Add this function in game.py

def Binary_Update_Coins(self,coins):
	self.wndMds.SetText(str(coins))

€dit : why is not work these commands?

 

Open char_change_empire.cpp file and find this

DWORD CHARACTER::GetAID() const
{
	char szQuery[1024+1];
	DWORD dwAID = 0;

	snprintf(szQuery, sizeof(szQuery), "SELECT id FROM player_index%s WHERE pid1=%u OR pid2=%u OR pid3=%u OR pid4=%u AND empire=%u", 
			get_table_postfix(), GetPlayerID(), GetPlayerID(), GetPlayerID(), GetPlayerID(), GetEmpire());

	SQLMsg* pMsg = DBManager::instance().DirectQuery(szQuery);

	if (pMsg != NULL)
	{
		if (pMsg->Get()->uiNumRows == 0)
		{
			M2_DELETE(pMsg);
			return 0;
		}

		MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult);

		str_to_number(dwAID, row[0]);

		M2_DELETE(pMsg);

		return dwAID;
	}
	else
	{
		return 0;
	}
}

change via this

DWORD CHARACTER::GetAID() const
{
	const TAccountTable pAccountTable = GetDesc()->GetAccountTable();
	if (pAccountTable.id)
		return pAccountTable.id;
} 

Meanwhile add this on top.

#include "desc.h"

Best Regards 

Zerelth ~ Ellie

  • Like 6

Share this post


Link to post
Share on other sites

Ok now it found, but when i make in navicat coins or cash > 0 in game it was always 0.. i have the quest on winscp. and i have this error on putty:

 
mysql: ambiguous option '--e=SELECT coins from account.account WHERE id=3 LIMIT 1;' (enable_cleartext_plugin, execute)
 

Share this post


Link to post
Share on other sites

€dit : why is not work these commands?

 

if you make it look like this it will work

SQLMsg * pMsg = DBManager::instance().DirectQuery("select coins from account.account WHERE id = %d",ch->GetDesc()->GetAccountTable().id);

Share this post


Link to post
Share on other sites

 

€dit : why is not work these commands?

 

if you make it look like this it will work

SQLMsg * pMsg = DBManager::instance().DirectQuery("select coins from account.account WHERE id = %d",ch->GetDesc()->GetAccountTable().id);

 

GetAID() function is already exist in source. Why you want to choice long way? 

 

Kind Regards

Zerelth ~ Ellie

Share this post


Link to post
Share on other sites

 

Ok now it found, but when i make in navicat coins or cash > 0 in game it was always 0.. i have the quest on winscp. and i have this error on putty:

 
mysql: ambiguous option '--e=SELECT coins from account.account WHERE id=3 LIMIT 1;' (enable_cleartext_plugin, execute)

 

 

If your using invoice or 34k replace mysql function with this one http://www.elitepvpers.com/forum/metin2-pserver-guides-strategies/2059867-r-mysql-function.html

Share this post


Link to post
Share on other sites

 

 

€dit : why is not work these commands?

 

if you make it look like this it will work

SQLMsg * pMsg = DBManager::instance().DirectQuery("select coins from account.account WHERE id = %d",ch->GetDesc()->GetAccountTable().id);

 

GetAID() function is already exist in source. Why you want to choice long way? 

 

Kind Regards

Zerelth ~ Ellie

 

In default GetAID() runs a direct query which is unnecessary in this case.

mmm i'm still noob butthis works for me till now i got other important things to do at the moment so I'll not focus on this right now :) 

thanks anyway

Share this post


Link to post
Share on other sites

I have a error

 

0125 09:55:47724 :: Traceback (most recent call last):
 
0125 09:55:47724 ::   File "networkModule.py", line 237, in SetGamePhase
 
0125 09:55:47725 ::   File "system.py", line 130, in __pack_import
 
0125 09:55:47725 ::   File "
0125 09:55:47725 :: game.py
0125 09:55:47725 :: ", line 
0125 09:55:47725 :: 2398
0125 09:55:47725 :: 
 
0125 09:55:47725 ::     
0125 09:55:47725 :: def __Mds(self, coins):
 
0125 09:55:47725 ::     
0125 09:55:47725 ::  
0125 09:55:47725 ::  
0125 09:55:47726 ::  
0125 09:55:47726 ::  
0125 09:55:47726 ::  
0125 09:55:47726 ::  
0125 09:55:47726 ::  
0125 09:55:47726 ::  
0125 09:55:47726 ::  
0125 09:55:47726 ::  
0125 09:55:47726 ::  
0125 09:55:47726 ::  
0125 09:55:47726 ::  
0125 09:55:47726 ::  
0125 09:55:47726 ::  
0125 09:55:47726 ::  
0125 09:55:47726 ::  
0125 09:55:47726 ::  
0125 09:55:47726 ::  
0125 09:55:47727 ::  
0125 09:55:47727 :: ^
 
0125 09:55:47727 :: IndentationError
0125 09:55:47727 :: : 
0125 09:55:47727 :: unindent does not match any outer indentation level
0125 09:55:47727 :: 
 
I will upload my game.py
 
I hope somebody can help me!

Share this post


Link to post
Share on other sites

You have syntax errors everywhere, in python you have to use [TAB] instead of [sPACE]

I only had this problem when i add this system?

Share this post


Link to post
Share on other sites

Yes, because you just copied everything to game.py without replacing the spaces with tabs. Search for "mds" and insert the correct tabs.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×