Jump to content

Recommended Posts

  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

This is for ban:

For unban I guess you can work around with the ban command and make one.

I tried the function of that topic but i am this eroor  .

cmd_gm.cpp: In function 'void do_ban(CHARACTER*, const char*, int, int)':
cmd_gm.cpp:4407: error: 'arg1' was not declared in this scope
cmd_gm.cpp:4407: error: 'arg2' was not declared in this scope
cmd_gm.cpp:4407: error: 'arg3' was not declared in this scope
cmd_gm.cpp:4446: error: 'pmsg' was not declared in this scope
Makefile:119: recipe for target 'OBJDIR/cmd_gm.o' failed
gmake: *** [OBJDIR/cmd_gm.o] Error 1
root@metin2:/usr/src/Server/game/src #

  • Premium

 

This is for ban:

For unban I guess you can work around with the ban command and make one.

I tried the function of that topic but i am this eroor  .

cmd_gm.cpp: In function 'void do_ban(CHARACTER*, const char*, int, int)':
cmd_gm.cpp:4407: error: 'arg1' was not declared in this scope
cmd_gm.cpp:4407: error: 'arg2' was not declared in this scope
cmd_gm.cpp:4407: error: 'arg3' was not declared in this scope
cmd_gm.cpp:4446: error: 'pmsg' was not declared in this scope
Makefile:119: recipe for target 'OBJDIR/cmd_gm.o' failed
gmake: *** [OBJDIR/cmd_gm.o] Error 1
root@metin2:/usr/src/Server/game/src #

cmd_gm.cpp:4446: error: 'pmsg' was not declared in this scope

Well, this variable does not exists in the code. So you probably tried another tutorial or you edited it.

Also, you did not declared variables arg1, arg2, arg3:

char arg1[256], arg2[256], arg3[256];

After

AMCD(do_ban)
{

First eroor is solved thanks Cataclismo but now i am this eroor .

cmd_gm.cpp:4487: error: 'pmsg' was not declared in this scope

Error occurs here in this function .

if(msg.get() && msg->Get()->uiAffectedRows == 0 || pmsg->Get()->uiAffectedRows == (uint32_t)-1)

Problem is this .

pmsg->Get()
  • Premium

What you wanna check with this?


if(msg.get() && msg->Get()->uiAffectedRows == 0 || pmsg->Get()->uiAffectedRows == (uint32_t)-1)

You're trying to check if the ban command worked? If yes, use this:

if (msg->Get()->uiAffectedRows > 0)
	ch->ChatPacket(CHAT_TYPE_INFO, "User %s has been blocked.", arg1);
else
	ch->ChatPacket(CHAT_TYPE_INFO, "Command failed.");

Also, why?!

pmsg->Get()->uiAffectedRows == (uint32_t)-1

Are you trying to check if uiAffectedRows is -1, but you convert -1 to unsigned? WTF!

Also, why?!

pmsg->Get()->uiAffectedRows == (uint32_t)-1
Are you trying to check if uiAffectedRows is -1, but you convert -1 to unsigned? WTF!

 

 

 

 

Return Values

An integer greater than zero indicates the number of rows affected or retrieved. Zero indicates that no records were updated for an UPDATE statement, no rows matched the WHERE clause in the query or that no query has yet been executed. -1 indicates that the query returned an error or that, for a SELECT query,mysql_affected_rows() was called prior to calling mysql_store_result().

 

At first read some contents please.

 

Kind Regards

Ken ~ TA

Do not be sorry, be better.

  • Premium

 

Also, why?!

pmsg->Get()->uiAffectedRows == (uint32_t)-1

Are you trying to check if uiAffectedRows is -1, but you convert -1 to unsigned? WTF!

 

 

 

 

Return Values

An integer greater than zero indicates the number of rows affected or retrieved. Zero indicates that no records were updated for an UPDATE statement, no rows matched the WHERE clause in the query or that no query has yet been executed. -1 indicates that the query returned an error or that, for a SELECT query,mysql_affected_rows() was called prior to calling mysql_store_result().

 

At first read some contents please.

 

Kind Regards

Ken ~ TA

 

(uint32_t)-1

What's that?

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



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.