quesoph
New member
Oh I get it now.. this would be the solution for that.. ^^its working at the same time its throwing error
implode command must have at least 1 index in the array or the server throws error
Code:
- script test#444 -1,{OnCommand: if ( !getstrlen( .@atcmd_parameters$ ) ) { message strcharinfo(0), "Please, enter a message (usage: @bst <message>)."; end; } $@input$ = implode(.@atcmd_parameters$," " ); $@name$ = strcharinfo(0); .@symbol$ = substr( .@atcmd_parameters$, 0,1 ); if ( .@symbol$ != "B>" && .@symbol$ != "S>" && .@symbol$ != "T>" ) { message strcharinfo(0), "Market Symbol is Needed when using this command ( B> S> T> )"; end; } if ( bst_delay + 60 > gettimetick(2) ) { message strcharinfo(0), "There is a 60 seconds delay of using this command again"; end; } query_sql ("SELECT `char`.`account_id` FROM `char` JOIN `login` ON `char`.`account_id` = `login`.`account_id` WHERE `char`.`online` = 1", .@account_id); bst_delay = gettimetick(2); // delay while ( .@i < getarraysize(.@account_id) ) { if ( attachrid( .@account_id[.@i] ) ) dispbottom "[Market]" + $@name$ + " : " + $@input$; // display to every character on the server. detachrid; .@i++; } end;OnInit: bindatcmd "bst",strnpcinfo(0)+"::OnCommand", 0, 1; // bind @bst command. end;}