Advertisement
Guest User

Untitled

a guest
Nov 25th, 2010
390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 29.18 KB | None | 0 0
  1. /*~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~||
  2. ||~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~||
  3. ||              ____    ___    _____         _____   _______                 ||
  4. ||         \   |    \  |   |  \     \       /    /  |       \     /          ||
  5. || ======== \  |     \ |   |   \     \  _  /    /   |   |\   \   / ========  ||
  6. ||           | |      \|   |    \     \/ \/    /    |   | |   | |            ||
  7. || ======== /  |    \      |     \     /\     /     |   |/   /   \ ========  ||
  8. ||         /   |____|\_____|      \___/  \___/      |_______/     \          ||
  9. ||                  [FS] Anuncios by: [NWD]Jim._.Carrey                      ||
  10. ||~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~||
  11. ||                   Agradecimentos a PooweeR e Kasura                       ||
  12. ||~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~||
  13. || •--»| Brasil • World Wicked - RpG • [NWD]™ |«--• ~> 199.187.121.157:7791  ||
  14. ||~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~<~>~<~~>~||*/
  15.  
  16. #include <a_samp>
  17.  
  18. #define COR_ERRO 0xFF0000DD
  19. #define COR_ANS  0xFFFFFFAA
  20. #define COR_ADM  0x007FFFAA
  21.  
  22. #define ANNTIPOS 77713
  23.  
  24. new Text:anuncio,Text:anuncio1,Text:anuncio2,Text:anuncio3;
  25. new pName[MAX_PLAYER_NAME];
  26. new bool:JaTemAnuncio;
  27.  
  28. forward OnPlayerRemoveTextDraw();
  29. forward OnPlayerRemoveTextDraw1();
  30. forward OnPlayerRemoveTextDraw2();
  31. forward OnPlayerRemoveTextDraw3();
  32. forward OnPlayerAnuncio();
  33.  
  34. public OnFilterScriptInit()
  35. {
  36.     anuncio = TextDrawCreate(90.000000,220.000000,"[NWD]Jim._.Carrey");
  37.     anuncio1 = TextDrawCreate(90.000000,220.000000,"[NWD]Jim._.Carrey");
  38.     anuncio2 = TextDrawCreate(90.000000,220.000000,"[NWD]Jim._.Carrey");
  39.     anuncio3 = TextDrawCreate(90.000000,220.000000,"[NWD]Jim._.Carrey");// No Flood!
  40.     TextDrawAlignment(anuncio, 0);
  41.     TextDrawAlignment(anuncio1, 0);
  42.     TextDrawAlignment(anuncio2, 0);
  43.     TextDrawAlignment(anuncio3, 0);
  44.     TextDrawBackgroundColor(anuncio, 0x000000AA);
  45.     TextDrawBackgroundColor(anuncio1, 0x000000AA);
  46.     TextDrawBackgroundColor(anuncio2, 0x000000AA);
  47.     TextDrawBackgroundColor(anuncio3, 0x000000AA);
  48.     TextDrawFont(anuncio, 0);
  49.     TextDrawFont(anuncio1, 1);
  50.     TextDrawFont(anuncio2, 2);
  51.     TextDrawFont(anuncio3, 3);
  52.     TextDrawLetterSize(anuncio,0.439999,1.700000);
  53.     TextDrawLetterSize(anuncio1,0.439999,1.700000);
  54.     TextDrawLetterSize(anuncio2,0.439999,1.700000);
  55.     TextDrawLetterSize(anuncio3,0.439999,1.700000);
  56.     TextDrawColor(anuncio, 0xFFFFFFAA);
  57.     TextDrawColor(anuncio1, 0xFFFFFFAA);
  58.     TextDrawColor(anuncio2, 0xFFFFFFAA);
  59.     TextDrawColor(anuncio3, 0xFFFFFFAA);
  60.     TextDrawSetOutline(anuncio, 1);
  61.     TextDrawSetOutline(anuncio1, 1);
  62.     TextDrawSetOutline(anuncio2, 1);
  63.     TextDrawSetOutline(anuncio3, 1);
  64.     TextDrawSetProportional(anuncio, 0);
  65.     TextDrawSetProportional(anuncio1, 0);
  66.     TextDrawSetProportional(anuncio2, 0);
  67.     TextDrawSetProportional(anuncio3, 0);
  68.     TextDrawSetShadow(anuncio, 1);
  69.     TextDrawSetShadow(anuncio1, 1);
  70.     TextDrawSetShadow(anuncio2, 1);
  71.     TextDrawSetShadow(anuncio3, 1);
  72.     return 1;
  73. }
  74.  
  75. public OnFilterScriptExit()
  76. {
  77.     TextDrawHideForAll(anuncio);
  78.     TextDrawDestroy(anuncio);
  79.     return 1;
  80. }
  81.  
  82. public OnPlayerSpawn(playerid)
  83. {
  84.     TextDrawHideForAll(anuncio);
  85.     return 1;
  86. }
  87.  
  88. public OnPlayerCommandText(playerid, cmdtext[])
  89. {
  90.     new cmd[128],idx,string[256];
  91.     cmd = strtok(cmdtext, idx);
  92.  
  93.     if(strcmp(cmd, "/anunciar", true) == 0)
  94.     {
  95.         if(IsPlayerAdmin(playerid))
  96.         {
  97.             if(JaTemAnuncio == true) return SendClientMessage(playerid, COR_ERRO, "[ERRO] Já tem um anuncio na tela, aguarde ele sair para fazer outro!");
  98.             GetPlayerName(playerid, pName, sizeof(pName));
  99.             new length = strlen(cmdtext);
  100.             while ((idx < length) && (cmdtext[idx] <= ' '))
  101.             {
  102.                 idx++;
  103.             }
  104.             new offset = idx;
  105.             new result[64];
  106.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  107.             {
  108.                 result[idx - offset] = cmdtext[idx];
  109.                 idx++;
  110.             }
  111.             result[idx - offset] = EOS;
  112.             if(!strlen(result))
  113.             {
  114.                 SendClientMessage(playerid, COR_ERRO, "[ERRO] Uso correto: /anunciar [Texto]");
  115.                 return 1;
  116.             }
  117.             format(string, sizeof(string), "~p~ %s", result);
  118.             TextDrawSetString(anuncio, string);
  119.             TextDrawShowForAll(anuncio);
  120.             SetTimerEx("OnPlayerRemoveTextDraw", 10000, true, "i", playerid);
  121.             JaTemAnuncio = true;
  122.         }
  123.         else
  124.         {
  125.             SendClientMessage(playerid, COR_ERRO, "[ERRO] Você não é Administrador!");
  126.             return 1;
  127.         }
  128.         return 1;
  129.     }
  130.    
  131.     if(strcmp(cmd, "/anunciar1", true) == 0)
  132.     {
  133.         if(IsPlayerAdmin(playerid))
  134.         {
  135.             if(JaTemAnuncio == true) return SendClientMessage(playerid, COR_ERRO, "[ERRO] Já tem um anuncio na tela, aguarde ele sair para fazer outro!");
  136.             GetPlayerName(playerid, pName, sizeof(pName));
  137.             new length = strlen(cmdtext);
  138.             while ((idx < length) && (cmdtext[idx] <= ' '))
  139.             {
  140.                 idx++;
  141.             }
  142.             new offset = idx;
  143.             new result[64];
  144.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  145.             {
  146.                 result[idx - offset] = cmdtext[idx];
  147.                 idx++;
  148.             }
  149.             result[idx - offset] = EOS;
  150.             if(!strlen(result))
  151.             {
  152.                 SendClientMessage(playerid, COR_ERRO, "[ERRO] Uso correto: /anunciar1 [Texto]");
  153.                 return 1;
  154.             }
  155.             format(string, sizeof(string), "~r~ %s diz:~w~ %s", pName, result);
  156.             TextDrawSetString(anuncio,string);
  157.             TextDrawShowForAll(anuncio);
  158.             SetTimerEx("OnPlayerRemoveTextDraw", 10000, true, "i", playerid);
  159.             JaTemAnuncio = true;
  160.         }
  161.         else
  162.         {
  163.             SendClientMessage(playerid, COR_ERRO, "[ERRO] Você não é Administrador!");
  164.             return 1;
  165.         }
  166.         return 1;
  167.     }
  168. //-----------------------------------------------------------------------------------------------------------
  169.     if(strcmp(cmd, "/anun", true) == 0)
  170.     {
  171.         if(IsPlayerAdmin(playerid))
  172.         {
  173.             if(JaTemAnuncio == true) return SendClientMessage(playerid, COR_ERRO, "[ERRO] Já tem um anuncio na tela, aguarde ele sair para fazer outro!");
  174.             GetPlayerName(playerid, pName, sizeof(pName));
  175.             new length = strlen(cmdtext);
  176.             while ((idx < length) && (cmdtext[idx] <= ' '))
  177.             {
  178.                 idx++;
  179.             }
  180.             new offset = idx;
  181.             new result[64];
  182.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  183.             {
  184.                 result[idx - offset] = cmdtext[idx];
  185.                 idx++;
  186.             }
  187.             result[idx - offset] = EOS;
  188.             if(!strlen(result))
  189.             {
  190.                 SendClientMessage(playerid, COR_ERRO, "[ERRO] Uso correto: /anunciar [Texto]");
  191.                 return 1;
  192.             }
  193.             format(string, sizeof(string), "~b~ %s", result);
  194.             TextDrawSetString(anuncio1, string);
  195.             TextDrawShowForAll(anuncio1);
  196.             SetTimerEx("OnPlayerRemoveTextDraw1", 10000, true, "i", playerid);
  197.             JaTemAnuncio = true;
  198.         }
  199.         else
  200.         {
  201.             SendClientMessage(playerid, COR_ERRO, "[ERRO] Você não é Administrador!");
  202.             return 1;
  203.         }
  204.         return 1;
  205.     }
  206.  
  207.     if(strcmp(cmd, "/anun1", true) == 0)
  208.     {
  209.         if(IsPlayerAdmin(playerid))
  210.         {
  211.             if(JaTemAnuncio == true) return SendClientMessage(playerid, COR_ERRO, "[ERRO] Já tem um anuncio na tela, aguarde ele sair para fazer outro!");
  212.             GetPlayerName(playerid, pName, sizeof(pName));
  213.             new length = strlen(cmdtext);
  214.             while ((idx < length) && (cmdtext[idx] <= ' '))
  215.             {
  216.                 idx++;
  217.             }
  218.             new offset = idx;
  219.             new result[64];
  220.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  221.             {
  222.                 result[idx - offset] = cmdtext[idx];
  223.                 idx++;
  224.             }
  225.             result[idx - offset] = EOS;
  226.             if(!strlen(result))
  227.             {
  228.                 SendClientMessage(playerid, COR_ERRO, "[ERRO] Uso correto: /anunciar1 [Texto]");
  229.                 return 1;
  230.             }
  231.             format(string, sizeof(string), "~p~ %s diz:~w~ %s", pName, result);
  232.             TextDrawSetString(anuncio1,string);
  233.             TextDrawShowForAll(anuncio1);
  234.             SetTimerEx("OnPlayerRemoveTextDraw1", 10000, true, "i", playerid);
  235.             JaTemAnuncio = true;
  236.         }
  237.         else
  238.         {
  239.             SendClientMessage(playerid, COR_ERRO, "[ERRO] Você não é Administrador!");
  240.             return 1;
  241.         }
  242.         return 1;
  243.     }
  244. //-----------------------------------------------------------------------------------------------------------
  245.     if(strcmp(cmd, "/anc", true) == 0)
  246.     {
  247.         if(IsPlayerAdmin(playerid))
  248.         {
  249.             if(JaTemAnuncio == true) return SendClientMessage(playerid, COR_ERRO, "[ERRO] Já tem um anuncio na tela, aguarde ele sair para fazer outro!");
  250.             GetPlayerName(playerid, pName, sizeof(pName));
  251.             new length = strlen(cmdtext);
  252.             while ((idx < length) && (cmdtext[idx] <= ' '))
  253.             {
  254.                 idx++;
  255.             }
  256.             new offset = idx;
  257.             new result[64];
  258.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  259.             {
  260.                 result[idx - offset] = cmdtext[idx];
  261.                 idx++;
  262.             }
  263.             result[idx - offset] = EOS;
  264.             if(!strlen(result))
  265.             {
  266.                 SendClientMessage(playerid, COR_ERRO, "[ERRO] Uso correto: /anunciar [Texto]");
  267.                 return 1;
  268.             }
  269.             format(string, sizeof(string), "~g~ %s", result);
  270.             TextDrawSetString(anuncio2, string);
  271.             TextDrawShowForAll(anuncio2);
  272.             SetTimerEx("OnPlayerRemoveTextDraw2", 10000, true, "i", playerid);
  273.             JaTemAnuncio = true;
  274.         }
  275.         else
  276.         {
  277.             SendClientMessage(playerid, COR_ERRO, "[ERRO] Você não é Administrador!");
  278.             return 1;
  279.         }
  280.         return 1;
  281.     }
  282.  
  283.     if(strcmp(cmd, "/anc1", true) == 0)
  284.     {
  285.         if(IsPlayerAdmin(playerid))
  286.         {
  287.             if(JaTemAnuncio == true) return SendClientMessage(playerid, COR_ERRO, "[ERRO] Já tem um anuncio na tela, aguarde ele sair para fazer outro!");
  288.             GetPlayerName(playerid, pName, sizeof(pName));
  289.             new length = strlen(cmdtext);
  290.             while ((idx < length) && (cmdtext[idx] <= ' '))
  291.             {
  292.                 idx++;
  293.             }
  294.             new offset = idx;
  295.             new result[64];
  296.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  297.             {
  298.                 result[idx - offset] = cmdtext[idx];
  299.                 idx++;
  300.             }
  301.             result[idx - offset] = EOS;
  302.             if(!strlen(result))
  303.             {
  304.                 SendClientMessage(playerid, COR_ERRO, "[ERRO] Uso correto: /anunciar1 [Texto]");
  305.                 return 1;
  306.             }
  307.             format(string, sizeof(string), "~g~ %s diz:~w~ %s", pName, result);
  308.             TextDrawSetString(anuncio2,string);
  309.             TextDrawShowForAll(anuncio2);
  310.             SetTimerEx("OnPlayerRemoveTextDraw2", 10000, true, "i", playerid);
  311.             JaTemAnuncio = true;
  312.         }
  313.         else
  314.         {
  315.             SendClientMessage(playerid, COR_ERRO, "[ERRO] Você não é Administrador!");
  316.             return 1;
  317.         }
  318.         return 1;
  319.     }
  320. //-----------------------------------------------------------------------------------------------------------
  321.     if(strcmp(cmd, "/aann", true) == 0)
  322.     {
  323.         if(IsPlayerAdmin(playerid))
  324.         {
  325.             if(JaTemAnuncio == true) return SendClientMessage(playerid, COR_ERRO, "[ERRO] Já tem um anuncio na tela, aguarde ele sair para fazer outro!");
  326.             GetPlayerName(playerid, pName, sizeof(pName));
  327.             new length = strlen(cmdtext);
  328.             while ((idx < length) && (cmdtext[idx] <= ' '))
  329.             {
  330.                 idx++;
  331.             }
  332.             new offset = idx;
  333.             new result[64];
  334.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  335.             {
  336.                 result[idx - offset] = cmdtext[idx];
  337.                 idx++;
  338.             }
  339.             result[idx - offset] = EOS;
  340.             if(!strlen(result))
  341.             {
  342.                 SendClientMessage(playerid, COR_ERRO, "[ERRO] Uso correto: /anunciar [Texto]");
  343.                 return 1;
  344.             }
  345.             format(string, sizeof(string), "~y~ %s", result);
  346.             TextDrawSetString(anuncio3, string);
  347.             TextDrawShowForAll(anuncio3);
  348.             SetTimerEx("OnPlayerRemoveTextDraw3", 10000, true, "i", playerid);
  349.             JaTemAnuncio = true;
  350.         }
  351.         else
  352.         {
  353.             SendClientMessage(playerid, COR_ERRO, "[ERRO] Você não é Administrador!");
  354.             return 1;
  355.         }
  356.         return 1;
  357.     }
  358.  
  359.     if(strcmp(cmd, "/aann1", true) == 0)
  360.     {
  361.         if(IsPlayerAdmin(playerid))
  362.         {
  363.             if(JaTemAnuncio == true) return SendClientMessage(playerid, COR_ERRO, "[ERRO] Já tem um anuncio na tela, aguarde ele sair para fazer outro!");
  364.             GetPlayerName(playerid, pName, sizeof(pName));
  365.             new length = strlen(cmdtext);
  366.             while ((idx < length) && (cmdtext[idx] <= ' '))
  367.             {
  368.                 idx++;
  369.             }
  370.             new offset = idx;
  371.             new result[64];
  372.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  373.             {
  374.                 result[idx - offset] = cmdtext[idx];
  375.                 idx++;
  376.             }
  377.             result[idx - offset] = EOS;
  378.             if(!strlen(result))
  379.             {
  380.                 SendClientMessage(playerid, COR_ERRO, "[ERRO] Uso correto: /anunciar1 [Texto]");
  381.                 return 1;
  382.             }
  383.             format(string, sizeof(string), "~y~ %s diz:~w~ %s", pName, result);
  384.             TextDrawSetString(anuncio3,string);
  385.             TextDrawShowForAll(anuncio3);
  386.             SetTimerEx("OnPlayerRemoveTextDraw3", 10000, true, "i", playerid);
  387.             JaTemAnuncio = true;
  388.         }
  389.         else
  390.         {
  391.             SendClientMessage(playerid, COR_ERRO, "[ERRO] Você não é Administrador!");
  392.             return 1;
  393.         }
  394.         return 1;
  395.     }
  396. //-----------------------------------------------------------------------------------------------------------
  397.     if(strcmp(cmd, "/anm", true) == 0)
  398.     {
  399.         if(IsPlayerAdmin(playerid))
  400.         {
  401.             GetPlayerName(playerid, pName, sizeof(pName));
  402.             new length = strlen(cmdtext);
  403.             while ((idx < length) && (cmdtext[idx] <= ' '))
  404.             {
  405.                idx++;
  406.           }
  407.             new offset = idx;
  408.             new result[64];
  409.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  410.             {
  411.                 result[idx - offset] = cmdtext[idx];
  412.                 idx++;
  413.             }
  414.             result[idx - offset] = EOS;
  415.             if(!strlen(result))
  416.             {
  417.                 SendClientMessage(playerid, COR_ERRO, "[ERRO] Uso correto: /anm [Texto]");
  418.                 return 1;
  419.             }
  420.             format(string, sizeof(string), "|ATENÇÃO| O Administrador %s, diz: %s", pName, result);
  421.             SendClientMessageToAll(COR_ADM,string);
  422.         }
  423.         else
  424.         {
  425.             SendClientMessage(playerid, COR_ERRO, "[ERRO] Você não é Administrador!");
  426.             return 1;
  427.         }
  428.         return 1;
  429.     }
  430. //-----------------------------------------------------------------------------------------------------------
  431.     if(strcmp(cmd, "/an", true) == 0)
  432.     {
  433.         if(IsPlayerAdmin(playerid))
  434.         {
  435.             GetPlayerName(playerid, pName, sizeof(pName));
  436.             new length = strlen(cmdtext);
  437.             while ((idx < length) && (cmdtext[idx] <= ' '))
  438.             {
  439.                 idx++;
  440.             }
  441.             new offset = idx;
  442.             new result[64];
  443.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  444.             {
  445.                 result[idx - offset] = cmdtext[idx];
  446.                 idx++;
  447.             }
  448.             result[idx - offset] = EOS;
  449.             if(!strlen(result))
  450.             {
  451.                 SendClientMessage(playerid, COR_ERRO, "[ERRO] Uso correto: /an [Texto]");
  452.                 return 1;
  453.             }
  454.             format(string,sizeof(string),"~r~%s",result);
  455.             GameTextForAll(string, 7000, 0);
  456.         }
  457.         else
  458.         {
  459.             SendClientMessage(playerid, COR_ERRO, "[ERRO] Você não é Administrador!");
  460.             return 1;
  461.         }
  462.         return 1;
  463.     }
  464.  
  465.     if(strcmp(cmd, "/an1", true) == 0)
  466.     {
  467.         if(IsPlayerAdmin(playerid))
  468.         {
  469.             GetPlayerName(playerid, pName, sizeof(pName));
  470.             new length = strlen(cmdtext);
  471.             while ((idx < length) && (cmdtext[idx] <= ' '))
  472.             {
  473.                 idx++;
  474.             }
  475.             new offset = idx;
  476.             new result[64];
  477.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  478.             {
  479.                 result[idx - offset] = cmdtext[idx];
  480.                 idx++;
  481.             }
  482.             result[idx - offset] = EOS;
  483.             if(!strlen(result))
  484.             {
  485.                 SendClientMessage(playerid, COR_ERRO, "[ERRO] Uso correto: /an1 [Texto]");
  486.                 return 1;
  487.             }
  488.             GetPlayerName(playerid, pName, sizeof(pName));
  489.             format(string,sizeof(string),"~y~%s ~w~diz: ~g~%s",pName,result);
  490.             GameTextForAll(string, 7000, 0);
  491.         }
  492.         else
  493.         {
  494.             SendClientMessage(playerid, COR_ERRO, "[ERRO] Você não é Administrador!");
  495.             return 1;
  496.         }
  497.         return 1;
  498.     }
  499. //-----------------------------------------------------------------------------------------------------------
  500.     if(strcmp(cmd, "/ann", true) == 0)
  501.     {
  502.         if(IsPlayerAdmin(playerid))
  503.         {
  504.             GetPlayerName(playerid, pName, sizeof(pName));
  505.             new length = strlen(cmdtext);
  506.             while ((idx < length) && (cmdtext[idx] <= ' '))
  507.             {
  508.                 idx++;
  509.             }
  510.             new offset = idx;
  511.             new result[64];
  512.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  513.             {
  514.                 result[idx - offset] = cmdtext[idx];
  515.                 idx++;
  516.             }
  517.             result[idx - offset] = EOS;
  518.             if(!strlen(result))
  519.             {
  520.                 SendClientMessage(playerid, COR_ERRO, "[ERRO] Uso correto: /ann [Texto]");
  521.                 return 1;
  522.             }
  523.             format(string,sizeof(string),"~p~%s",result);
  524.             GameTextForAll(string, 7000, 1);
  525.         }
  526.         else
  527.         {
  528.             SendClientMessage(playerid, COR_ERRO, "[ERRO] Você não é Administrador!");
  529.             return 1;
  530.         }
  531.         return 1;
  532.     }
  533.  
  534.     if(strcmp(cmd, "/ann1", true) == 0)
  535.     {
  536.         if(IsPlayerAdmin(playerid))
  537.         {
  538.             GetPlayerName(playerid, pName, sizeof(pName));
  539.             new length = strlen(cmdtext);
  540.             while ((idx < length) && (cmdtext[idx] <= ' '))
  541.             {
  542.                 idx++;
  543.             }
  544.             new offset = idx;
  545.             new result[64];
  546.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  547.             {
  548.                 result[idx - offset] = cmdtext[idx];
  549.                 idx++;
  550.             }
  551.             result[idx - offset] = EOS;
  552.             if(!strlen(result))
  553.             {
  554.                 SendClientMessage(playerid, COR_ERRO, "[ERRO] Uso correto: /ann1 [Texto]");
  555.                 return 1;
  556.             }
  557.             GetPlayerName(playerid, pName, sizeof(pName));
  558.             format(string,sizeof(string),"~w~%s ~r~diz: ~w~%s",pName,result);
  559.             GameTextForAll(string, 7000, 1);
  560.         }
  561.         else
  562.         {
  563.             SendClientMessage(playerid, COR_ERRO, "[ERRO] Você não é Administrador!");
  564.             return 1;
  565.         }
  566.         return 1;
  567.     }
  568. //-----------------------------------------------------------------------------------------------------------
  569.     if(strcmp(cmd, "/tnn", true) == 0)
  570.     {
  571.         if(IsPlayerAdmin(playerid))
  572.         {
  573.             GetPlayerName(playerid, pName, sizeof(pName));
  574.             new length = strlen(cmdtext);
  575.             while ((idx < length) && (cmdtext[idx] <= ' '))
  576.             {
  577.                 idx++;
  578.             }
  579.             new offset = idx;
  580.             new result[64];
  581.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  582.             {
  583.                 result[idx - offset] = cmdtext[idx];
  584.                 idx++;
  585.             }
  586.             result[idx - offset] = EOS;
  587.             if(!strlen(result))
  588.             {
  589.                 SendClientMessage(playerid, COR_ERRO, "[ERRO] Uso correto: /tnn [Texto]");
  590.                 return 1;
  591.             }
  592.             format(string,sizeof(string),"~g~]~w~ %s ~g~]",result);
  593.             GameTextForAll(string, 7000, 3);
  594.         }
  595.         else
  596.         {
  597.             SendClientMessage(playerid, COR_ERRO, "[ERRO] Você não é Administrador!");
  598.             return 1;
  599.         }
  600.         return 1;
  601.     }
  602.  
  603.     if(strcmp(cmd, "/tnn1", true) == 0)
  604.     {
  605.         if(IsPlayerAdmin(playerid))
  606.         {
  607.             GetPlayerName(playerid, pName, sizeof(pName));
  608.             new length = strlen(cmdtext);
  609.             while ((idx < length) && (cmdtext[idx] <= ' '))
  610.             {
  611.                 idx++;
  612.             }
  613.             new offset = idx;
  614.             new result[64];
  615.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  616.             {
  617.                 result[idx - offset] = cmdtext[idx];
  618.                 idx++;
  619.             }
  620.             result[idx - offset] = EOS;
  621.             if(!strlen(result))
  622.             {
  623.                 SendClientMessage(playerid, COR_ERRO, "[ERRO] Uso correto: /tnn1 [Texto]");
  624.                 return 1;
  625.             }
  626.             GetPlayerName(playerid, pName, sizeof(pName));
  627.             format(string,sizeof(string),"~g~]~r~%s ~w~diz: ~w~%s ~g~]",pName,result);
  628.             GameTextForAll(string, 7000, 3);
  629.         }
  630.         else
  631.         {
  632.             SendClientMessage(playerid, COR_ERRO, "[ERRO] Você não é Administrador!");
  633.             return 1;
  634.         }
  635.         return 1;
  636.     }
  637. //-----------------------------------------------------------------------------------------------------------
  638.     if(strcmp(cmd, "/mn", true) == 0)
  639.     {
  640.         if(IsPlayerAdmin(playerid))
  641.         {
  642.             GetPlayerName(playerid, pName, sizeof(pName));
  643.             new length = strlen(cmdtext);
  644.             while ((idx < length) && (cmdtext[idx] <= ' '))
  645.             {
  646.                 idx++;
  647.             }
  648.             new offset = idx;
  649.             new result[64];
  650.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  651.             {
  652.                 result[idx - offset] = cmdtext[idx];
  653.                 idx++;
  654.             }
  655.             result[idx - offset] = EOS;
  656.             if(!strlen(result))
  657.             {
  658.                 SendClientMessage(playerid, COR_ERRO, "[ERRO] Uso correto: /mn [Texto]");
  659.                 return 1;
  660.             }
  661.             format(string,sizeof(string),"~p~]~y~ %s ~p~]",result);
  662.             GameTextForAll(string, 7000, 4);
  663.         }
  664.         else
  665.         {
  666.             SendClientMessage(playerid, COR_ERRO, "[ERRO] Você não é Administrador!");
  667.             return 1;
  668.         }
  669.         return 1;
  670.     }
  671.  
  672.     if(strcmp(cmd, "/mn1", true) == 0)
  673.     {
  674.         if(IsPlayerAdmin(playerid))
  675.         {
  676.             GetPlayerName(playerid, pName, sizeof(pName));
  677.             new length = strlen(cmdtext);
  678.             while ((idx < length) && (cmdtext[idx] <= ' '))
  679.             {
  680.                 idx++;
  681.             }
  682.             new offset = idx;
  683.             new result[64];
  684.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  685.             {
  686.                 result[idx - offset] = cmdtext[idx];
  687.                 idx++;
  688.             }
  689.             result[idx - offset] = EOS;
  690.             if(!strlen(result))
  691.             {
  692.                 SendClientMessage(playerid, COR_ERRO, "[ERRO] Uso correto: /mn1 [Texto]");
  693.                 return 1;
  694.             }
  695.             GetPlayerName(playerid, pName, sizeof(pName));
  696.             format(string,sizeof(string),"~w~%s ~w~diz: ~r~%s",pName,result);
  697.             GameTextForAll(string, 7000, 4);
  698.         }
  699.         else
  700.         {
  701.             SendClientMessage(playerid, COR_ERRO, "[ERRO] Você não é Administrador!");
  702.             return 1;
  703.         }
  704.         return 1;
  705.     }
  706. //-----------------------------------------------------------------------------------------------------------
  707.     if(strcmp(cmd, "/fn", true) == 0)
  708.     {
  709.         if(IsPlayerAdmin(playerid))
  710.         {
  711.             GetPlayerName(playerid, pName, sizeof(pName));
  712.             new length = strlen(cmdtext);
  713.             while ((idx < length) && (cmdtext[idx] <= ' '))
  714.             {
  715.                 idx++;
  716.             }
  717.             new offset = idx;
  718.             new result[64];
  719.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  720.             {
  721.                 result[idx - offset] = cmdtext[idx];
  722.                 idx++;
  723.             }
  724.             result[idx - offset] = EOS;
  725.             if(!strlen(result))
  726.             {
  727.                 SendClientMessage(playerid, COR_ERRO, "[ERRO] Uso correto: /fn [Texto]");
  728.                 return 1;
  729.             }
  730.             format(string,sizeof(string),"~r~%s",result);
  731.             GameTextForAll(string, 7000, 5);
  732.         }
  733.         else
  734.         {
  735.             SendClientMessage(playerid, COR_ERRO, "[ERRO] Você não é Administrador!");
  736.             return 1;
  737.         }
  738.         return 1;
  739.     }
  740.  
  741.     if(strcmp(cmd, "/fn1", true) == 0)
  742.     {
  743.         if(IsPlayerAdmin(playerid))
  744.         {
  745.             GetPlayerName(playerid, pName, sizeof(pName));
  746.             new length = strlen(cmdtext);
  747.             while ((idx < length) && (cmdtext[idx] <= ' '))
  748.             {
  749.                 idx++;
  750.             }
  751.             new offset = idx;
  752.             new result[64];
  753.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  754.             {
  755.                 result[idx - offset] = cmdtext[idx];
  756.                 idx++;
  757.             }
  758.             result[idx - offset] = EOS;
  759.             if(!strlen(result))
  760.             {
  761.                 SendClientMessage(playerid, COR_ERRO, "[ERRO] Uso correto: /fn1 [Texto]");
  762.                 return 1;
  763.             }
  764.             GetPlayerName(playerid, pName, sizeof(pName));
  765.             format(string,sizeof(string),"~r~%s ~w~diz: ~w~%s",pName,result);
  766.             GameTextForAll(string, 7000, 5);
  767.         }
  768.         else
  769.         {
  770.             SendClientMessage(playerid, COR_ERRO, "[ERRO] Você não é Administrador!");
  771.             return 1;
  772.         }
  773.         return 1;
  774.     }
  775. //-----------------------------------------------------------------------------------------------------------
  776.     if(strcmp(cmd, "/dn", true) == 0)
  777.     {
  778.         if(IsPlayerAdmin(playerid))
  779.         {
  780.             GetPlayerName(playerid, pName, sizeof(pName));
  781.             new length = strlen(cmdtext);
  782.             while ((idx < length) && (cmdtext[idx] <= ' '))
  783.             {
  784.                 idx++;
  785.             }
  786.             new offset = idx;
  787.             new result[64];
  788.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  789.             {
  790.                 result[idx - offset] = cmdtext[idx];
  791.                 idx++;
  792.             }
  793.             result[idx - offset] = EOS;
  794.             if(!strlen(result))
  795.             {
  796.                 SendClientMessage(playerid, COR_ERRO, "[ERRO] Uso correto: /dn [Texto]");
  797.                 return 1;
  798.             }
  799.             format(string,sizeof(string),"~b~%s",result);
  800.             GameTextForAll(string, 7000, 6);
  801.         }
  802.         else
  803.         {
  804.             SendClientMessage(playerid, COR_ERRO, "[ERRO] Você não é Administrador!");
  805.             return 1;
  806.         }
  807.         return 1;
  808.     }
  809.  
  810.     if(strcmp(cmd, "/dn1", true) == 0)
  811.     {
  812.         if(IsPlayerAdmin(playerid))
  813.         {
  814.             GetPlayerName(playerid, pName, sizeof(pName));
  815.             new length = strlen(cmdtext);
  816.             while ((idx < length) && (cmdtext[idx] <= ' '))
  817.             {
  818.                 idx++;
  819.             }
  820.             new offset = idx;
  821.             new result[64];
  822.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  823.             {
  824.                 result[idx - offset] = cmdtext[idx];
  825.                 idx++;
  826.             }
  827.             result[idx - offset] = EOS;
  828.             if(!strlen(result))
  829.             {
  830.                 SendClientMessage(playerid, COR_ERRO, "[ERRO] Uso correto: /dn1 [Texto]");
  831.                 return 1;
  832.             }
  833.             GetPlayerName(playerid, pName, sizeof(pName));
  834.             format(string,sizeof(string),"~b~%s ~w~diz: ~b~%s",pName,result);
  835.             GameTextForAll(string, 7000, 6);
  836.         }
  837.         else
  838.         {
  839.             SendClientMessage(playerid, COR_ERRO, "[ERRO] Você não é Administrador!");
  840.             return 1;
  841.         }
  842.         return 1;
  843.     }
  844.    
  845.     if(strcmp(cmd, "/aTipos", true) == 0)
  846.     {
  847.         SendClientMessage(playerid, COR_ERRO, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  848.         SendClientMessage(playerid, COR_ANS, "» Tipo SendClientMessage: /anm [Texto]");
  849.         SendClientMessage(playerid, COR_ANS, "» Tipo TextDraw 0: /anunciar [Texto] /anunciar1 [Texto]");
  850.         SendClientMessage(playerid, COR_ANS, "» Tipo TextDraw 1: /anunciar [Texto] /anunciar1 [Texto]");
  851.         SendClientMessage(playerid, COR_ANS, "» Tipo TextDraw 2: /anunciar [Texto] /anunciar1 [Texto]");
  852.         SendClientMessage(playerid, COR_ANS, "» Tipo TextDraw 3: /anunciar [Texto] /anunciar1 [Texto]");
  853.         SendClientMessage(playerid, COR_ERRO, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  854.         return 1;
  855.     }
  856.    
  857.     if(strcmp(cmd, "/aTipos1", true) == 0)
  858.     {
  859.         SendClientMessage(playerid, COR_ERRO, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  860.         SendClientMessage(playerid, COR_ANS, "» GameText Tipo 0: /an  [Texto] /an1 [Texto]");
  861.         SendClientMessage(playerid, COR_ANS, "» GameText Tipo 1: /ann  [Texto] /ann1 [Texto]");
  862.         SendClientMessage(playerid, COR_ANS, "» GameText Tipo 3: /tnn  [Texto] /tnn1 [Texto]");
  863.         SendClientMessage(playerid, COR_ANS, "» GameText Tipo 4: /mn  [Texto] /mn1 [Texto]");
  864.         SendClientMessage(playerid, COR_ANS, "» GameText Tipo 5: /fn  [Texto] /fn1 [Texto]");
  865.         SendClientMessage(playerid, COR_ANS, "» GameText Tipo 6: /dn  [Texto] /dn1 [Texto]");
  866.         SendClientMessage(playerid, COR_ERRO, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  867.         return 1;
  868.     }
  869.    
  870.     if(strcmp("/tiposA", cmdtext, true, 10) == 0)
  871.     {
  872.         ShowPlayerDialog(playerid, ANNTIPOS, DIALOG_STYLE_MSGBOX, "~» Tipos de Anúncios","» /anm [texto]\n» /anunciar [texto]  /anunciar1 [Texto]\n» /anun [texto]  /anun1 [texto]\n» /anc [texto]  /anc1 [texto]\n» /aann [texto]  /aann1 [texto]\n» /an  [Texto] /an1 [Texto]\n» /ann  [Texto] /ann1 [Texto]\n» /tnn  [Texto] /tnn1 [Texto]\n» /mn  [Texto] /mn1 [Texto]\n» /fn  [Texto] /fn1 [Texto]\n» /dn  [Texto] /dn1 [Texto]\n» By: [NWD]Jim._.Carrey","Ok","Ok");
  873.         return 1;
  874.     }
  875.     return 0;
  876. }
  877. //-----------------------------------------------------------------------------------------------------------
  878. public OnPlayerRemoveTextDraw()
  879. {
  880.     TextDrawHideForAll(anuncio);
  881.     JaTemAnuncio = false;
  882.     return 1;
  883. }
  884.  
  885. public OnPlayerRemoveTextDraw1()
  886. {
  887.     TextDrawHideForAll(anuncio1);
  888.     JaTemAnuncio = false;
  889.     return 1;
  890. }
  891.  
  892. public OnPlayerRemoveTextDraw2()
  893. {
  894.     TextDrawHideForAll(anuncio2);
  895.     JaTemAnuncio = false;
  896.     return 1;
  897. }
  898.  
  899. public OnPlayerRemoveTextDraw3()
  900. {
  901.     TextDrawHideForAll(anuncio3);
  902.     JaTemAnuncio = false;
  903.     return 1;
  904. }
  905. //-----------------------------------------------------------------------------------------------------------
  906. strtok(const string[], &index)
  907. {
  908.     new length = strlen(string);
  909.     while ((index < length) && (string[index] <= ' '))
  910.     {
  911.         index++;
  912.     }
  913.     new offset = index,result[20];
  914.     while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  915.     {
  916.         result[index - offset] = string[index];
  917.         index++;
  918.     }
  919.     result[index - offset] = EOS;
  920.     return result;
  921. }
  922. //-----------------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement