Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- -* Simples FS de mini-game matemático. (Bug's não encontrado).
- -* Script de base por: Don Speed.
- -* Script modificado por: GReeN_WOoD.
- */
- #define FILTERSCRIPT
- #include < a_samp >
- #include < zcmd >
- #include < sscanf2 >
- #if defined FILTERSCRIPT
- //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
- #define MINUTO 2 // Aqui você define o tempo em minutos que o mini-game ficará ativo.
- #define @VERDE 0x00D900C8 // Verde Florescente
- #define @AMARELOC 0xFFE868AA // Amarelo Claro
- #define @AZULC 0x60BFFFAA // Azul Claro
- //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
- forward Comeco(playerid);
- forward CancelarMiniGame(playerid);
- new MinhaResposta[MAX_PLAYERS];
- new bool:PermitirResp[MAX_PLAYERS] = false;
- new bool:Mini_Game_Ativo;
- new RespCorreta = 0;
- enum pmat {
- ContaMat[50],
- Resposta
- }
- //Aqui você pode criar mais contas.
- new _Matematica[9][pmat] = {
- { " 9*7 ", 63},
- { " 27+4+6-3 ", 34},
- { " 31+4-2-3 ", 30},
- { " 4*4-4 ", 12},
- { " 5*5+2 ", 27},
- { " 7*7+2+5-1 ", 55},
- { " 3*2+5-1 ", 10},
- { " 2*8-2-3 ", 11},
- { " 2*4+3-6 ", 5}
- };
- Nome(playerid){
- new pNome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pNome, 24);
- return pNome;
- }
- //=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
- public OnFilterScriptInit() return print("\n- FilterScript de mini-mame matemático carregado.\n");
- public Comeco(playerid){
- new _Rand = random(sizeof(_Matematica));
- static strm[128];
- SendClientMessageToAll(@AZULC, "=============================================================");
- format(strm, sizeof strm,"[MINI-GAME / MATEMÁTICA]{FFFFFF} %s", _Matematica[_Rand][ContaMat]);
- SendClientMessageToAll(0xFF0000FF, strm);
- SendClientMessageToAll(0x00FF00FF, "[MINI-GAME]{FFFFFF} Responda corretamente e ganhe R$200.");
- SendClientMessageToAll(0x00FF00FF, "[MINI-GAME]{FFFFFF} Para responder (/resultado).");
- SendClientMessageToAll(@AZULC, "=============================================================");
- for(new o = 0; o < MAX_PLAYERS; o++) PermitirResp[o] = true;
- RespCorreta = _Matematica[_Rand][Resposta];
- Mini_Game_Ativo = true;
- SetTimer("CancelarMiniGame", MINUTO*60000, false);
- return true;
- }
- public CancelarMiniGame(){
- if(Mini_Game_Ativo == true) return SendClientMessageToAll(0x00FF00FF, "[MINI-GAME ENCERRADO]{FFFFFF} Ninguém ganhou no mini-game."), Mini_Game_Ativo = false;
- return true;
- }
- //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
- CMD:minigame(playerid) {
- if(Mini_Game_Ativo == true) return SendClientMessage(playerid, -1, "[MINI-GAME]{FFFFFF} Já existe um mini-game ativo.");
- SetTimer("Comeco", 5000, false);
- SendClientMessage(playerid, @AZULC, "Você ligou o mini-game matemático, aguarde 5 segundos.");
- SendClientMessageToAll(@AZULC, "Mini-game matemático irá ser iniciado dentro de 5 segundos, preparem-se!");
- return true;
- }
- CMD:resultado(playerid, params[]) {
- static N;
- if (Mini_Game_Ativo == false) return SendClientMessage(playerid, -1, "[ERRO] O mini-game está desativado.");
- if(PermitirResp[playerid] == false) return SendClientMessage(playerid, -1, "[ERRO] Você não pode mais responder.");
- if(sscanf(params, "d", N))return SendClientMessage(playerid, 0x00FF00FF, "Use: /resultado [resposta da conta matemática]");
- MinhaResposta[playerid] = N;
- SendClientMessage(playerid, @AMARELOC, "Verificando sua resposta ...");
- if(MinhaResposta[playerid] == RespCorreta){
- static str[128];
- format(str, sizeof str,"[MINI-GAME RESULTADO]{FFFFFF} %s acertou o resultado do mini-game que é: %d .", Nome(playerid), RespCorreta);
- SendClientMessageToAll(@VERDE, str);
- RespCorreta = 0;
- MinhaResposta[playerid] = 0;
- Mini_Game_Ativo = false;
- GivePlayerMoney(playerid, 200);
- }
- else SendClientMessage(playerid, -1, "[ERRO] Você errou o resultado e não pode mais responder."), PermitirResp[playerid] = false;
- return true;
- }
- //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement