Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //==============================================================================
- // Reaction Test | Versiunea 1 | Create de xplor | Data creeri: 6.X.2012 | X-SET
- //==============================================================================
- #include < a_samp > //Thanx Kalcor :D
- //==||==||==||==||==||==||==||==||==||==||==||==||==||==||==||==||==||==||==||== [Defines]
- #define Loop(%0,%1) for(new %0 = 0; %0 != %1; %0++)
- function%0(%1) forward%0(%1); public%0(%1)
- GREEN 0x94D317FF
- TIME 1221
- Version 1
- //==||==||==||==||==||==||==||==||==||==||==||==||==||==||==||==||==||==||==||== [News]
- new Charact[16] = "", RTimer, WinCash, WinScore, bool: ocuped,
- xCharacters[][] = //Literele, cifrele si semnele folosit pentru Reactie.
- {
- "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", "~", "!", "#",
- "$", "%", "^", "&", "*", "!", ")", "(", "-", "_", "=", "+"
- }
- ;
- public OnFilterScriptInit()
- {
- print(" [ Reaction Test ] ");
- print(" [ By Xpllor ] ");
- printf(" [ Version %d ] ", Version);
- RTimer = SetTimer("ReactionTest", TIME, 1);
- return 1;
- }
- public OnFilterScriptExit()
- {
- print(" [ Reaction Test ] ");
- print(" [ By Xpllor ] ");
- print(" [ UnLoaded ] ");
- KillTimer(RTimer);
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- switch(ocuped)
- {
- case true:
- {
- if(!strcmp(Charatc, text, false))
- {
- new string[128], pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pName, sizeof(pName));
- format(string, sizeof(string), "{FFFFFF}« {00C0FF}%s {FFFFFF}has won the reaction test. »", pName);
- SendClientMessageToAll(GREEN, string);
- format(string, sizeof(string), "{FFFFFF}« You have earned {00C0FF}$%d {FFFFFF}+ {00C0FF}%d score points{FFFFFF}. »", WinCash, WinScore);
- SendClientMessage(playerid, GREEN, string);
- GivePlayerMoney(playerid, WinCash);
- SetPlayerScore(playerid, GetPlayerScore(playerid) + WinScore);
- RTimer = SetTimer("ReactionTest", TIME, 1);
- ocuped = false;
- }
- }
- }
- return 1;
- }
- function ReactionProcess()
- {
- switch(ocuped)
- {
- case true:
- {
- new string[128];
- format(string, sizeof(string), "{FFFFFF}« No-one won the reaction-test. {00C0FF}New one starting in %d minutes. {FFFFFF}»", (TIME/60000));
- SendClientMessageToAll(GREEN, string);
- RTimer = SetTimer("ReactionTest", TIME, 1);
- }
- }
- return 1;
- }
- function ReactionTest()
- {
- new xLength = (random(8) + 2), string[128];
- WinCash = (random(10000) + 20000);
- WinScore = (random(2)+1);
- format(Charatc, sizeof(Charatc), "");
- Loop(x, xLength) format(Charatc, sizeof(Charatc), "%s%s", Charatc, xCharacters[random(sizeof(xCharacters))][0]);
- format(string, sizeof(string), "{FFFFFF}« Who first types {00C0FF}%s {FFFFFF}wins {00C0FF}$%d {FFFFFF}+ {00C0FF}%d score points. {FFFFFF}»", Charatc, WinCash, WinScore);
- SendClientMessageToAll(GREEN, string);
- KillTimer(RTimer);
- ocuped = true;
- SetTimer("ReactionProcess", 30000, 0);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement