viewing paste rathena.org/board/topic/115188- | Athena

Posted on the | Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
-   script  sample  -1,{
OnInit:
    setarray .guild_id, 9999,1; // allowed guild ID
    .guild_id_size = getarraysize(.guild_id);
    
    setarray .map$, "prontera","payon"; // restricted map
    .map_size = getarraysize(.map$);
    
    for ( .@i = 0; .@i < .map_size; .@i++ )
        setmapflag .map$[.@i], mf_loadevent;
    end;
    
OnPCLoadMapEvent:
//  GMs should bypass this kind of things
//  if ( getgmlevel() >= 99 ) end;
 
    .@map$ = strcharinfo(3);
    for ( .@i = 0; .@i < .map_size; .@i++ ) {
        if ( .@map$ == .map$[.@i] ) { // is on the map
            for ( .@j = 0; .@j < .guild_id_size; .@j++ ) {
                if ( getcharid(2) == .guild_id[.@j] )
                    end; // if the condition met, the player isn't warp away
            }
            warp "Save", 0,0;
            end;
        }
    }
    end;
}
Viewed 1040 times, submitted by AnnieRuru.