Advertisement
Guest User

Untitled

a guest
Oct 1st, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include < amxmodx >
  4. #include < amxmisc >
  5.  
  6. #define PLUGIN "CHANGE-STANDARD-NICKNAME"
  7. #define VERSION "0.1"
  8. #define AUTHOR "Counter-Strike"
  9.  
  10. #define DEFAULT_NAME "Player"
  11. #define ADMIN_ACCESS ADMIN_KICK
  12.  
  13. public plugin_init ( ) {
  14.  
  15. register_plugin ( PLUGIN, VERSION, AUTHOR );
  16.  
  17. register_concmd ( "amx_newnick", "ChangePlayerNick", ADMIN_ACCESS, "<name> <new name>" );
  18. register_concmd ( "amx_nick", "ChangePlayerNick2", ADMIN_ACCESS, "<name>" );
  19. }
  20.  
  21. public ChangePlayerNick ( id ) {
  22.  
  23. if ( !( get_user_flags ( id ) & ADMIN_ACCESS ) )
  24. return 1;
  25.  
  26. new szArg [ 32 ], szArg2 [ 32 ];
  27.  
  28. read_argv ( 1, szArg, 31 );
  29. read_argv ( 2, szArg2, 31 );
  30.  
  31. new szTarget = cmd_target ( id, szArg, 1 );
  32.  
  33. if ( !szTarget ) {
  34.  
  35. client_print ( id, print_console, "Nu exista acest jucator." );
  36. return 1;
  37.  
  38. }
  39.  
  40.  
  41. client_print ( id, print_console, "^"%s^" changed name to ^"%s^"", get_name ( szTarget ), szArg2 );
  42. client_print ( id, print_chat, "Numele %s a fost schimbat in %s", get_name ( szTarget ), szArg2 );
  43.  
  44. client_cmd ( szTarget, "name ^"%s^"", szArg2 );
  45.  
  46. return 1;
  47.  
  48. }
  49.  
  50. public ChangePlayerNick2 ( id ) {
  51.  
  52. if ( !( get_user_flags ( id ) & ADMIN_ACCESS ) )
  53. return 1;
  54.  
  55. new szArg [ 32 ];
  56.  
  57. read_argv ( 1, szArg, 31 );
  58.  
  59. new szTarget = cmd_target ( id, szArg, 11 );
  60.  
  61. if ( !szTarget ) {
  62.  
  63. client_print ( id, print_console, "Nu exista acest jucator." );
  64. return 1;
  65.  
  66. }
  67.  
  68.  
  69. client_print ( id, print_console, "^"%s^" changed name to ^"%s^"", get_name ( szTarget ), DEFAULT_NAME );
  70. client_print ( id, print_chat, "Numele %s a fost schimbat in %s", get_name ( szTarget ), DEFAULT_NAME );
  71.  
  72. client_cmd ( szTarget, "name ^"%s^"", DEFAULT_NAME );
  73.  
  74. return 1;
  75.  
  76. }
  77. stock get_name ( id ) {
  78.  
  79. new name [ 32 ];
  80.  
  81. get_user_name( id, name, 31 );
  82.  
  83. return name;
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement