Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ________________________________________________________________________________
- ________________________________________________________________________________
- ________________________________________vRT_____________________________________
- ___________________________________________Reaction Test System_________________
- ___________________________________________________Credits:_____________________
- ________________________________________________________Vege____________________
- ________________________________________________________COD5 GangWars Scripter's
- _________________________DO NOT REMOVE THE CREDITS______________________________
- ________________________________________________________________________________
- */
- #include <a_samp>
- #if !defined Loop
- #define Loop(%0,%1) \
- for(new %0 = 0; %0 != %1; %0++)
- #endif
- #if !defined function
- #define function%0(%1) \
- forward%0(%1); public%0(%1)
- #endif
- #if !defined PURPLE
- #define PURPLE \
- 0xBF60FFFF
- #endif
- #if !defined GREEN
- #define GREEN \
- 0x94D317FF
- #endif
- #if !defined TIME
- #define TIME \
- 180000
- #endif
- new
- vCharacters[][] =
- {
- "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
- "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
- "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
- "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
- "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
- },
- vChars[16] = "",
- vReactionTimer,
- vCash,
- vScore,
- bool: vTestBusy
- ;
- public OnFilterScriptInit()
- {
- vReactionTimer = SetTimer("vReactionTest", TIME, 1);
- return 1;
- }
- public OnFilterScriptExit()
- {
- KillTimer(vReactionTimer);
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- switch(vTestBusy)
- {
- case true:
- {
- if(!strcmp(vChars, text, false))
- {
- new
- string[128],
- pName[MAX_PLAYER_NAME]
- ;
- GetPlayerName(playerid, pName, sizeof(pName));
- format(string, sizeof(string), "« \%s\" has won the reaction test. »", pName);
- SendClientMessageToAll(GREEN, string);
- format(string, sizeof(string), "« You have earned $%d + %d score. »", vCash, vScore);
- SendClientMessage(playerid, GREEN, string);
- GivePlayerMoney(playerid, vCash);
- SetPlayerScore(playerid, GetPlayerScore(playerid) + vScore);
- vReactionTimer = SetTimer("vReactionTest", TIME, 1);
- vTestBusy = false;
- }
- }
- }
- return 1;
- }
- function vReactionTest()
- {
- new
- vLength = (random(8) + 2),
- string[128]
- ;
- vCash = (random(1000) + 4000);
- vScore = (random(2)+1);
- format(vChars, sizeof(vChars), "");
- Loop(v, vLength) format(vChars, sizeof(vChars), "%s%s", vChars, vCharacters[random(sizeof(vCharacters))][0]);
- format(string, sizeof(string), "« Who first types %s wins $%d + %d score. »", vChars, vCash, vScore);
- SendClientMessageToAll(PURPLE, string);
- KillTimer(vReactionTimer);
- vTestBusy = true;
- SetTimer("vReactionProgress", 30000, 0);
- return 1;
- }
- function vReactionProgress()
- {
- switch(vTestBusy)
- {
- case true:
- {
- new
- string[128]
- ;
- format(string, sizeof(string), "« No-one won the reaction-test. New one starting in %d minutes. »", (TIME/60000));
- SendClientMessageToAll(PURPLE, string);
- vReactionTimer = SetTimer("vReactionTest", TIME, 1);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment