another simpler approach that you can try.
function Go {
set lastwarp$, getarg(0);
set lastwarpx, getarg(1,0);
set lastwarpy, getarg(2,0);
warp getarg(0),getarg(1,0),getarg(2,0);
end;
}
change into
function Go {
if (getmapflag(getarg(0), mf_gvg_castle) && (getcharid(2) == 0 || getcharid(2) != getcastledata(getarg(0), 1))) {
mes "^0000FFAgente Warp^000000";
cutin "jpn_mid03",2;
mes "You are not an owner of any this Casttle, or member of any guild who owns one.";
next;
mes "^0000FFAgente Warp^000000";
mes "Conquest the castle, or join a guild who owns one in order to access!";
close3;
}
else {
set lastwarp$, getarg(0);
set lastwarpx, getarg(1,0);
set lastwarpy, getarg(2,0);
warp getarg(0),getarg(1,0),getarg(2,0);
}
end;
}