prontera,157,178,5<tab>script<tab>Sample<tab>757,{
if ( getgmlevel() < 80 )
end;
mes "Input Player Name";
if ( input( .@input$, 4, 23 ) ) {
mes "invalid name length";
close;
}
if ( .@nb == query_sql( "select name, online from `char` where account_id = ( select account_id from `char` where name = '"+ escape_sql(.@input$) +"' ) order by char_num", .@name$, .@online ) )
for ( set .@i, 0; .@i < .@nb; set .@i, .@i + 1 )
mes " > "+ .@name$[.@i] +" "+( ( .@online[.@i] )? "^00FF00[Online]" : "^FF0000[Offline]" )+"^000000";
else
mes "No character found";
close;
}
All credits @ AnnieRuru
3 small changes done:
input( .@input$, 4, 23 ) //The variable used in the sql command has no capital letter.
.@nb == query_sql() //dual '=' needed for comparisons
for ( set .@i, 0; .@i < .@nb; set .@i, .@i + 1 ) //Optimized for 3CeaM users (like him)