Jump to content
  • 0

acc_reg_num in script


wmmsr

Question


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  16
  • Reputation:   0
  • Joined:  02/17/12
  • Last Seen:  



function script bg_checkmsg {
.@checkemulator = callfunc("bg_getconfiginfo","1");


if( !.@checkemulator )
query_sql "SELECT `value` FROM `char_reg_num` WHERE `char_id`='" + getarg(0) + "' AND `key`='bg_enable_msg'", .@value;
else
query_sql "SELECT `value` FROM `acc_reg_num` WHERE `account_id`='" + getarg(0) + "' AND `key`='bg_enable_msg'", .@value;


return (!getarraysize(.@value)?0:1);
}


 

I am using the function of acc_reg_num but she not this recording in SQL because the syntax is wrong someone can fix?

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  208
  • Reputation:   22
  • Joined:  01/14/13
  • Last Seen:  

can you please provide sql creation :).

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  898
  • Reputation:   120
  • Joined:  05/23/12
  • Last Seen:  

function script bg_checkmsg {
.@checkemulator = callfunc("bg_getconfiginfo","1");


if( !.@checkemulator )
query_sql ("SELECT `value` FROM `char_reg_num` WHERE `char_id`='" + getarg(0) + "' AND `key`='bg_enable_msg'", .@value);
else
query_sql ("SELECT `value` FROM `acc_reg_num` WHERE `account_id`='" + getarg(0) + "' AND `key`='bg_enable_msg'", .@value);


return (!getarraysize(.@value)?0:1);
}

You'll need to add ( after query_sql and ) before semicolon.

 

Rynbef~

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  208
  • Reputation:   22
  • Joined:  01/14/13
  • Last Seen:  

function script bg_checkmsg {
.@checkemulator = callfunc("bg_getconfiginfo","1");


if( !.@checkemulator )
query_sql ("SELECT `value` FROM `char_reg_num` WHERE `char_id`='" + getarg(0) + "' AND `key`='bg_enable_msg'", .@value);
else
query_sql ("SELECT `value` FROM `acc_reg_num` WHERE `account_id`='" + getarg(0) + "' AND `key`='bg_enable_msg'", .@value);


return (!getarraysize(.@value)?0:1);
}

You'll need to add ( after query_sql and ) before semicolon.

 

Rynbef~

 

no semi colon or got still going to work :) there is nothing problem there.

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

depend on  "When" did you save/update the values.

the server itself save/update these values every short interval based on your conf configuration. Default: 300 seconds.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...