Advertisement
iNiso

ResetScore iNiso # NEW

Nov 12th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. #include <amxmodx>
  2.  
  3. #include <cstrike>
  4.  
  5. #include <fun>
  6.  
  7. public plugin_init() {
  8. register_plugin("Reset Score","1.0","iNiso`.<3")
  9.  
  10. register_clcmd("say /rs","ResetScore");
  11.  
  12. register_clcmd("say_team /rs","ResetScore");
  13. }
  14.  
  15. public ResetScore( id )
  16. {
  17. if( get_user_deaths( id ) == 0 && get_user_frags( id ) == 0 )
  18.  
  19. return ColorChat(id, "Error: Your Score already ^3( 0 - 0 )^1");
  20.  
  21. cs_set_user_deaths(id, 0)
  22.  
  23. set_user_frags(id, 0)
  24.  
  25. cs_set_user_deaths(id, 0)
  26.  
  27. set_user_frags(id, 0)
  28.  
  29. return ColorChat(id, "You have ^4successfully^1 reset your score")
  30. }
  31.  
  32. stock ColorChat( const client, const string[ ], { Float, Sql, Resul,_ }:... )
  33. {
  34. new msg[191], players[32], count = 1;
  35.  
  36. static len; len = formatex( msg, charsmax( msg ), "^4[Gaming-Core]^1 " );
  37. vformat( msg[ len ], charsmax( msg ) - len, string, 3 );
  38.  
  39. if( client )
  40. {
  41. players[ 0 ] = client;
  42. }
  43.  
  44. else
  45. {
  46. get_players( players,count,"ch" );
  47. }
  48.  
  49. for ( new i = 0; i < count; i++ )
  50. {
  51. if( is_user_connected( players[ i ] ) )
  52. {
  53. message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, players[ i ] );
  54. write_byte( players[ i ] );
  55. write_string( msg );
  56. message_end( );
  57. }
  58. }
  59.  
  60. return 1;
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement