Jump to content
  • 0

help - putting array


Question

Posted

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

5 answers to this question

Recommended Posts

Posted

try something like this..

for( .@i = 0; .@i < getarraysize( .@map$ ) - 1; .@i++ )
   if( getd(".n_"+.@type+"_master_map$") == .@maps$[.@i] ){
       callsub onendd;
       break;
   }

Posted

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;
}
}

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...