Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.08 KB | None | 0 0
  1. stock MensagemLongaPTodos(color,const string[])  //função
  2. {
  3.     new string1[256], string2[256], string3[256];
  4.     if(strlen(string) > 90) //String maior que 90
  5.     {
  6.         format(string1, sizeof(string1), string);
  7.         format(string2, sizeof(string2), string);
  8.         strdel(string1, 90, 256);
  9.         strdel(string2, 0, 90);
  10.         format(string3, sizeof(string3), "%s ...", string1);
  11.         SendClientMessageToAll(color, string3);
  12.         format(string3, sizeof(string3), "... %s", string2); //Máximo de 30 caracteres depois
  13.         SendClientMessageToAll(color, string3);  //envia a mensagem
  14.         return true;
  15.     }
  16.     else
  17.     {
  18.         SendClientMessageToAll(color, string);  //Caso não tenha mais de 30 caracteres
  19.         return true;
  20.     }
  21. }
  22.  
  23.  
  24. ---------------------------------------------------------------------
  25. if(strcmp(cmd, "/anuncio", true) == 0 || strcmp(cmd, "/an", true) == 0)          //by RicardBRasil@JJUUSSSTTIIN
  26.     {
  27.         if(IsPlayerConnected(playerid))
  28.         {
  29.             if(GetPlayerMoney(playerid) < 400)
  30.             {
  31.                 SendClientMessage(playerid, COLOR_GREY, "Você não tem 800$");
  32.                 return 1;
  33.             }
  34.             if(gPlayerLogged[playerid] == 0)
  35.             {
  36.                 SendClientMessage(playerid, COLOR_GREY, "** Você precisa estar logado !");
  37.                 return 1;
  38.             }
  39.             if(PlayerInfo[playerid][pLevel] < 2)
  40.             {
  41.                 SendClientMessage(playerid, COLOR_GREY, "   Você precisa ser Level 2+ para usar este comando !");
  42.                 return 1;
  43.             }
  44.             if(PlayerInfo[playerid][pMuted] == 1)
  45.             {
  46.                 SendClientMessage(playerid, TEAM_CYAN_COLOR, "Você não pode anunciar , você está silenciado");
  47.                 return 1;
  48.             }
  49.             new length = strlen(cmdtext);
  50.             while ((idx < length) && (cmdtext[idx] <= ' '))
  51.             {
  52.                 idx++;
  53.             }
  54.             new offset = idx;
  55.             new result[128];
  56.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  57.             {
  58.                 result[idx - offset] = cmdtext[idx];
  59.                 idx++;
  60.             }
  61.             result[idx - offset] = EOS;
  62.             if(!strlen(result))
  63.             {
  64.                 SendClientMessage(playerid, COLOR_GRAD2, "USE: (/an)uncio [anuncio text]");
  65.                 return 1;
  66.             }
  67.             if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
  68.             {
  69.                 format(string, sizeof(string), "** Aguarde %d segundos para mandar outro anúncio!",  (addtimer/1000));
  70.                 SendClientMessage(playerid, COLOR_GRAD2, string);
  71.                 return 1;
  72.             }
  73.             if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
  74.             SafeGivePlayerMoney(playerid, -400);
  75.             format(string, sizeof(string), "{CCFFDD}[SN]{9ACD32} %s", result);
  76.             MensagemLongaPTodos(COLOR_LIGHTGREEN, string);
  77.             format(string, sizeof(string), "[AN] %s",sendername, result);
  78.             ABroadCast(COLOR_LIGHTGREEN,string, 4);
  79.             SBizzInfo[7][sbTill] += 200;
  80.             GameTextForPlayer(playerid, "~w~Anuncio enviado:~g~$50", 4321,1);
  81.             OnPlayerUpdateEx(playerid);
  82.             new y,m,d;
  83.             new h,mi,s;
  84.             getdate(y,m,d);
  85.             gettime(h,mi,s);
  86.             format(string, sizeof(string), "[%d/%d/%d](%d:%d:%d) %s (Anunciando): %s",d,m,y,h,mi,s, sendername, result);
  87.             ChatLog(string);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement