Advertisement
Rhay_Fither

[FS] Jogo de Perguntas - By Rhayziin / Rhay_Fither

Jun 17th, 2014
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 25.97 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <DOF2>
  4. #include <sscanf2>
  5.  
  6. #define FILTERSCRIPT
  7.  
  8. #define PASTA_PERGUNTADOS "Perguntados/%s.ini" //Pasta onde guardará as informações dos jogadores
  9. #define MAX_PERGUNTAS 34 //Máximo de perguntas
  10. #define POINTS_START 100 //Pontos que o jogador começa o jogo de perguntas
  11. #define MINUTOS_GIVE_POINTS 15 * 60000 //Minutos para que se o jogador não tenha pontos, ganhe +25
  12.  
  13. enum GodOfWarZero
  14. {
  15.     Clickado,
  16.     PerguntaID,
  17.     Pontos
  18. }
  19. new Perguntas[MAX_PLAYERS][GodOfWarZero];
  20. new PlayerText:PergTD[MAX_PLAYERS][15];
  21. new TimerPointsGame[2];
  22.  
  23. public OnFilterScriptInit()
  24. {
  25.     print("\n|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|");
  26.     print("| Jogo de Perguntas - By Rhayziin / Rhay_Fither |");
  27.     print("|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|\n");
  28.     return 1;
  29. }
  30.  
  31. public OnFilterScriptExit()
  32. {
  33.     DOF2_Exit();
  34.     return 1;
  35. }
  36.  
  37. public OnPlayerConnect(playerid)
  38. {
  39.     CreatePerguntTDs(playerid);
  40.     if(!DOF2_FileExists(FolderPerguntados(playerid)))
  41.     {
  42.         DOF2_CreateFile(FolderPerguntados(playerid));
  43.         DOF2_SetInt(FolderPerguntados(playerid), "Pontos", POINTS_START);
  44.         DOF2_SetInt(FolderPerguntados(playerid), "PerguntaID", 0);
  45.        
  46.         Perguntas[playerid][Pontos] = POINTS_START;
  47.         Perguntas[playerid][PerguntaID] = 0;
  48.     }
  49.     else
  50.     {
  51.         Perguntas[playerid][Pontos] = DOF2_GetInt(FolderPerguntados(playerid), "Pontos");
  52.         Perguntas[playerid][PerguntaID] = DOF2_GetInt(FolderPerguntados(playerid), "PerguntaID");
  53.     }
  54.  
  55.     TimerPointsGame[0] = SetTimerEx("AtualizarPontos", 1000, true, "i", playerid);
  56.     TimerPointsGame[1] = SetTimerEx("GivePointsGame", MINUTOS_GIVE_POINTS, true, "i", playerid);
  57.     return 1;
  58. }
  59.  
  60. public OnPlayerDisconnect(playerid, reason)
  61. {
  62.     DOF2_SetInt(FolderPerguntados(playerid), "Pontos", Perguntas[playerid][Pontos]);
  63.     DOF2_SetInt(FolderPerguntados(playerid), "PerguntaID", Perguntas[playerid][PerguntaID]);
  64.     KillTimer(TimerPointsGame[0]);
  65.     KillTimer(TimerPointsGame[1]);
  66.     return 1;
  67. }
  68.  
  69. public OnPlayerClickPlayerTextDraw ( playerid , PlayerText:playertextid )
  70. {
  71.     if(_:playertextid == INVALID_TEXT_DRAW) return CallLocalFunction("OnPlayerClickPlayerTextDraw", "ii", playerid, INVALID_TEXT_DRAW);
  72.     else if(playertextid == PergTD[playerid][8])
  73.     {
  74.         Perguntas[playerid][Clickado] = 1;
  75.         Open_Pergunta(playerid,Perguntas[playerid][PerguntaID], 1);
  76.         ShowTDsJogoP(playerid, false);
  77.     }
  78.     else if(playertextid == PergTD[playerid][9])
  79.     {
  80.         Perguntas[playerid][Clickado] = 2;
  81.         Open_Pergunta(playerid,Perguntas[playerid][PerguntaID], 1);
  82.         ShowTDsJogoP(playerid, false);
  83.     }
  84.     else if(playertextid == PergTD[playerid][10])
  85.     {
  86.         Perguntas[playerid][Clickado] = 3;
  87.         Open_Pergunta(playerid,Perguntas[playerid][PerguntaID], 1);
  88.         ShowTDsJogoP(playerid, false);
  89.     }
  90.     else if(playertextid == PergTD[playerid][11])
  91.     {
  92.         Perguntas[playerid][Clickado] = 4;
  93.         Open_Pergunta(playerid,Perguntas[playerid][PerguntaID], 1);
  94.         ShowTDsJogoP(playerid, false);
  95.     }
  96.     else if(playertextid == PergTD[playerid][13])
  97.     {
  98.         ShowTDsJogoP(playerid, false);
  99.     }
  100.     else if(playertextid == PergTD[playerid][14])
  101.     {
  102.         if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não tem dinheiro suficiente. (R$ 5000)");
  103.         Perguntas[playerid][PerguntaID]++;
  104.         ShowTDsJogoP(playerid, false);
  105.         GivePlayerMoney(playerid, -5000);
  106.         SendClientMessage(playerid, 0x00FFFFFF, "[INFO]: Você pulou a pergunta com sucesso. {FF2828}(-R$ 5000)");
  107.     }
  108.     return 1;
  109. }
  110.  
  111. CMD:perguntas(playerid)
  112. {
  113.     if(Perguntas[playerid][Pontos] < 50) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não tem pontos suficientes para iniciar o Jogo de Perguntas, aguarde alguns minutos.");
  114.     Open_Pergunta(playerid,Perguntas[playerid][PerguntaID], 0);
  115.     ShowTDsJogoP(playerid);
  116.     return 1;
  117. }
  118.  
  119. CMD:resetarperguntas(playerid, params[])
  120. {
  121.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Você não tem autorização para usar este comando.");
  122.     if(sscanf(params, "u", params[0])) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Use /resetarperguntas [ID]");
  123.     if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid, 0xFF0000FF, "[ERRO]: Jogador não conectado");
  124.     ResetarPerguntas(params[0]);
  125.     SendClientMessage(playerid, 0x00FF00FF, "[INFO]: Perguntas do jogador resetadas com sucesso.");
  126.     return 1;
  127. }
  128.  
  129. stock ResetarPerguntas(bucID)
  130. {
  131.     Perguntas[bucID][PerguntaID] = 0;
  132.     Perguntas[bucID][Pontos] = POINTS_START;
  133.     return 1;
  134. }
  135.  
  136. stock SetarPergunta(playerid, Pergunta[], Opcao1[], Opcao2[], Opcao3[], Opcao4[], opcaoCerta, PressButton)
  137. {
  138.     for(new i = 8; i < 12; ++i) PlayerTextDrawSetSelectable(playerid, PergTD[playerid][i], false); //PARA NÃO ACONTECER BUGS
  139.  
  140.     ConverterTexto(Pergunta);
  141.     ConverterTexto(Opcao1);
  142.     ConverterTexto(Opcao2);
  143.     ConverterTexto(Opcao3);
  144.     ConverterTexto(Opcao4);
  145.  
  146.     PlayerTextDrawSetString(playerid, PergTD[playerid][7], Pergunta);
  147.     PlayerTextDrawSetString(playerid, PergTD[playerid][8], Opcao1);
  148.     PlayerTextDrawSetString(playerid, PergTD[playerid][9], Opcao2);
  149.     PlayerTextDrawSetString(playerid, PergTD[playerid][10], Opcao3);
  150.     PlayerTextDrawSetString(playerid, PergTD[playerid][11], Opcao4);
  151.  
  152.     if(PressButton == 1)
  153.     {
  154.         Perguntas[playerid][PerguntaID]++;
  155.         if(opcaoCerta == Perguntas[playerid][Clickado])
  156.         {
  157.             SendClientMessage(playerid, -1, "{00FF00}[INFO]: Você escolheu a opção correta, você dá para um cara inteligente! {00FFFF}(+100 Pontos)");
  158.             Perguntas[playerid][Pontos] += 100;
  159.         }
  160.         else
  161.         {
  162.             if(Perguntas[playerid][Pontos] > 50)
  163.             {
  164.                 Perguntas[playerid][Pontos] -= 50;
  165.                 SendClientMessage(playerid, -1, "{FF0000}[INFO]: Você escolheu a opção errada e perdeu {FF8000}50 {FF0000}pontos.");
  166.             }
  167.             else
  168.             {
  169.                 Perguntas[playerid][Pontos] = 0;
  170.                 SendClientMessage(playerid, -1, "{FF0000}[INFO]: Você escolheu a opção errada e perdeu todos os seus pontos.");
  171.                 ShowTDsJogoP(playerid, false);
  172.                 return 1;
  173.             }
  174.         }
  175.         SetTimerEx("ShowNextPergunta", 50, false, "i", playerid);
  176.     }
  177.  
  178.     for(new i = 8; i < 12; ++i) PlayerTextDrawSetSelectable(playerid, PergTD[playerid][i], true); //PARA NÃO ACONTECER BUGS
  179.     return 1;
  180. }
  181.  
  182. forward ShowNextPergunta(id);
  183. public ShowNextPergunta(id)
  184. {
  185.     Open_Pergunta(id,Perguntas[id][PerguntaID], 0);
  186.     ShowTDsJogoP(id);
  187.     return 1;
  188. }
  189.  
  190. forward GivePointsGame(id);
  191. public GivePointsGame(id)
  192. {
  193.     if(Perguntas[id][Pontos] < 50)
  194.     {
  195.         Perguntas[id][Pontos] += 25;
  196.         GameTextForPlayer(id, "~y~+25 Pontos", 2000, 1);
  197.     }
  198.     return 1;
  199. }
  200.  
  201. forward AtualizarPontos(id);
  202. public AtualizarPontos(id)
  203. {
  204.     new StringPoints[30];
  205.     format(StringPoints, sizeof(StringPoints), "PONTOS: %d", Perguntas[id][Pontos]);
  206.     PlayerTextDrawSetString(id, PergTD[id][12], StringPoints);
  207.     return 1;
  208. }
  209.  
  210. stock FolderPerguntados(xID)
  211. {
  212.     new perName[MAX_PLAYER_NAME], perString[100];
  213.     GetPlayerName(xID, perName, sizeof(perName));
  214.     format(perString, sizeof(perString), PASTA_PERGUNTADOS, perName);
  215.     return perString;
  216. }
  217.  
  218. stock CreatePerguntTDs(playerid)
  219. {
  220.     PergTD[playerid][0] = CreatePlayerTextDraw(playerid,49.000000, 173.000000, "_");
  221.     PlayerTextDrawBackgroundColor(playerid,PergTD[playerid][0], 255);
  222.     PlayerTextDrawFont(playerid,PergTD[playerid][0], 1);
  223.     PlayerTextDrawLetterSize(playerid,PergTD[playerid][0], 0.500000, 23.399991);
  224.     PlayerTextDrawColor(playerid,PergTD[playerid][0], -1);
  225.     PlayerTextDrawSetOutline(playerid,PergTD[playerid][0], 0);
  226.     PlayerTextDrawSetProportional(playerid,PergTD[playerid][0], 1);
  227.     PlayerTextDrawSetShadow(playerid,PergTD[playerid][0], 1);
  228.     PlayerTextDrawUseBox(playerid,PergTD[playerid][0], 1);
  229.     PlayerTextDrawBoxColor(playerid,PergTD[playerid][0], 255);
  230.     PlayerTextDrawTextSize(playerid,PergTD[playerid][0], 580.000000, 0.000000);
  231.  
  232.     PergTD[playerid][1] = CreatePlayerTextDraw(playerid,49.000000, 154.000000, "~>~_JOGO DE PERGUNTAS");
  233.     PlayerTextDrawBackgroundColor(playerid,PergTD[playerid][1], 255);
  234.     PlayerTextDrawFont(playerid,PergTD[playerid][1], 1);
  235.     PlayerTextDrawLetterSize(playerid,PergTD[playerid][1], 0.500000, 1.300000);
  236.     PlayerTextDrawColor(playerid,PergTD[playerid][1], -1);
  237.     PlayerTextDrawSetOutline(playerid,PergTD[playerid][1], 1);
  238.     PlayerTextDrawSetProportional(playerid,PergTD[playerid][1], 1);
  239.     PlayerTextDrawUseBox(playerid,PergTD[playerid][1], 1);
  240.     PlayerTextDrawBoxColor(playerid,PergTD[playerid][1], -8388480);
  241.     PlayerTextDrawTextSize(playerid,PergTD[playerid][1], 580.000000, 0.000000);
  242.  
  243.     PergTD[playerid][2] = CreatePlayerTextDraw(playerid,49.000000, 154.000000, "_");
  244.     PlayerTextDrawBackgroundColor(playerid,PergTD[playerid][2], 255);
  245.     PlayerTextDrawFont(playerid,PergTD[playerid][2], 1);
  246.     PlayerTextDrawLetterSize(playerid,PergTD[playerid][2], 0.500000, 25.499998);
  247.     PlayerTextDrawColor(playerid,PergTD[playerid][2], -1);
  248.     PlayerTextDrawSetOutline(playerid,PergTD[playerid][2], 0);
  249.     PlayerTextDrawSetProportional(playerid,PergTD[playerid][2], 1);
  250.     PlayerTextDrawSetShadow(playerid,PergTD[playerid][2], 1);
  251.     PlayerTextDrawUseBox(playerid,PergTD[playerid][2], 1);
  252.     PlayerTextDrawBoxColor(playerid,PergTD[playerid][2], -8388480);
  253.     PlayerTextDrawTextSize(playerid,PergTD[playerid][2], 37.000000, 0.000000);
  254.  
  255.     PergTD[playerid][3] = CreatePlayerTextDraw(playerid,588.000000, 154.000000, "_");
  256.     PlayerTextDrawBackgroundColor(playerid,PergTD[playerid][3], 255);
  257.     PlayerTextDrawFont(playerid,PergTD[playerid][3], 1);
  258.     PlayerTextDrawLetterSize(playerid,PergTD[playerid][3], 0.500000, 25.500001);
  259.     PlayerTextDrawColor(playerid,PergTD[playerid][3], -1);
  260.     PlayerTextDrawSetOutline(playerid,PergTD[playerid][3], 0);
  261.     PlayerTextDrawSetProportional(playerid,PergTD[playerid][3], 1);
  262.     PlayerTextDrawSetShadow(playerid,PergTD[playerid][3], 1);
  263.     PlayerTextDrawUseBox(playerid,PergTD[playerid][3], 1);
  264.     PlayerTextDrawBoxColor(playerid,PergTD[playerid][3], -8388480);
  265.     PlayerTextDrawTextSize(playerid,PergTD[playerid][3], 585.000000, 0.000000);
  266.  
  267.     PergTD[playerid][4] = CreatePlayerTextDraw(playerid,45.000000, 391.000000, "_");
  268.     PlayerTextDrawBackgroundColor(playerid,PergTD[playerid][4], 255);
  269.     PlayerTextDrawFont(playerid,PergTD[playerid][4], 1);
  270.     PlayerTextDrawLetterSize(playerid,PergTD[playerid][4], 0.500000, -0.400000);
  271.     PlayerTextDrawColor(playerid,PergTD[playerid][4], -1);
  272.     PlayerTextDrawSetOutline(playerid,PergTD[playerid][4], 0);
  273.     PlayerTextDrawSetProportional(playerid,PergTD[playerid][4], 1);
  274.     PlayerTextDrawSetShadow(playerid,PergTD[playerid][4], 1);
  275.     PlayerTextDrawUseBox(playerid,PergTD[playerid][4], 1);
  276.     PlayerTextDrawBoxColor(playerid,PergTD[playerid][4], -8388480);
  277.     PlayerTextDrawTextSize(playerid,PergTD[playerid][4], 585.000000, 0.000000);
  278.  
  279.     PergTD[playerid][5] = CreatePlayerTextDraw(playerid,49.000000, 354.000000, "_");
  280.     PlayerTextDrawBackgroundColor(playerid,PergTD[playerid][5], 255);
  281.     PlayerTextDrawFont(playerid,PergTD[playerid][5], 1);
  282.     PlayerTextDrawLetterSize(playerid,PergTD[playerid][5], 0.500000, -0.400000);
  283.     PlayerTextDrawColor(playerid,PergTD[playerid][5], -1);
  284.     PlayerTextDrawSetOutline(playerid,PergTD[playerid][5], 0);
  285.     PlayerTextDrawSetProportional(playerid,PergTD[playerid][5], 1);
  286.     PlayerTextDrawSetShadow(playerid,PergTD[playerid][5], 1);
  287.     PlayerTextDrawUseBox(playerid,PergTD[playerid][5], 1);
  288.     PlayerTextDrawBoxColor(playerid,PergTD[playerid][5], -2139062144);
  289.     PlayerTextDrawTextSize(playerid,PergTD[playerid][5], 580.000000, 0.000000);
  290.  
  291.     PergTD[playerid][6] = CreatePlayerTextDraw(playerid,49.000000, 230.000000, "_");
  292.     PlayerTextDrawBackgroundColor(playerid,PergTD[playerid][6], 255);
  293.     PlayerTextDrawFont(playerid,PergTD[playerid][6], 1);
  294.     PlayerTextDrawLetterSize(playerid,PergTD[playerid][6], 0.500000, -0.400000);
  295.     PlayerTextDrawColor(playerid,PergTD[playerid][6], -1);
  296.     PlayerTextDrawSetOutline(playerid,PergTD[playerid][6], 0);
  297.     PlayerTextDrawSetProportional(playerid,PergTD[playerid][6], 1);
  298.     PlayerTextDrawSetShadow(playerid,PergTD[playerid][6], 1);
  299.     PlayerTextDrawUseBox(playerid,PergTD[playerid][6], 1);
  300.     PlayerTextDrawBoxColor(playerid,PergTD[playerid][6], -2139062144);
  301.     PlayerTextDrawTextSize(playerid,PergTD[playerid][6], 580.000000, 0.000000);
  302.  
  303.     PergTD[playerid][7] = CreatePlayerTextDraw(playerid,55.000000, 176.000000, "Na mitologia grega, quem seria o deus da guerra?");
  304.     PlayerTextDrawBackgroundColor(playerid,PergTD[playerid][7], 255);
  305.     PlayerTextDrawFont(playerid,PergTD[playerid][7], 1);
  306.     PlayerTextDrawLetterSize(playerid,PergTD[playerid][7], 0.500000, 1.300000);
  307.     PlayerTextDrawColor(playerid,PergTD[playerid][7], -1);
  308.     PlayerTextDrawSetOutline(playerid,PergTD[playerid][7], 0);
  309.     PlayerTextDrawSetProportional(playerid,PergTD[playerid][7], 1);
  310.     PlayerTextDrawSetShadow(playerid,PergTD[playerid][7], 1);
  311.  
  312.     PergTD[playerid][8] = CreatePlayerTextDraw(playerid,61.000000, 241.000000, "OPCAO 1");
  313.     PlayerTextDrawBackgroundColor(playerid,PergTD[playerid][8], 255);
  314.     PlayerTextDrawFont(playerid,PergTD[playerid][8], 2);
  315.     PlayerTextDrawLetterSize(playerid,PergTD[playerid][8], 0.500000, 1.300000);
  316.     PlayerTextDrawColor(playerid,PergTD[playerid][8], -1);
  317.     PlayerTextDrawSetOutline(playerid,PergTD[playerid][8], 1);
  318.     PlayerTextDrawSetProportional(playerid,PergTD[playerid][8], 1);
  319.     PlayerTextDrawUseBox(playerid,PergTD[playerid][8], 1);
  320.     PlayerTextDrawBoxColor(playerid,PergTD[playerid][8], -8388480);
  321.     PlayerTextDrawTextSize(playerid,PergTD[playerid][8], 566.000000, 10.000000);
  322.  
  323.     PergTD[playerid][9] = CreatePlayerTextDraw(playerid,61.000000, 270.000000, "OPCAO 2");
  324.     PlayerTextDrawBackgroundColor(playerid,PergTD[playerid][9], 255);
  325.     PlayerTextDrawFont(playerid,PergTD[playerid][9], 2);
  326.     PlayerTextDrawLetterSize(playerid,PergTD[playerid][9], 0.500000, 1.300000);
  327.     PlayerTextDrawColor(playerid,PergTD[playerid][9], -1);
  328.     PlayerTextDrawSetOutline(playerid,PergTD[playerid][9], 1);
  329.     PlayerTextDrawSetProportional(playerid,PergTD[playerid][9], 1);
  330.     PlayerTextDrawUseBox(playerid,PergTD[playerid][9], 1);
  331.     PlayerTextDrawBoxColor(playerid,PergTD[playerid][9], -8388480);
  332.     PlayerTextDrawTextSize(playerid,PergTD[playerid][9], 566.000000, 10.000000);
  333.  
  334.     PergTD[playerid][10] = CreatePlayerTextDraw(playerid,61.000000, 299.000000, "OPCAO 3");
  335.     PlayerTextDrawBackgroundColor(playerid,PergTD[playerid][10], 255);
  336.     PlayerTextDrawFont(playerid,PergTD[playerid][10], 2);
  337.     PlayerTextDrawLetterSize(playerid,PergTD[playerid][10], 0.500000, 1.300000);
  338.     PlayerTextDrawColor(playerid,PergTD[playerid][10], -1);
  339.     PlayerTextDrawSetOutline(playerid,PergTD[playerid][10], 1);
  340.     PlayerTextDrawSetProportional(playerid,PergTD[playerid][10], 1);
  341.     PlayerTextDrawUseBox(playerid,PergTD[playerid][10], 1);
  342.     PlayerTextDrawBoxColor(playerid,PergTD[playerid][10], -8388480);
  343.     PlayerTextDrawTextSize(playerid,PergTD[playerid][10], 566.000000, 10.000000);
  344.  
  345.     PergTD[playerid][11] = CreatePlayerTextDraw(playerid,61.000000, 328.000000, "OPCAO 4");
  346.     PlayerTextDrawBackgroundColor(playerid,PergTD[playerid][11], 255);
  347.     PlayerTextDrawFont(playerid,PergTD[playerid][11], 2);
  348.     PlayerTextDrawLetterSize(playerid,PergTD[playerid][11], 0.500000, 1.300000);
  349.     PlayerTextDrawColor(playerid,PergTD[playerid][11], -1);
  350.     PlayerTextDrawSetOutline(playerid,PergTD[playerid][11], 1);
  351.     PlayerTextDrawSetProportional(playerid,PergTD[playerid][11], 1);
  352.     PlayerTextDrawUseBox(playerid,PergTD[playerid][11], 1);
  353.     PlayerTextDrawBoxColor(playerid,PergTD[playerid][11], -8388480);
  354.     PlayerTextDrawTextSize(playerid,PergTD[playerid][11], 566.000000, 10.000000);
  355.  
  356.     PergTD[playerid][12] = CreatePlayerTextDraw(playerid,54.000000, 362.000000, "PONTOS: 000");
  357.     PlayerTextDrawBackgroundColor(playerid,PergTD[playerid][12], 255);
  358.     PlayerTextDrawFont(playerid,PergTD[playerid][12], 2);
  359.     PlayerTextDrawLetterSize(playerid,PergTD[playerid][12], 0.500000, 1.600000);
  360.     PlayerTextDrawColor(playerid,PergTD[playerid][12], -1);
  361.     PlayerTextDrawSetOutline(playerid,PergTD[playerid][12], 0);
  362.     PlayerTextDrawSetProportional(playerid,PergTD[playerid][12], 1);
  363.     PlayerTextDrawSetShadow(playerid,PergTD[playerid][12], 1);
  364.  
  365.     PergTD[playerid][13] = CreatePlayerTextDraw(playerid,478.000000, 365.000000, "FECHAR");
  366.     PlayerTextDrawBackgroundColor(playerid,PergTD[playerid][13], 255);
  367.     PlayerTextDrawFont(playerid,PergTD[playerid][13], 2);
  368.     PlayerTextDrawLetterSize(playerid,PergTD[playerid][13], 0.500000, 1.300000);
  369.     PlayerTextDrawColor(playerid,PergTD[playerid][13], -1);
  370.     PlayerTextDrawSetOutline(playerid,PergTD[playerid][13], 1);
  371.     PlayerTextDrawSetProportional(playerid,PergTD[playerid][13], 1);
  372.     PlayerTextDrawUseBox(playerid,PergTD[playerid][13], 1);
  373.     PlayerTextDrawBoxColor(playerid,PergTD[playerid][13], -8388480);
  374.     PlayerTextDrawTextSize(playerid,PergTD[playerid][13], 566.000000, 10.000000);
  375.  
  376.     PergTD[playerid][14] = CreatePlayerTextDraw(playerid,284.000000, 365.000000, "PULAR (R$ 5000)");
  377.     PlayerTextDrawBackgroundColor(playerid,PergTD[playerid][14], 255);
  378.     PlayerTextDrawFont(playerid,PergTD[playerid][14], 2);
  379.     PlayerTextDrawLetterSize(playerid,PergTD[playerid][14], 0.500000, 1.300000);
  380.     PlayerTextDrawColor(playerid,PergTD[playerid][14], -1);
  381.     PlayerTextDrawSetOutline(playerid,PergTD[playerid][14], 1);
  382.     PlayerTextDrawSetProportional(playerid,PergTD[playerid][14], 1);
  383.     PlayerTextDrawUseBox(playerid,PergTD[playerid][14], 1);
  384.     PlayerTextDrawBoxColor(playerid,PergTD[playerid][14], -8388480);
  385.     PlayerTextDrawTextSize(playerid,PergTD[playerid][14], 466.000000, 10.000000);
  386.  
  387.     PlayerTextDrawSetSelectable(playerid, PergTD[playerid][8], true);
  388.     PlayerTextDrawSetSelectable(playerid, PergTD[playerid][9], true);
  389.     PlayerTextDrawSetSelectable(playerid, PergTD[playerid][10], true);
  390.     PlayerTextDrawSetSelectable(playerid, PergTD[playerid][11], true);
  391.     PlayerTextDrawSetSelectable(playerid, PergTD[playerid][13], true);
  392.     PlayerTextDrawSetSelectable(playerid, PergTD[playerid][14], true);
  393.     return 1;
  394. }
  395.  
  396. stock ShowTDsJogoP(playerid, bool:ViewBool=true)
  397. {
  398.     if(ViewBool)
  399.     {
  400.         for(new i = 0; i < 15; ++i)
  401.         {
  402.             PlayerTextDrawShow(playerid, PergTD[playerid][i]);
  403.         }
  404.         SelectTextDraw(playerid, 0xFFFFFF80);
  405.     }
  406.     else
  407.     {
  408.         for(new i = 0; i < 15; ++i)
  409.         {
  410.             PlayerTextDrawHide(playerid, PergTD[playerid][i]);
  411.         }
  412.         CancelSelectTextDraw(playerid);
  413.     }
  414.     return 1;
  415. }
  416.  
  417. stock Open_Pergunta(playerid, oID, Apertou)
  418. {
  419.     if(oID > MAX_PERGUNTAS)
  420.     {
  421.         ResetarPerguntas(playerid);
  422.         Open_Pergunta(playerid,Perguntas[playerid][PerguntaID], 0);
  423.         return 1;
  424.     }
  425.    
  426.     if(oID == 0) SetarPergunta(playerid, "~g~Historia ~n~ ~w~Na mitologia grega, quem é o Deus da Guerra?", "Poseidon", "Ares", "Zeus", "Hélios", 2, Apertou);
  427.     else if(oID == 1) SetarPergunta(playerid, "~r~Geografia ~n~ ~w~Qual é a capital do Rio Grande do Norte?", "Pernambuco", "Salvador", "Natal", "João Pessoa", 3, Apertou);
  428.     else if(oID == 2) SetarPergunta(playerid, "~r~Geografia ~n~ ~w~Qual é a capital da Paraiba?", "Natal", "Salvador", "Pernambuco", "João Pessoa", 4, Apertou);
  429.     else if(oID == 3) SetarPergunta(playerid, "~g~Historia ~n~ ~w~Na mitologia grega, quem é a Deusa do Amor e da Beleza?", "Atena", "Hera", "Afrodite", "Reia", 3, Apertou);
  430.     else if(oID == 4) SetarPergunta(playerid, "~g~Historia ~n~ ~w~Na mitologia grega, quem é o Deus dos Deuses?", "Poseidon", "Apolo", "Hermes", "Zeus", 4, Apertou);
  431.     else if(oID == 5) SetarPergunta(playerid, "~y~Matematica ~n~ ~w~Resolva: 9 x 9 - 80 + 9 x 10 - 64 ?", "28", "32", "36", "42", 3, Apertou);
  432.     else if(oID == 6) SetarPergunta(playerid, "~p~Esporte ~n~ ~w~Qual foi o placar do primeiro jogo do Brasil na copa de 2014?", "Brasil 4 x 1 Croacia", "Brasil 3 x 1 Croacia", "Brasil 2 x 1 Croacia", "Brasil 1 x 1 Croacia", 2, Apertou);
  433.     else if(oID == 7) SetarPergunta(playerid, "~g~Historia ~n~ ~w~Na mitologia grega, quem é o deus conhecido como ~n~ a personificação do sol?", "Apolo", "Hermes", "Hélios", "Poseidon", 3, Apertou);
  434.     else if(oID == 8) SetarPergunta(playerid, "~y~Variedades ~n~ ~w~Quando um policial esta trabalhando, ele esta trajando:", "Um Quimono", "Uma Farda", "Um Pijama", "Um Terno", 2, Apertou);
  435.     else if(oID == 9) SetarPergunta(playerid, "~b~Ciencias ~n~ ~w~A orelha tem que tipo de formação?", "óssea", "Muscular", "Nervosa", "Cartilaginosa", 4, Apertou);
  436.     else if(oID == 10) SetarPergunta(playerid, "~y~Variedades ~n~ ~w~Argentita, é o nome dado a um tipo de:", "Instrumento", "Mineral", "Animal", "Planta", 2, Apertou);
  437.     else if(oID == 11) SetarPergunta(playerid, "~y~Variedades ~n~ ~w~A palavra 'BIG' em ingles significa:", "Grande", "Pequeno", "Bonito", "Porco", 1, Apertou);
  438.     else if(oID == 12) SetarPergunta(playerid, "~r~Geografia ~n~ ~w~O conjunto das condiçoes atmosféricas de uma região, ~n~ chama-se:", "Tempo", "Clima", "Estação", "Temperatura", 2, Apertou);
  439.     else if(oID == 13) SetarPergunta(playerid, "~g~Historia ~n~ ~w~Na mitologia grega, quem morreu por causa da vaidade?", "Apolo", "Zeus", "Eco", "Narciso", 4, Apertou);
  440.     else if(oID == 14) SetarPergunta(playerid, "~g~Historia ~n~ ~w~Onde ocorreu a guerra dos emboabas?", "Paraiba", "Ceara", "Piaui", "Minas Gerais", 4, Apertou);
  441.     else if(oID == 15) SetarPergunta(playerid, "~y~Variedades ~n~ ~w~Qual o unico mes que ganha mais um dia em anos bissextos?", "Junho", "Julho", "Fevereiro", "Janeiro", 3, Apertou);
  442.     else if(oID == 16) SetarPergunta(playerid, "~y~Variedades ~n~ ~w~Qual é a sigla da Organizaçao dos Estados Americanos?", "ONU", "OPEP", "UNE", "OEA", 4, Apertou);
  443.     else if(oID == 17) SetarPergunta(playerid, "~r~Geografia ~n~ ~w~A terra divide-se em quantos hemisférios?", "4", "3", "2", "1", 3, Apertou);
  444.     else if(oID == 18) SetarPergunta(playerid, "~y~Variedades ~n~ ~w~Em que historia infantil uma casa foi destruida com um sopro?", "A bela e a fera", "Os 3 porquinhos", "Bela adormecida", "Branca de neve", 2, Apertou);
  445.     else if(oID == 19) SetarPergunta(playerid, "~b~Ciencias ~n~ ~w~Qual desses sons não seria de um animal?", "Coaxar", "Cacarejo", "Tique-Taque", "Grunhido", 3, Apertou);
  446.     else if(oID == 20) SetarPergunta(playerid, "~b~Ciencias ~n~ ~w~Qual desses animais é o mais devagar?", "Tartaruga", "Leopardo", "Coelho", "Elefante", 1, Apertou);
  447.     else if(oID == 21) SetarPergunta(playerid, "~y~Variedades ~n~ ~w~Que cidade é conhecida como 'Zona Franca'?", "Cuiaba", "Curitiba", "Natal", "Manaus", 4, Apertou);
  448.     else if(oID == 22) SetarPergunta(playerid, "~y~Variedades ~n~ ~w~O Glossário refere-se a:", "Prefacio", "Vocabulário", "Tema", "Enredo", 2, Apertou);
  449.     else if(oID == 23) SetarPergunta(playerid, "~b~Ciencias ~n~ ~w~O dente-de-leão seria:", "Uma ferramenta", "Uma planta", "Um Caule", "Uma comida", 2, Apertou);
  450.     else if(oID == 24) SetarPergunta(playerid, "~y~Variedades ~n~ ~w~A palavra 'Natal' refere-se a:", "Crescimento", "Criar", "Juventude", "Nascimento", 4, Apertou);
  451.     else if(oID == 25) SetarPergunta(playerid, "~y~Variedades ~n~ ~w~Qual dessas datas não seria um feriado nacional?", "12 de agosto", "7 de setembro", "1 de maio", "25 de dezembro", 1, Apertou);
  452.     else if(oID == 26) SetarPergunta(playerid, "~y~Variedades ~n~ ~w~O Peregrino também pode ser chamado de:", "Romantico", "Romeu", "Romeiro", "Romancista", 3, Apertou);
  453.     else if(oID == 27) SetarPergunta(playerid, "~y~Variedades ~n~ ~w~Nos desenhos animados, quem é a mulher de ~n~ Fred Flintstone?", "Beth", "Vilma", "Margarida", "Clarabela", 2, Apertou);
  454.     else if(oID == 28) SetarPergunta(playerid, "~y~Variedades ~n~ ~w~Qual medicamento é utilizado para suprimir a dor?", "Antidepressivo", "Analgésico", "Calmante", "Laxante", 2, Apertou);
  455.     else if(oID == 29) SetarPergunta(playerid, "~g~Historia ~n~ ~w~Como eram chamados os navios que traziam os ~n~ escravos para o Brasil?", "Branqueiros", "Pesqueiros", "Negreiros", "Petroleiros", 3, Apertou);
  456.     else if(oID == 30) SetarPergunta(playerid, "~y~Variedades ~n~ ~w~O Ponei é um tipo de:", "Coelho", "Cachorro", "Camelo", "Cavalo", 4, Apertou);
  457.     else if(oID == 31) SetarPergunta(playerid, "~r~Geografia ~n~ ~w~O clima do Brasil seria caracterizado como:", "Tropical", "SubTropical", "Semi-Arido", "Equatorial", 1, Apertou);
  458.     else if(oID == 32) SetarPergunta(playerid, "~y~Variedades ~n~ ~w~Os objetos vendidos no sebo seriam:", "Novos", "Lacrados", "Ineditos", "Usados", 4, Apertou);
  459.     else if(oID == 33) SetarPergunta(playerid, "~y~Variedades ~n~ ~w~Qual seria a bebida originada do suco de uva?", "Cerveja", "Vinho", "uisque", "Refrigerante", 2, Apertou);
  460.     else if(oID == 34) SetarPergunta(playerid, "~y~Matematica ~n~ ~w~Quantas unidades tem 8 centenas?", "80", "100", "800", "8", 3, Apertou);
  461.     //else if(oID == ) SetarPergunta(playerid, "~y~Tema ~n~ ~w~TEXT", "", "", "", "", OPCAO_CERTA, Apertou);
  462.     return 1;
  463. }
  464.  
  465. stock ConverterTexto(string[]) // By Sheby
  466. {
  467.     for(new arraysize = 0; arraysize < strlen(string); arraysize++)
  468.     {
  469.         if(strfind(string, "â", true) != -1){new pos = strfind(string, "â", true); strdel(string, pos, pos+strlen("â")); strins(string, "™", pos, sizeof(pos));}
  470.         if(strfind(string, "ã", true) != -1){new pos = strfind(string, "ã", true); strdel(string, pos, pos+strlen("ã")); strins(string, "š", pos, sizeof(pos));}
  471.         if(strfind(string, "á", true) != -1){new pos = strfind(string, "á", true); strdel(string, pos, pos+strlen("á")); strins(string, "˜", pos, sizeof(pos));}
  472.         if(strfind(string, "é", true) != -1){new pos = strfind(string, "é", true); strdel(string, pos, pos+strlen("é")); strins(string, "ž", pos, sizeof(pos));}
  473.         if(strfind(string, "ú", true) != -1){new pos = strfind(string, "ú", true); strdel(string, pos, pos+strlen("ú")); strins(string, "“", pos, sizeof(pos));}
  474.         if(strfind(string, "ó", true) != -1){new pos = strfind(string, "ó", true); strdel(string, pos, pos+strlen("ó")); strins(string, "¦", pos, sizeof(pos));}
  475.         if(strfind(string, "ê", true) != -1){new pos = strfind(string, "ê", true); strdel(string, pos, pos+strlen("ê")); strins(string, "Ÿ", pos, sizeof(pos));}
  476.         if(strfind(string, "í", true) != -1){new pos = strfind(string, "í", true); strdel(string, pos, pos+strlen("í")); strins(string, "¢", pos, sizeof(pos));}
  477.         if(strfind(string, "ç", true) != -1){new pos = strfind(string, "ç", true); strdel(string, pos, pos+strlen("ç")); strins(string, "œ", pos, sizeof(pos));}
  478.         if(strfind(string, "ô", true) != -1){new pos = strfind(string, "ô", true); strdel(string, pos, pos+strlen("ô")); strins(string, "§", pos, sizeof(pos));}
  479.     }
  480. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement