Advertisement
GHLEMES

Sistema de Anuncio

Jul 9th, 2014
547
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.11 KB | None | 0 0
  1. //Simples sistema de anuncio By: GHLEMES
  2. //Includes
  3. #include <a_samp>
  4. //**********************************
  5. //defines
  6. #define ANUNCIAR 1000
  7. #define ana 1001
  8. #define anp 1002
  9. //**********************************
  10. //Public's
  11. public OnFilterScriptInit()
  12. {
  13.     print("\n----------------------------------------");
  14.     print("--Sistema de anuncio simples By: GHLEMES--");
  15.     print("----------------------------------------\n");
  16.     return 1;
  17. }
  18.  
  19. public OnFilterScriptExit()
  20. {
  21.     return 1;
  22. }
  23. //Comando
  24. public OnPlayerCommandText(playerid, cmdtext[])
  25. {
  26.     if (strcmp("/anunciar", cmdtext, true, 10) == 0)
  27.     {
  28.         ShowPlayerDialog(playerid, ANUNCIAR, DIALOG_STYLE_LIST, "Escolha um Tipo de anuncio:", "Anuncio Player\nAnuncio Admin", "OK", "Fechar");
  29.         return 1;
  30.     }
  31.     return 0;
  32. }
  33.  
  34. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  35. {
  36.     if(dialogid == ANUNCIAR)
  37.     {
  38.         if(response)
  39.         {
  40.             if(listitem == 0)
  41.             {
  42.                 ShowPlayerDialog(playerid,anp,DIALOG_STYLE_INPUT,"Anuncio Player","{FFFFFF}Digite o Texto Abaixo:","Anunciar","Cancelar");
  43.             }
  44.             else if(listitem == 1)
  45.             {
  46.                 if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "{FF0000}[Erro] Você não é um Admin");
  47.                 ShowPlayerDialog(playerid,ana,DIALOG_STYLE_INPUT,"Anuncio Admin","{FFFFFF}Digite o Texto Abaixo:","Anunciar","Cancelar");
  48.             }
  49.         }
  50.     }
  51.     if(dialogid == anp)
  52.     {
  53.         if(response)
  54.         {
  55.             new gh[128], gn[24];
  56.             GetPlayerName(playerid, gn, sizeof(gn));
  57.             format(gh, sizeof(gh), "{0062FF}[Anuncio Player] » {FFFFFF}%s(ID:%d) {999999}Anuncia: {FFFFFF}%s",gn,playerid,inputtext[0]);
  58.             SendClientMessageToAll(-1, gh);
  59.         }
  60.     }
  61.     if(dialogid == ana)
  62.     {
  63.         if(response)
  64.         {
  65.             new agh[128], agn[24];
  66.             GetPlayerName(playerid, agn, sizeof(agn));
  67.             format(agh, sizeof(agh), "{FF0000}[Anuncio Admin] » {FFFFFF}%s(ID:%d) {00FF00}Anuncia: %s",agn,playerid,inputtext[0]);
  68.             SendClientMessageToAll(-1, agh);
  69.         }
  70.     }
  71.     return 1;
  72. }
  73. //**********************
  74.  
  75. /* Sistema de anuncio simples desenvolvido por GHLEMES em: 09/07/2014 postado em: forum.sa-mp.com
  76. Peço para não retirar os Créditos
  77. Obrigado!!!
  78. GHLEMES
  79. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement