Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- @Author: [iPs]SuYaNw / eu mesmo xD
- @For: iPs TeaM
- */
- #include <a_samp>
- #define MAX_CHAR_FOR_REACTION (7)
- #define TIME_FOR_NEW_REACTION (15000)
- #define MONEY_RECEIV_REACTION (1000)
- LoadReaction();
- new
- string[100],
- _stri[128],
- Acertou,
- stchar,
- chars[] =
- {
- "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","1","2","3","4","5","6","7","8","9","0",
- "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","z"
- }
- ;
- public OnFilterScriptInit()
- {
- print("--------------------- Teste de Reação ---------------------");
- print(" Por: [iPs]SuYaNw' \n\n");
- print("Configuração:");
- printf( " - Máximo Caratere por reação: %d\n - Tempo para nova reação: %d\n - Dinheiro a cada reação: %d", MAX_CHAR_FOR_REACTION, TIME_FOR_NEW_REACTION, MONEY_RECEIV_REACTION);
- print("--------------------- Teste de Reação ---------------------");
- SetTimer("LoadReaction", TIME_FOR_NEW_REACTION, true);
- return true;
- }
- public LoadReaction()
- {
- _stri[0] = EOS;
- stchar = -1;
- for(new i; i < MAX_CHAR_FOR_REACTION; ++i) strcat(_stri, chars[random(sizeof(chars))]);
- format(string, sizeof(string),"{FF00FF}[TEST-REAÇÃO]{FFFFFF}: Quem digitar primeiro {FF0000}%s{FFFFFF} ganha %d de grana!", _stri, MONEY_RECEIV_REACTION);
- SendClientMessageToAll(-1, string);
- Acertou = 0xFFFFFF;
- stchar = strlen(_stri);
- return true;
- }
- public OnPlayerText(playerid, text[])
- {
- if(!(strlen(_stri) < stchar))
- {
- if(!strcmp(text, _stri, false))
- {
- if(Acertou != -1)
- {
- GetPlayerName(Acertou, string, 24);
- format(string, sizeof(string),"Desculpe, mais o %s já acertou a palavra: %s", string, _stri);
- SendClientMessage(playerid, -1, string);
- return false;
- }
- GetPlayerName(playerid, string, 24);
- format(string, sizeof(string),"%s[%i] Acertou no teste de Reação!!, palavra: %s",string, playerid, _stri);
- SendClientMessageToAll(-1, string);
- Acertou = playerid;
- return false;
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment