Jump to content
  • 0
Jaytz

trigger npc script

Question

-	script	test	-1,{
OnMinute10:
if( strcharinfo(PC_MAP) == "amatsu" ){
mes "Hello!";
close;
}
end;
}

is this right? i want to trigger npc script every 10minutes in specific map but this code is not working for me

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

It will not working cause no player is attached. Strcharinfo needs a player attached. The same is the "mes" and "close" script command.

 

If u want to message player every 10 minutes in amatsu u have to attach every player and check then the map per strcharinfo(3) and message them. 

 

Rynbef~

Edited by Rynbef

Share this post


Link to post
Share on other sites
  • 0

OnMinute10:

query_sql( "SELECT `account_id` from `char` where `online` = '1'", .@account_id);

for(set .@i,0; .@i<getarraysize(.@account_id); .@i++){

attachrid .@account_id[.@i];

If(strcharinfo(3)=="amatsu")mes "Hello and welcome in amatsu";

close2;

detachrid;

end;

}

 

It's should work. I have wrote it on my mobile phone.

 

Rynbef~

Edited by Rynbef

Share this post


Link to post
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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.