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

Try:

 

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

}

 

 

Share this post


Link to post
Share on other sites
  • 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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

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