yuhsing

Announcer with Filtered Words

Apr 1st, 2013
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1.  
  2. prontera,155,181,5 script Sample 757,{
  3. mes "Hello, ^F509DE"+strcharinfo(0)+"^000000";
  4. mes "Do you want to broadcast something? Payment is^FAEB60 "+.item_quantity+" "+getitemname( .item_id )+"^000000.";
  5. if( countitem( .item_id ) >= .item_quantity ){
  6. next;
  7. if( select( "YES","NO" ) == 1 ){
  8. mes "Enter messages.";
  9. mes "Blocked words will be auto filtered.";
  10. input .@message$;
  11. explode( .@message_array$,.@message$," " );
  12. .@message_array_size = getarraysize( .@message_array$ );
  13. for( .@i = 0; .@i < .@message_array_size; .@i++ )
  14. if( compare( .filter_word_check$,":"+.@message_array$[.@i]+":" ) )
  15. .@message_array$[.@i] = "***";
  16. mes "Select a Color";
  17. .@color = select( .color_name_menu$ ) - 1;
  18. delitem .item_id,.item_quantity;
  19. announce "[ "+strcharinfo(0)+" ]:"+implode( .@message_array$," " ),0,"0x"+.color_code$[.@color];
  20. }
  21. }
  22. close;
  23.  
  24. OnInit:
  25. // required item
  26. .item_id = 671;
  27. .item_quantity = 1;
  28.  
  29. // Colour Name List
  30. setarray .color_name$,"RED","BLUE";
  31. setarray .color_code$,"FF0000","0055FF";
  32. .color_name_menu$ = implode( .color_name$,":" );
  33.  
  34. // Filter Words
  35. setarray .filter_word$,"fuck","you";
  36. .filter_word_check$ = ":"+implode( .filter_word$,":" )+":";
  37. end;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment