yuhsing

Untitled

Aug 22nd, 2013
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1.  
  2.  
  3. /*
  4. inside conf/atcommand_athena.conf
  5. find this line
  6. // Disconnect all users from the server
  7. kickall: 99,99
  8. then add below with the following contents...
  9. /*
  10.  
  11. // Disconnect all users of a map from server
  12. kickplayers: 99,99
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25. /*
  26. inside src/map/atcommand.c
  27. find this command
  28. ACMD_FUNC(kickall)
  29.  
  30. below of this kickall ACMD function, add below with the following contents...
  31. /*
  32.  
  33.  
  34. /*==========================================
  35. * @kickplayers <mapname>
  36. *------------------------------------------*/
  37. ACMD_FUNC(kickplayers)
  38. {
  39. struct map_session_data* pl_sd;
  40. struct s_mapiterator* iter;
  41. char map_name[MAP_NAME_LENGTH_EXT];
  42. int count = 0;
  43. int map_id = -1;
  44. nullpo_retr( -1, sd );
  45.  
  46. if( !message || !*message ){
  47. clif_displaymessage( fd, "Please enter a map name ( usage: @kickplayers <map name> )." );
  48. return -1;
  49. }else{
  50. sscanf(message, "%15s", map_name);
  51. if( ( map_id = map_mapname2mapid( map_name ) ) < 0 ){
  52. clif_displaymessage( fd, "Please enter valid map name." );
  53. return -1;
  54. }
  55. }
  56.  
  57. iter = mapit_getallusers();
  58. for( pl_sd = (TBL_PC*) mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*) mapit_next(iter) ){
  59. if ( pc_isGM(sd) >= pc_isGM(pl_sd) && pl_sd->bl.m == map_id && sd->status.account_id != pl_sd->status.account_id ){
  60. clif_GM_kick(NULL, pl_sd);
  61. count++;
  62. }
  63. }
  64. mapit_free(iter);
  65.  
  66. sprintf( atcmd_output, "Kicked %d Players from %s.",count,map_name );
  67. clif_displaymessage( fd, atcmd_output );
  68.  
  69. return 0;
  70. }
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82. /*
  83. inside src/map/atcommand.c
  84. find this command
  85. { "kickall", 99,99, atcommand_kickall },
  86.  
  87. below of this line, add below with the following contents...
  88. /*
  89.  
  90. { "kickplayers", 99,99, atcommand_kickplayers },
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101. RECOMPILE and DONE...
Advertisement
Add Comment
Please, Sign In to add comment