Jump to content

Need for function with source


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 #

Link to comment
Share on other sites

  • 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)
{
Link to comment
Share on other sites

  • 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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 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?

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 4

      Feeding game source to LLM

    2. 0

      Quest 6/7 Problem

    3. 5

      Effect weapons

    4. 0

      [C++] Fix Core Downer Using Negative Number in GM Codes

    5. 3

      Crystal Metinstone

    6. 4

      Feeding game source to LLM

    7. 113

      Ulthar SF V2 (TMP4 Base)

    8. 4

      Feeding game source to LLM

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.