//Edited by Aeromesi
prontera,156,182,0 script Party Warper 4_F_SWORDMAN,{
.@pid = getcharid(1);
.@cid = getcharid(0);
.@name$ = strcharinfo(0);
if (!.@pid) end;
getpartymember .@pid, 0;
getpartymember .@pid, 1;
getpartymember .@pid, 2;
for (.@i = 0; .@i < $@partymembercount; .@i++)
.@menu$ = .@menu$ + (.@name$ != $@partymembername$[.@i] ? $@partymembername$[.@i] : "") + ":";
.@s = select(.@menu$) - 1;
.@target$ = $@partymembername$[.@s];
if (isloggedin($@partymemberaid[.@s], $@partymembercid[.@s])) {
getmapxy .@map$, .@x, .@y, UNITTYPE_PC, .@target$;
dispbottom "Player "+.@target$+" is at map "+.@map$+","+.@x+","+.@y+"";
if ( .@map$ == .restricted_map$[1]
|| .@map$ == .restricted_map$[2]
|| .@map$ == .restricted_map$[3]) {
message .@name$,"This is a restricted map.";
}
else
warp .@map$, .@x, .@y, .@cid;
} else
message .@name$, .@target$ + " is not online.";
dispbottom ""+.@map$+" is a restricted map.";
close;
OnInit:
setarray .restricted_map$[1],
"payon",
"geffen",
"alberta";
end;
}
I'm also attaching the txt file directly to my post. I offer a quick fix, not the best but it works. When adding a new map, make sure to add this same line but just change the number to the max amount of maps you have.
If you add a fourth map to the array in OnInit, make sure to copy and paste and add a .restricted_map$[4] to the line
So far it tests payon, geffen, and alberta, worked like a charm.
partywarper.txt