Jump to content
  • 0

Need for function with source


antrax16

Question

  • Answers 8
  • Created
  • Last Reply

Top Posters For This Question

8 answers to this question

Recommended Posts

  • 0

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
[email protected]:/usr/src/Server/game/src #

Link to comment
  • 0
  • VIP

 

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
[email protected]:/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
  • 0

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()
Link to comment
  • 0
  • VIP

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

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
  • 0
  • VIP

 

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

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.