Advertisement
IdoGame

NextCash From Rejack JBSHOP

Aug 30th, 2014
517
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1.  
  2. #include <amxmodx>
  3. #include <amxmisc>
  4.  
  5. #define PLUGIN "Nextcash"
  6. #define VERSION "1.0"
  7. #define AUTHOR "From Rejack Jbshop"
  8.  
  9. #define TimeToNextCash 20
  10. #define NextCash 12000
  11. #define Tag "AMXX"
  12.  
  13. new Float:NextCashTime[ 33 ];
  14. native set_user_cash( client, amount );
  15. native get_user_cash( client );
  16. public plugin_init() {
  17. register_plugin(PLUGIN, VERSION, AUTHOR)
  18. register_clcmd("say /nextcash","nextcash")
  19.  
  20. }
  21.  
  22. public client_authorized(id){
  23.  
  24. NextCashTime[id] = get_gametime();
  25. }
  26.  
  27.  
  28. public nextcash(client){
  29.  
  30. new Float:fMins = (get_gametime()/60) - (NextCashTime[ client ]/60);
  31.  
  32.  
  33.  
  34. if ( fMins <= TimeToNextCash )
  35. return ColorChat( client, "You need to wait^3 %.1f Minutes^1!", TimeToNextCash - fMins );
  36.  
  37. NextCashTime[ client ] = get_gametime();
  38. set_user_cash(client,get_user_cash(client) + NextCash)
  39. return ColorChat( client, "You received^3 %i Cash^1 ^4 Good Luck^1!", NextCash );
  40.  
  41.  
  42. }
  43. stock ColorChat(const id, const string[], {Float, Sql, Resul,_}:...) {
  44. new msg[191], players[32], count = 1;
  45. static len; len = formatex(msg, charsmax(msg), "^4[ ^3%s^4 ]^1 ",Tag);
  46. vformat(msg[len], charsmax(msg) - len, string, 3);
  47.  
  48. if(id) players[0] = id;
  49. else get_players(players,count,"ch");
  50.  
  51. for (new i = 0; i < count; i++)
  52. {
  53. if(is_user_connected(players[i]))
  54. {
  55. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"),_, players[i]);
  56. write_byte(players[i]);
  57. write_string(msg);
  58. message_end();
  59. }
  60. }
  61. return 1;
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement