Pages

Ads 468x60px


[FilterScript] Anti /an indevido

Bom, como uma coisa que há muito em servidores RPG/RP é /an indevido onde resulta na punição dos players, resolvi fazer um /anuncio que não vai ter isso mais! 
Como funciona


• Comandos:
-/an ou /anuncio
-/anunciotodos [on/off] (apenas para administradores logado na Rcon)
-/proibiran [ID] (apenas para administradores logado na Rcon)
-/desproibiran [ID] (apenas para administradores logado na Rcon)
-/permitiran [ID] (apenas para administradores logado na Rcon)
-/negarpermissao [ID] (apenas para administradores logado na rcon)


• Sistema:
Funciona assim, o player digita /an ou /anuncio e aparecerá um Dialog com as opções:
-Procura de Org/Gang/Serviço
-Vendas
-Compras
-Outro


Clicando em Procura de Org/Gang/Serviço aparecerá outro Dialog com as seguintes opções:
-Procuro Org
-Procuro Gang
-Procuro Org ou Gang
-Procuro serviço de mecanico
-Procuro detetive.


Clicando em Vendas aparecerá um dialog com as seguintes opções:
-Vendo carro
-Vendo casa
-Vendo drogas
-Vendo armas


Clicando em Compras aparecerá um dialog com as seguintes opções:
-Compro casa
-Compro carro
-Compro armas
-Compro drogas




E a opção Outro? Simples, clicando nesse você pode digitar seu próprio anúncio.
Aí você pergunta: Pra que esse FS então, se eles podem anunciar o que querem do mesmo jeito?
Resposta: Esses anúncios não serão enviados logo em seguida, serão mandados para os administradores para que possam ser "aprovados", se um admin aprovar ele é enviado.


E se for uma data especial, vou ter que permitir o envio para todos players?
Resposta: Não, por isso foi criado o comando /anunciotodos que libera o envio pra todos!


E se tiver algum player que eu não quero que envie?
Resposta: Simples, /proibiran.


Créditos:
Aninhaah (humildadeforever)
Vitor (me ajudou com os testes)




Pastebin: http://pastebin.com/8RXpGrQs
pawn Code:
#include <a_samp> #include <zcmd> #include <sscanf> #define DIALOG_ANUNCIOS 1 #define DIALOG_ANUNCIO_PROCURA 2 #define DIALOG_ANUNCIO_VENDAS 3 #define DIALOG_ANUNCIO_COMPRAS 4 #define DIALOG_PERGUNTAR_ANUNCIO 5 #define DIALOG_OUTRO_ANUNCIO 6 #define DIALOG_ANUNCIO_LIBERADO 7 new bool:PermissaoTodos = false; new bool:Proibido[MAX_PLAYERS] = false; new bool:PermissaoEnviada[MAX_PLAYERS] = false; new Anuncio[MAX_PLAYERS][60]; new giveplayerid; CMD:an(playerid, params[]) {     ShowPlayerDialog(playerid, DIALOG_ANUNCIOS, DIALOG_STYLE_LIST, "[NomeSv] - Anuncios. Selecione uma categoria","Procura de Org/Gang/Serviço\nVendas\nCompras\nOutro","Continuar","Cancelar");     return 1; } CMD:anuncio(playerid, params[]) {     cmd_an(playerid, params);     return 1; } CMD:anunciotodos(playerid, params[]) {     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Você precisa estar logado na rcon para usar o comando.");     new offouon[3];     if(sscanf(params, "s", offouon)) return SendClientMessage(playerid, -1,"Use: /anunciotodos off/on");     if(strcmp(params,"off", true) == 0)     {         if(PermissaoTodos == false) return SendClientMessage(playerid,-1,"Permissão para todos já está off");         PermissaoTodos = false;         new string[75];         format(string,sizeof(string),"{00FFFF}%s {F8F8FF}desativou o OA (Outro anúncio) para todos", PlayerName(playerid));         SendClientMessageToAll(-1,string);         print(string);     }     else if(strcmp(params,"on", true) == 0)     {         if(PermissaoTodos == true) return SendClientMessage(playerid,-1,"Permissão para todos já está On");         PermissaoTodos = true;         new string[75];         format(string,sizeof(string),"{00FFFF}%s{F8F8FF} ativou o OA (Outro anúncio) para todos!", PlayerName(playerid));         SendClientMessageToAll(-1,string);         print(string);     }     else { SendClientMessage(playerid, -1,"Use: /anunciotodos [off/on]"); }     return 1; } CMD:proibiran(playerid, params[]) {     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Voce nao pode usar esse comando.");     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid,-1,"Use: /proibiran [ID]");     if(Proibido[giveplayerid] == true) return SendClientMessage(playerid,-1,"Jogador já está proibido");     Proibido[giveplayerid] = true;     new string[106];     format(string,sizeof(string),"{00FFFF}%s {F8F8FF}proibiu {00FFFF}%s {F8F8FF}de usar a categoria Outro do /an", PlayerName(playerid), PlayerName(giveplayerid));     if(playerid != giveplayerid) return SendClientMessage(playerid,-1,string);//caso o player usa o comando com ele mesmo nao vai mandar 2 vzs a msg     SendClientMessage(giveplayerid,-1,string);     print(string);     return 1; } CMD:desproibiran(playerid, params[]) {     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Voce nao pode usar esse comando.");     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid,-1,"Use: /desproibiran [ID]");     if(Proibido[giveplayerid] == false) return SendClientMessage(playerid,-1,"Jogador não está proibido");     Proibido[giveplayerid] = false;     new string[86];     format(string,sizeof(string),"{00FFFF}%s {F8F8FF}desproibiu {00FFFF}%s {F8F8FF}de usar a categoria Outro do /an", PlayerName(playerid), PlayerName(giveplayerid));     SendClientMessage(playerid,-1,string);     SendClientMessage(giveplayerid,-1,string);     print(string);     return 1; } CMD:permitiran(playerid, params[]) {     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Voce nao pode usar esse comando.");     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid,-1,"Use: /permitiran [ID]");     if(PermissaoEnviada[giveplayerid] == false) return SendClientMessage(playerid,-1,"Nenhuma solicitação de anuncio pendente para esse jogador");     PermissaoEnviada[giveplayerid] = false;     new string[130];     format(string,sizeof(string),"{00FFFF}%s{F8F8FF} permitiu {00FFFF}%s{F8F8FF} enviar seu anuncio.", PlayerName(playerid),PlayerName(giveplayerid));     if(!IsPlayerAdmin(giveplayerid)) return SendClientMessage(giveplayerid,-1,string);//pq se ele for adm vai enviar tambem, ai vai ficar 2 avisos     print(string);     for(new i = 0; i < MAX_PLAYERS; i++)     {         if(IsPlayerAdmin(i)) SendClientMessage(i, -1,string);     }     format(string,sizeof(string),"Anuncio de {00FFFF}%s{F8F8FF}: {00FFFF}%s", PlayerName(giveplayerid), Anuncio[giveplayerid]);     if(!IsPlayerAdmin(giveplayerid)) return SendClientMessage(giveplayerid, -1, string);     print(string);     for(new i = 0; i < MAX_PLAYERS; i++)     {         if(IsPlayerAdmin(i)) SendClientMessage(i, -1,string);     }     format(string,sizeof(string),"{7CFC00}[Anuncio] %s. Contato: {00FF00}%s.", Anuncio[giveplayerid], PlayerName(giveplayerid));     SendClientMessageToAll(-1, string);     GivePlayerMoney(giveplayerid, -100);     GameTextForPlayer(giveplayerid, "~g~R$-100", 1000, 1);     return 1; } CMD:negarpermissao(playerid, params[]) {     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Voce nao pode usar esse comando.");     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid,-1,"Use: /negarpermissao [ID]");     if(PermissaoEnviada[giveplayerid] == false) return SendClientMessage(playerid,-1,"Nenhuma solicitação de anuncio pendente para esse jogador");     PermissaoEnviada[giveplayerid] = false;     new string[140];     format(string,sizeof(string),"%s negou a permissao para %s enviar seu anuncio.", PlayerName(playerid), PlayerName(giveplayerid));     SendClientMessage(giveplayerid,-1,string);     print(string);     for(new i = 0; i < MAX_PLAYERS; i++)     {         if(IsPlayerAdmin(i)) SendClientMessage(i, -1,string);     }     format(string,sizeof(string),"Anuncio de %s: %s", PlayerName(giveplayerid),Anuncio[giveplayerid]);     SendClientMessage(giveplayerid,-1,string);     print(string);     for(new i = 0; i < MAX_PLAYERS; i++)     {         if(IsPlayerAdmin(i)) SendClientMessage(i, -1,string);     }     return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {     if(dialogid == DIALOG_ANUNCIOS)     {         if(!response) return SendClientMessage(playerid,-1,"Você cancelou o envio do anúncio.");         if(listitem == 0)         {             ShowPlayerDialog(playerid, DIALOG_ANUNCIO_PROCURA, DIALOG_STYLE_LIST,"[NomeSv] - Selecione um anúncio","Procuro Org\nProcuro Gang\nProcuro Org ou Gang\nProcuro serviço de mecanico\nProcuro Detetive","Anunciar","Cancelar");         }         else if(listitem == 1)         {             ShowPlayerDialog(playerid, DIALOG_ANUNCIO_VENDAS,DIALOG_STYLE_LIST,"[NomeSv] - Selecione um anúncio","Vendo carro\nVendo casa\nVendo drogas\nVendo armas","Anunciar","Cancelar");         }         else if(listitem == 2)         {             ShowPlayerDialog(playerid, DIALOG_ANUNCIO_COMPRAS, DIALOG_STYLE_LIST,"[NomeSv] - Selecione um anúncio","Compro casa\nCompro carro\nCompro armas\nCompro drogas","Anunciar","Cancelar");         }         else if(listitem == 3)         {             if(PermissaoTodos == true && Proibido[playerid] == false) return ShowPlayerDialog(playerid, DIALOG_ANUNCIO_LIBERADO, DIALOG_STYLE_INPUT,"[NomeSv] - Enviando anuncio","Digite seu anúncio","Enviar","Cancelar");             if(Proibido[playerid] == true) return SendClientMessage(playerid,-1,"Você está proibido de enviar anuncios nessa categoria (Outro)");             if(PermissaoEnviada[playerid] == true) return  SendClientMessage(playerid,-1,"Você já tem uma solicitação de anuncio pendente, espera a decisão dos admins");             else return ShowPlayerDialog(playerid, DIALOG_PERGUNTAR_ANUNCIO,DIALOG_STYLE_MSGBOX,"[NomeSv] - Outro anúncio","Para evitar o anuncio indevido, você pode digitar seu anúncio e esperar que um administrador level 5+ permita o envio","Continuar","Cancelar");         }         return 1;     }     if(dialogid == DIALOG_ANUNCIO_PROCURA)     {         if(response)         {             new antext[30],string[96];             if(listitem == 0)             {                 antext = "Procuro Org";             }             else if(listitem == 1)             {                 antext = "Procuro Gang";             }             else if(listitem == 2)             {                 antext = "Procuro Org ou Gang";             }             else if(listitem == 3)             {                 antext = "Procuro serviço de mecânico";             }             else if(listitem == 4)             {                 antext = "Procuro Detetive";             }             if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid,-1,"Você precisa de R$ 100 para anunciar");             format(string,sizeof(string),"{7CFC00}[Anuncio] %s. Contato: {00FF00}%s.", antext, PlayerName(playerid));             SendClientMessageToAll(-1, string);             GivePlayerMoney(playerid, -100);             GameTextForPlayer(playerid, "~g~R$-100", 1000, 1);         }         else if(!response)         {             SendClientMessage(playerid,-1,"Você cancelou o envio do anúncio");         }         return 1;     }     if(dialogid == DIALOG_ANUNCIO_VENDAS)     {         if(response)         {             new antext[30],string[96];             if(listitem == 0)             {                 antext = "Vendo carro";             }             else if(listitem == 1)             {                 antext = "Vendo casa";             }             else if(listitem == 2)             {                 antext = "Vendo drogas";             }             else if(listitem == 3)             {                 antext = "Vendo armas";             }             if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid,-1,"Você precisa de R$ 100 para anunciar");             format(string,sizeof(string),"{7CFC00}[Anuncio] %s. Contato: {00FF00}%s.", antext, PlayerName(playerid));             SendClientMessageToAll(-1, string);             GivePlayerMoney(playerid, -100);             GameTextForPlayer(playerid, "~g~R$-100", 1000, 1);         }         else if(!response)         {             SendClientMessage(playerid,-1,"Você cancelou o envio do anúncio");         }         return 1;     }     if(dialogid == DIALOG_ANUNCIO_COMPRAS)     {         if(response)         {             new antext[30],string[96];             if(listitem == 0)             {                 antext = "Compro casa";             }             else if(listitem == 1)             {                 antext = "Compro carro";             }             else if(listitem == 2)             {                 antext = "Compro armas";             }             else if(listitem == 3)             {                 antext = "Compro drogas";             }             if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid,-1,"Você precisa de R$ 100 para anunciar");             format(string,sizeof(string),"{7CFC00}[Anuncio] %s. Contato: {00FF00}%s.", antext, PlayerName(playerid));             SendClientMessageToAll(-1, string);             GivePlayerMoney(playerid, -100);             GameTextForPlayer(playerid, "~g~R$-100", 1000, 1);         }         else if(!response)         {             SendClientMessage(playerid,-1,"Você cancelou o envio do anúncio");         }         return 1;     }     if(dialogid == DIALOG_PERGUNTAR_ANUNCIO)     {         if(!response) return SendClientMessage(playerid,-1,"Você cancelou o envio do anúncio");         ShowPlayerDialog(playerid, DIALOG_OUTRO_ANUNCIO, DIALOG_STYLE_INPUT,"[NomeSv] - Enviando anuncio","Digite seu anúncio","Solicitar","Cancelar");         return 1;     }     if(dialogid == DIALOG_ANUNCIO_LIBERADO)     {         if(!response) return SendClientMessage(playerid, -1, "Você cancelou o envio do anuncio");         if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_ANUNCIO_LIBERADO, DIALOG_STYLE_INPUT,"[NomeSv] - Enviar anuncio","Digite o anuncio","Enviar","Cancelar");         if(strlen(inputtext) > 60) return ShowPlayerDialog(playerid, DIALOG_ANUNCIO_LIBERADO, DIALOG_STYLE_INPUT,"[NomeSv] - Enviar anuncio","Simplifique seu anuncio (até 60 caracteres)","Enviar","Cancelar");         if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid,-1,"Você precisa de R$ 100 para anunciar");         new string[110];         format(string,sizeof(string),"{7CFC00}[Anuncio] %s. Contato: {00FF00}%s.", inputtext, PlayerName(playerid));         SendClientMessageToAll(-1, string);         GivePlayerMoney(playerid, -100);         GameTextForPlayer(playerid, "~g~R$-100", 1000, 1);         return 1;     }     if(dialogid == DIALOG_OUTRO_ANUNCIO)     {         if(!response) return SendClientMessage(playerid,0x00FF3DFF,"Você cancelou o envio do anuncio");         if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_OUTRO_ANUNCIO, DIALOG_STYLE_INPUT,"[NomeSv] - Enviar anuncio","Digite o anuncio","Enviar","Cancelar");         if(strlen(inputtext) > 60) return ShowPlayerDialog(playerid, DIALOG_OUTRO_ANUNCIO, DIALOG_STYLE_INPUT,"[NomeSv] - Enviar anuncio","Simplifique seu anuncio (até 60 caracteres)","Enviar","Cancelar");         if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid,0x00FF3DFF,"Você precisa de R$ 100 para anunciar");         //NSA = Nova Solicitação de Anuncio         new string[100];         format(string,sizeof(string),"[NSA]Nome:{00FFFF}%s{F8F8FF}.Anuncio:{00FFFF}%s",PlayerName(playerid), inputtext);         if(!IsPlayerAdmin(playerid))         {             SendClientMessage(playerid,0xFFFF00FF,"|================== Nova Solicitação de Anuncio ================|");             SendClientMessage(playerid,-1,string);             SendClientMessage(playerid,0xFFFF00FF,"|===============================================================|");         }         new count = 0;         for(new i = 0; i < MAX_PLAYERS; i++)         {             if(IsPlayerAdmin(i))             {                 SendClientMessage(i,0xFFFF00FF,"|================== Nova Solicitação de Anuncio ================|");                 SendClientMessage(i,-1,string);                 SendClientMessage(i,0xFFFF00FF,"|===============================================================|");                 SendClientMessage(i, -1,"Use: /permitiran [ID]");                 count ++;             }         }         if(count == 0) return SendClientMessage(playerid, 0x00FF3DFF," Não há nenhum administrador online :/ Seu anuncio não ficará pendente");         else if(count >= 1)         {             PermissaoEnviada[playerid] = true;             new an[60];             strcat(an,inputtext);             Anuncio[playerid] = an;             return 1;         }         return 1;     }     return 1; } stock PlayerName(playerid) {     new Name[MAX_PLAYERS];     GetPlayerName(playerid, Name, sizeof(Name));     return Name; }




Imagens:
http://imageshack.us/photo/my-images/32/samp002fl.png
http://imageshack.us/photo/my-images/526/samp003erw.png
http://imageshack.us/photo/my-images/856/samp004vv.png
http://imageshack.us/photo/my-images/651/samp006lc.png
http://imageshack.us/photo/my-images/801/samp007cg.png
http://imageshack.us/photo/my-images/38/samp008bz.png
http://imageshack.us/photo/my-images/802/samp009fw.png
http://imageshack.us/photo/my-images/24/samp010jv.png
http://imageshack.us/photo/my-images/842/samp011ht.png
http://imageshack.us/photo/my-images/7/samp012xs.png
http://imageshack.us/photo/my-images/841/samp013dtc.png