Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1.  
  2. void do_mwhere( CHAR_DATA* ch, const char* argument )
  3. {
  4. char arg[ MAX_INPUT_LENGTH ];
  5. CHAR_DATA* victim;
  6. bool found;
  7. set_pager_color( AT_PLAIN, ch );
  8. one_argument( argument, arg );
  9.  
  10. if ( arg[ 0 ] == '\0' )
  11. {
  12. send_to_char( "Mwhere whom?\n\r", ch );
  13. return;
  14. }
  15.  
  16. found = FALSE;
  17.  
  18. for ( victim = first_char; victim; victim = victim->next )
  19. {
  20. if ( IS_NPC( victim ) && victim->in_room && nifty_is_name( arg, victim->name ) )
  21. {
  22. found = TRUE;
  23. /*
  24. pager_printf( ch, "[%5d] %-28s [%5d] %s\n\r",
  25. victim->pIndexData->vnum, victim->short_descr, victim->in_room->vnum, victim->in_room->name );
  26. */
  27. char tmpBuf[ MSL ], vnum[ MSL ], shortDesc[ MSL ], roomVnum[ MSL ], roomName[ MSL ];
  28. // found++;
  29. snprintf( tmpBuf, MSL, "%d", victim->pIndexData->vnum );
  30. snprintf( vnum, MSL, "%s", color_align( tmpBuf, 10, ALIGN_CENTER ) );
  31. snprintf( shortDesc, MSL, "%s", color_align( victim->short_descr, 30, ALIGN_LEFT ) );
  32. snprintf( tmpBuf, MSL, "%d", victim->in_room->vnum );
  33. snprintf( roomVnum, MSL, "%s", color_align( tmpBuf, 10, ALIGN_CENTER ) );
  34. snprintf( roomName, MSL, "%s", color_align( victim->in_room->name, 30, ALIGN_LEFT ) );
  35. snprintf( tmpBuf, MSL, "&D[%-10s] %-30s&D [%-10s] %-30s", vnum, shortDesc, roomVnum, roomName );
  36. pager_printf( ch, "%s\n\r", color_align( tmpBuf, color_strlen( tmpBuf ), ALIGN_LEFT ) );
  37. found++;
  38. }
  39. // found++;
  40. }
  41. if ( found )
  42. pager_printf( ch, "Number of matches: %d\n", found);
  43. if ( !found )
  44. act( AT_PLAIN, "You didn't find any $T.", ch, NULL, arg, TO_CHAR );
  45.  
  46. return;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement