Advertisement
Guest User

b_Reaction System!

a guest
Apr 7th, 2017
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. /*
  2.  
  3. _ ______ _ _ _____ _
  4. | | | ___ \ | | (_) / ___| | |
  5. | |__ | |_/ /___ __ _ ___| |_ _ ___ _ __ \ `--. _ _ ___| |_ ___ _ __ ___
  6. | '_ \ | // _ \/ _` |/ __| __| |/ _ \| '_ \ `--. \ | | / __| __/ _ \ '_ ` _ \
  7. | |_) | | |\ \ __/ (_| | (__| |_| | (_) | | | | /\__/ / |_| \__ \ || __/ | | | | |
  8. |_.__/ \_| \_\___|\__,_|\___|\__|_|\___/|_| |_| \____/ \__, |___/\__\___|_| |_| |_|
  9. ______ __/ |
  10. |______| |___/
  11.  
  12.  
  13. b_Reaction System
  14.  
  15. Scripter : Bolex_
  16.  
  17. All rights reserved © 2017 - 2018
  18.  
  19.  
  20.  
  21.  
  22. */
  23.  
  24. #include <a_samp>
  25.  
  26. #define COLOR_RED "{F81414}"
  27. #define COLOR_GREEN "{6EF83C}"
  28. #define COLOR_ORANGE "{FF7E19}"
  29.  
  30. #define TIMEPASS (4)
  31.  
  32. #define LEAST_NUMBER (672352)
  33. #define LARGEST_NUMBER (9756153)
  34.  
  35. forward StartNewTest();
  36. forward CorrectAnswer( playerid );
  37.  
  38. new NUMBER = -1;
  39.  
  40. public OnFilterScriptInit()
  41. {
  42. SetTimer("StartNewTest",(1000*60*TIMEPASS),1);
  43. return 1;
  44. }
  45. public StartNewTest()
  46. {
  47. new string[ 128 ];
  48. NUMBER = random( LEAST_NUMBER - LARGEST_NUMBER );
  49.  
  50. format(string,sizeof string,"[REACTION]: {FFFFFF}Who first type {F81414}%d {FFFFFF}he wins some cash.", NUMBER);
  51. SendClientMessageToAll(0x48977996,string);
  52. }
  53. public OnPlayerText(playerid,text[])
  54. {
  55. if(strval(text) == NUMBER && NUMBER != -1)
  56. {
  57. CorrectAnswer( playerid );
  58. }
  59. return 1;
  60. }
  61.  
  62. public CorrectAnswer(playerid)
  63. {
  64. new pName[ MAX_PLAYER_NAME ],string[ 128 ];
  65. GetPlayerName(playerid,pName,sizeof pName);
  66. new randmoney = 3000 + random(10);
  67. GivePlayerMoney(playerid, randmoney);
  68. format(string,sizeof string,"[REACTION] {FFFFFF}%s has won the reaction test and won prize (%d{6EF83C}${FFFFFF})",pName, randmoney);
  69. SendClientMessageToAll(0x48977996,string);
  70. NUMBER = -1;
  71. return 1;
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement