Jump to content
Phishing - Beware of identity theft... ×
  • 0

Check coins with source


Rinnegan

Question

i try this

but the coins not actualize in the client,

and i put this in the def for see if  yes work, but the message "lol" not see in my screen, this means that the def is never activated

	def Binary_Update_Coins(self,coins):
		import dbg
		dbg.LogBox("lol")
		constInfo.mds3 = int(coins)

any idea for fix? thanks.

 

 

 

sorry my bad english, i speak spanish.

Link to comment
Share on other sites

15 answers to this question

Recommended Posts

  • 0

i same problem, and i use its.

Any solution?

 


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))
Best Regards
Ellie
Link to comment
Share on other sites

  • 0
  • Former Staff

same problem here :/

 

i tried this didn't solve

 

 

# edit

 

i know what is the problem with this

 ch->ChatPacket(CHAT_TYPE_COMMAND, "BINARY_Update_Coins %s", row[0]);

but i don't know how to fix it

 

the problem is when the code gets the number of coins let's say it's 400

 

it will sent this command 

BINARY_Update_Coins 400
Edited by flygun
Link to comment
Share on other sites

  • 0
  • Former Staff

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

@Denis

Yeah !! worked

 

but as i said

 

the problem is when the code gets the number of coins let's say it's 400

 

it will sent this command 

BINARY_Update_Coins 400

because of 

ch->ChatPacket(CHAT_TYPE_COMMAND, "BINARY_Update_Coins %s", row[0]);

i make it like this

 

static void _send_coins(LPCHARACTER ch)
{
    if (ch)
    {
        SQLMsg * pMsg = DBManager::instance().DirectQuery("select coins from account.account WHERE id = %d",ch->GetDesc()->GetAccountTable().id);
        MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult);
        ch->ChatPacket(CHAT_TYPE_COMMAND, "BINARY_Update_Coins %s", row[0]);
        ch->ChatPacket(CHAT_TYPE_NOTICE, LC_TEXT("You Got %s"), row[0]);
    }
}

and I changed the coins in account.account in my player clone to 250

and i got error in syserr in client

unknown server command "BINARY_Update_Coins 250"
Edited by flygun
Link to comment
Share on other sites

  • 0
  • Former Staff

Maybe you didn't add BINARY_Update_Coins to serverCommandList array?

thank you very much it's works but there is a problem .. mmm i don't want to call it a problem it's a mistake from (Zerelth™)~Ellie

 

i'v made it like heshe said in input_login.cpp

 

but this way will only show the coins on login or teleport that means if i have change the value of the coins i must teleport or change the character or logout ... etc

 

:/ so I'll try to put the code somewhere else to be refreshed like the normal money

 

this is pic for the inventory

 

6aEq14.jpg

 

and those are the codes for those who didn't work with them

 

in input_login.cpp

static void _send_coins(LPCHARACTER ch)
{
	if (ch)
	{
		SQLMsg * pMsg = DBManager::instance().DirectQuery("select coins from account.account WHERE id = %d",ch->GetDesc()->GetAccountTable().id);
		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;
		}
	}
}

in input_login.cpp in void CInputLogin::Entergame(LPDESC d, const char * data)

 

search for this

_send_bonus_info(ch);

and under it put this

_send_coins(ch);

in game.py in serverCommandList={

 

put this

"BINARY_Update_Coins"	:self.BINARY_Update_Coins,

and at the end of game.py

	def BINARY_Update_Coins(self, coins):
		constInfo.Coins =(str(coins))

PS: don't forget the TAPS

 

in this line

constInfo.Coins =(str(coins))

change constInfo.Coins to constInfo.Mds or whatever you named it :)

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

  • 0

 

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

 

Thanks denis, but now i have the problem the coins not actualize, only actualize when i login, you can create a code for actualize automatic? thanks!

Link to comment
Share on other sites

  • 0
  • Former Staff

Now that the source code is available you guys are trying to do everything in "game" core, this is stupid : before the sources this was already possible (lua + python) the processus is the same.

yup but my point is the normal money (yang/gold) doesn't show with lua+python  ..... I'll try to make the coins like normal money cus it's faster i think... 

Link to comment
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


×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / 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.