Let me try emistry. Thanks!
Hi Emistry i tried to edit the map as you instructed. but it seems im having a problem with the commands.. when i use @go 0 my screen shows map 0 doesnt exist. here's the script i edited and my map server console..
i just want to restrict @go 0 & @warp (my maintown) commands if the players have 99 baselevel below only. if the players reach baselevel 100 they can use the command
// https://rathena.org/board/topic/107746-request-script-go-restrict-on-base-level/
- script Sample#at_go_restrict -1,{
function func_SetLevel {
setd( ".map_" + getarg( 0,"" ) ), getarg( 1,1 );
return;
}
OnInit:
bindatcmd( "go", strnpcinfo(3)+"::OnAtcommand" );
func_SetLevel( "invek",100 ); // prontera need level 30.
func_SetLevel( "payon",99 ); // payon need level 99.
end;
OnAtcommand:
if ( !.@atcmd_numparameters ) {
dispbottom .@atcmd_command$+" <mapname> <x> <y>";
}
else if ( getmapusers( .@atcmd_parameters$[0] ) == -1 ) {
dispbottom "map '"+.@atcmd_parameters$[0]+"' doesn't exist.";
}
else if ( !getmapflag( .@atcmd_parameters$[0],mf_town ) || getmapflag( .@atcmd_parameters$[0],mf_nowarpto ) ) {
dispbottom "you cant warp to this map.";
}
else if ( getd( ".map_" + .@atcmd_parameters$[0] ) > BaseLevel ) {
dispbottom "You need higher level to warp to this map.";
}
else {
warp .@atcmd_parameters$[0],atoi( .@atcmd_parameters$[1] ),atoi( .@atcmd_parameters$[2] );
}
end;
}