Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include a_samp
- #define Dificuldade 3 // Coloque aqui a dificuldade.
- #define Dinheiro 1000 // Coloque a quantidade de quantos o player receberá de recompensa.
- #define Minutos 5 // Configure quantos minutos terá mudanças em cada palavra..
- #define VERDE "{00FF00}"
- #define AZUL "{6495ED}"
- #define CINZA "{C0C0C0}"
- new
- synDificulting = Dificuldade
- ;
- new
- Dificult[5][2] =
- {
- {0x21, 0x7E}, // Amazing
- {0x30, 0x7A}, // Expert
- {0x41, 0x7A}, // Hard
- {0 , 0 }, // Easy (Characters Only)
- {0x30, 0x39} // Very Easy (Numbers Only)
- },
- string[140] = '\0',
- Acertou = -1,
- ChsTemp = -0
- ;
- public OnFilterScriptInit()
- {
- ChsTemp = SetTimer("@SelectNewWord", Minutos * 10000, true);
- return 1;
- }
- @SelectNewWord(); public @SelectNewWord()
- {
- if(Acertou == -1)
- {
- string[0] = EOS;
- if(synDificulting != 3)
- {
- format(string, sizeof(string), "%c%c%c%c%c%c", RandomEx(Dificult[synDificulting][0], Dificult[synDificulting][1]),RandomEx(Dificult[synDificulting][0], Dificult[synDificulting][1]),RandomEx(Dificult[synDificulting][0], Dificult[synDificulting][1]),RandomEx(Dificult[synDificulting][0], Dificult[synDificulting][1]), RandomEx(Dificult[synDificulting][0], Dificult[synDificulting][1]) , RandomEx(Dificult[synDificulting][0], Dificult[synDificulting][1]) );
- }
- else
- {
- format(string, sizeof(string), "%c%c%c%c%c%c", RandomEx(0x41, 0x5A), RandomEx(0x61, 0x7A),RandomEx(0x41, 0x5A), RandomEx(0x61, 0x7A),RandomEx(0x41, 0x5A), RandomEx(0x61, 0x7A));
- }
- new annstring[130];
- format(annstring, sizeof(annstring),AZUL"[REACTION-TEST]: Novo teste de reação! Palavra: \""VERDE"%s"AZUL"\", ela vale R$: "VERDE"%d", string, Dinheiro);
- SendClientMessageToAll(-1, annstring);
- }
- return true;
- }
- public OnPlayerText(playerid, text[])
- {
- if(!strcmp(text, string, false) && Acertou == -1)
- {
- Acertou = playerid;
- KillTimer(ChsTemp);
- new Nome[24]; GetPlayerName(playerid, Nome, 24);
- format(string, sizeof(string), AZUL"[REACTION-TEST]: O Player: "VERDE"%s[ID:%i] "AZUL"Acertou o teste de reação, Faturou: R$: %d Palavra: "VERDE"%s", Nome, playerid, Dinheiro, text);
- SendClientMessageToAll(-1, string);
- format(string, sizeof(string), CINZA"[REACTION-TEST]: O próximo teste inicia-se em "VERDE"%d "CINZA"minutos..", Minutos);
- SendClientMessageToAll(-1, string);
- GivePlayerMoney(playerid, Dinheiro);
- Acertou = -1;
- ChsTemp = SetTimer("@SelectNewWord", Minutos * 10000, true);
- return false;
- }
- return true;
- }
- static stock RandomEx(minnum = cellmin, maxnum = cellmax) // By Y_Less
- return random(maxnum - minnum + 1) + minnum;
- //////////////////////////// TESTING
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp(cmdtext,"/iniciar", true))
- {
- if(!IsPlayerAdmin(playerid)) return false;
- @SelectNewWord();
- return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement