Advertisement
Guest User

Ady's Reaction test

a guest
Aug 15th, 2013
759
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.69 KB | None | 0 0
  1. #if defined REACTION_TEST_BY_NAGAz00r
  2. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  3. | NaGaz000r REACTION TEST |
  4. | All rights RESERVED |
  5. | 2013 Version 1.0! |
  6. | |
  7. | |
  8. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  9. ////////////////////////////////////////////////////////////////////////////////
  10. #endif
  11. #include <a_samp>
  12. #include <sscanf2>
  13. ////////////////////////////////////////////////////////////////////////////////
  14. ////////////////////////////////////////////////////////////////////////////////
  15. new NReactionChars[ ][ ] =
  16. {
  17. "a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","s","t","u","v","x","y","z",
  18. "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","S","T","U","V","X","Y","Z"
  19. };
  20. ////////////////////////////////////////////////////////////////////////////////
  21. ////////////////////////////////////////////////////////////////////////////////
  22. #define PrizeScore 1000
  23. #define PrizeCash 5000
  24. #define ST SetTimer
  25. #define SMA SendClientMessageToAll
  26. #define ROSU 0xFF00000
  27. ////////////////////////////////////////////////////////////////////////////////
  28. new bool:NRIsStarted = false,
  29. NRTimerTicker = 0,
  30. NRMWords [ 5 ];
  31. forward NRTimer();
  32. ////////////////////////////////////////////////////////////////////////////////
  33. ////////////////////////////////////////////////////////////////////////////////
  34. public OnFilterScriptInit()
  35. {
  36. print("\n--------------------------------------");
  37. print(" NaGaz000r Reaction Test System Loaded!");
  38. print("--------------------------------------\n");
  39. ST("NRTimer", 1200, true);
  40. return 1;
  41. }
  42. ////////////////////////////////////////////////////////////////////////////////
  43. ////////////////////////////////////////////////////////////////////////////////
  44. public NRTimer()
  45. {
  46. NRTimerTicker++;
  47.  
  48. switch( NRTimerTicker )
  49. {
  50. case 60:
  51. {
  52. new nrSTR[ 128 ];
  53. if( !NRIsStarted )
  54. {
  55. format( NRMWords, sizeof( NRMWords ), "%s%s%s", NReactionChars[ random( sizeof( NReactionChars ) ) ], NReactionChars[ random( sizeof( NReactionChars ) ) ], NReactionChars[ random( sizeof( NReactionChars ) ) ] );
  56.  
  57. format( nrSTR, sizeof( nrSTR ), "Who type first %s win 1000 score and 5000 cash!", NRMWords );
  58. SMA( ROSU, nrSTR );
  59.  
  60. NRIsStarted = true;
  61. NRTimerTicker = 0;
  62. }
  63. }
  64. }
  65. }
  66. ////////////////////////////////////////////////////////////////////////////////
  67. ////////////////////////////////////////////////////////////////////////////////
  68. public OnPlayerText(playerid, text[])
  69. {
  70. switch( NRIsStarted )
  71. {
  72. case true:
  73. {
  74. if( !strcmp( NRMWords, text ) )
  75. {
  76. new NRstr[ 56 ];
  77. format( NRstr, sizeof( NRstr ), "%s has won the reaction test", GetN( playerid ) );
  78. SMA( ROSU, NRstr );
  79. GivePlayerMoney(playerid, PrizeCash);
  80. SetPlayerScore(playerid, GetPlayerScore( playerid ) + PrizeScore); // ia sa vedem daca da erori :))
  81.  
  82. printf( "%s", NRstr );
  83.  
  84. NRTimerTicker = 30;
  85.  
  86. NRIsStarted = false; // fuck :))
  87. }
  88. }
  89. }
  90. return 1;
  91. }
  92. ////////////////////////////////////////////////////////////////////////////////
  93. ////////////////////////////////////////////////////////////////////////////////
  94. stock GetN(playerid) // Get Name .. //
  95. {
  96. new NrName[ MAX_PLAYER_NAME ];
  97. GetPlayerName( playerid, NrName, sizeof( NrName ) );
  98. return NrName;
  99. }
  100. ////////////////////////////////////////////////////////////////////////////////
  101.  
  102. #if defined REACTION_TEST_BY_NAGAz00r2
  103. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  104. | NaGaz000r REACTION TEST |
  105. | All rights RESERVED |
  106. | 2013 Version 1.0! |
  107. | END |
  108. | |
  109. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  110. #endif
  111. ////////////////////////////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement