Jump to content
  • 0

[Basic-to-experts] Ways to call a "function" in another npc.


Question

Posted


- script DualControl -1,{
if ((query_sql("SELECT login.account_id FROM login LEFT JOIN `char` ON login.account_id=`char`.account_id WHERE login.last_ip=(SELECT last_ip FROM login WHERE account_id="+getcharid(3)+") AND `char`.online=1", .@account_id) > 1) && ("+getcharid(3)+" != .whiteList)) {


}
OnInit:
.whiteList = 2000000,2000001,2000002,2000003;
}


 

I dont know how can i proceed with this check... i need that this script check a "List" and execute something.

And before I forget... other npcs will call this npcs to execute this "function"... any way to proceed?

5 answers to this question

Recommended Posts

Posted


- script DualControl -1,{

OnInit:

bindatcmd "test",strnpcinfo(3)+"::OnAtcommand";// create @test command for the sample

.whiteList$ = "2000000,2000001,2000002,2000003";

end;

OnAtcommand:

.@query_result = query_sql("SELECT login.account_id FROM login LEFT JOIN `char` ON login.account_id=`char`.account_id WHERE "+

"login.last_ip=(SELECT last_ip FROM login WHERE account_id="+getcharid(3)+") AND `char`.online=1 and account_id != "+ getcharid(3), .@account_id;

if ( .@query_result > 0 && compare( .whiteList$,getcharid(3) +"" ) == 0 )// not in the list

dispbottom "there is "+ .@query_result +" people with the same ip than you";

end;

}

  • Upvote 1

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...