GM Takumirai Posted November 27, 2012 Group: Members Topic Count: 69 Topics Per Day: 0.01 Content Count: 592 Reputation: 31 Joined: 11/14/11 Last Seen: July 29, 2015 Share Posted November 27, 2012 can i ask a question/help - in god* dedicate npc script i put this script if( getd(".n_"+.@type+"_master_map$") == "guild_01" ) { callsub OnEndd; break; } - the npc disappear in map guild_01 and it works now my problem is when i made it like this if( getd(".n_"+.@type+"_master_map$") == ".@maps$" ) { callsub OnEndd; break; } setarray .@maps$, "guild_vs1","0", "guild_vs2","1", "guild_vs3","2", "guild_vs4","3", "guild_vs5","4"; - there's no errors but the problem is the npc doesn't remove when i go in the said map Quote Link to comment Share on other sites More sharing options...
Emistry Posted November 27, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: 5 hours ago Share Posted November 27, 2012 try something like this.. for( .@i = 0; .@i < getarraysize( .@map$ ) - 1; .@i++ ) if( getd(".n_"+.@type+"_master_map$") == .@maps$[.@i] ){ callsub onendd; break; } Quote Link to comment Share on other sites More sharing options...
GmOcean Posted November 27, 2012 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share Posted November 27, 2012 That's, because your specifying a variable when it's an array. You need to also specify which slot in the array. .@maps$[0] Quote Link to comment Share on other sites More sharing options...
GM Takumirai Posted November 27, 2012 Group: Members Topic Count: 69 Topics Per Day: 0.01 Content Count: 592 Reputation: 31 Joined: 11/14/11 Last Seen: July 29, 2015 Author Share Posted November 27, 2012 Tnx emistry and ocean.. still not working OnTimer1000: { set .@type,atoi(strnpcinfo(2)); for(;isloggedin(getd(".n_"+.@type+"_master")) { set .@type,atoi(strnpcinfo(2)); attachrid(getd(".n_"+.@type+"_master")); getmapxy(getd(".n_"+.@type+"_master_map$"),getd(".n_"+.@type+"_master_x"),getd(".n_"+.@type+"_master_y"),0); getmapxy(getd(".n_"+.@type+"_npc_map$"),getd(".n_"+.@type+"_npc_x"),getd(".n_"+.@type+"_npc_y"),1,strnpcinfo(0)); { for( .@i = 0; .@i < getarraysize( .@map$ ) - 1; .@i++ ) if( getd(".n_"+.@type+"_master_map$") == .@maps$[.@i] ){ callsub onendd; break; } if(maxhp/hp>=4) { percentheal 15,15; specialeffect2 312; } if(getd(".n_"+.@type+"_tmp_time") == 0) { sc_start SC_BLESSING,60000,10; specialeffect2 42; sc_start SC_INCREASEAGI,60000,10; specialeffect2 37; sc_start SC_IMPOSITIO,60000,10; specialeffect2 84; sc_start SC_MAGNIFICAT,60000,10; specialeffect2 76; sc_start SC_GLORIA,60000,10; specialeffect2 75; sc_start SC_SUFFRAGIUM,60000,10; specialeffect2 88; sc_start SC_ASSUMPTIO,60000,10; specialeffect2 375; } setd ".n_"+.@type+"_tmp_time",getd(".n_"+.@type+"_tmp_time")+1; if( getd(".n_"+.@type+"_tmp_time") >= 60 ) setd ".n_"+.@type+"_tmp_time",0; detachrid; if(!isloggedin(getd(".n_"+.@type+"_master"))) { callsub OnEndd; break; } if(distance(getd(".n_"+.@type+"_npc_x"),getd(".n_"+.@type+"_npc_y"),getd(".n_"+.@type+"_master_x"),getd(".n_"+.@type+"_master_y"))>=8||getd(".n_"+.@type+"_master_map$")!=getd(".n_"+.@type+"_npc_map$")) unitwarp getd(".n_"+.@type+"_unit_id"),getd(".n_"+.@type+"_master_map$"),getd(".n_"+.@type+"_master_x"),getd(".n_"+.@type+"_master_y"); else unitwalk getd(".n_"+.@type+"_unit_id"),getd(".n_"+.@type+"_master_x")+rand(-3,3),getd(".n_"+.@type+"_master_y")+rand(-3,3); setd ".n_"+.@type+"_time",getd(".n_"+.@type+"_time")-1; if( getd(".n_"+.@type+"_time") <= 0 ) { callsub OnEndd; break; } sleep2 1000; } } callsub OnEndd; end; OnInit: setd ".n_"+atoi(strnpcinfo(2))+"_unit_id",getnpcid(0); set .amount,.amount+1; setarray .@maps$, "guild_vs1","0", "guild_vs2","1", "guild_vs3","2", "guild_vs4","3", "guild_vs5","4", "06guild_01","5", "06guild_02","6"; end; } } Quote Link to comment Share on other sites More sharing options...
KeyWorld Posted November 27, 2012 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 379 Reputation: 304 Joined: 11/10/11 Last Seen: December 2, 2014 Share Posted November 27, 2012 Change .@map$ to .map$. Edit: And also remove the "- 1" in the for() condition. Quote Link to comment Share on other sites More sharing options...
GM Takumirai Posted November 27, 2012 Group: Members Topic Count: 69 Topics Per Day: 0.01 Content Count: 592 Reputation: 31 Joined: 11/14/11 Last Seen: July 29, 2015 Author Share Posted November 27, 2012 thanks keyworld fixed... Quote Link to comment Share on other sites More sharing options...
Question
GM Takumirai
can i ask a question/help
- in god* dedicate npc script
i put this script
- the npc disappear in map guild_01 and it works
now my problem is when i made it like this
- there's no errors but the problem is the npc doesn't remove when i go in the said map
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.