Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- FilterScript Sistema de Private Message(PM)
- Direito autoriais: WeenSoares
- Contato: weensoares@live.com
- */
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- new bool:LerPms[MAX_PLAYERS];
- new bool:PmBlock[MAX_PLAYERS];
- new string[128];
- new playername[MAX_PLAYER_NAME];
- new giveplayername[MAX_PLAYER_NAME];
- new giveplayerid;
- new texto;
- //==============================/*FILTERSCRIPTINIT*/==============================//
- public OnFilterScriptInit()
- {
- print("•\n");
- print("******************************************************");
- print("* [FilterScript] Sistema de Private Message(PM) *\n");
- print("* Carregando... *\n\n");
- print("* Carregado 100%. *");
- print("******************************************************");
- print("•\n");
- return 1;
- }
- //==============================/*ONPLAYERCONNECT*/==============================//
- public OnPlayerConnect(playerid)
- {
- LerPms[playerid] = false;
- PmBlock[playerid] = false;
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- return 1;
- }
- //==============================/*INICIO DOS COMANDOS*/==============================//
- CMD:pm(playerid, params[])
- {
- if(sscanf(params, "us", giveplayerid, texto))
- {
- SendClientMessage(playerid, 0x33AA33AA, "Uso correto: /pm [id do player] [menssagem]");
- }
- else
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsPlayerConnected(giveplayerid))
- {
- GetPlayerName(playerid, playername, sizeof(playername));
- GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
- if(PmBlock[playerid])
- {
- format(string,sizeof(string),"[Private Message]: Você não pode enviar uma menssagem pois a sua PM está bloqueada!");
- SendClientMessage(playerid, 0xFF80808B, string);
- return 1;
- }
- if(PmBlock[giveplayerid])
- {
- format(string,sizeof(string),"[Private Message]: Você não pode enviar uma menssagem para %s pois ele está com o PM Bloqueado!", giveplayername);
- SendClientMessage(playerid, 0xFF80808B, string);
- return 1;
- }
- format(string,sizeof(string),">> Enviada para: %s (%d): %s", giveplayername, giveplayerid, texto);
- SendClientMessage(playerid,0xFFD500FF,string);
- format(string,sizeof(string),"** Recebida de: %s (%d): %s", playername, playerid, texto);
- GameTextForPlayer(giveplayerid, "~w~MENSAGEM ~r~RECEBIDA", 3000, 1);
- SendClientMessage(giveplayerid,0xFF80808B,string);
- PlayerPlaySound(giveplayerid, 1085, 0.0, 0.0, 0.0);
- printf("[Private Message]: %s envio para %s: %s", playername, giveplayername, texto);
- for(new i; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerAdmin(playerid) && LerPms[i] == true)
- {
- format(string, sizeof(string), "** %s envio para %s: %s", playername, giveplayername, texto);
- SendClientMessage(i, 0xFF80808B, string);
- }
- }
- }
- else
- {
- format(string, sizeof(string), "* O ID %d não está online.", giveplayerid);
- SendClientMessage(playerid, 0x00FFFFAA, string);
- }
- }
- else
- {
- SendClientMessage(playerid, 0x00FFFFAA, "Você tem que está logado para usar este comando!");
- }
- }
- return 1;
- }
- CMD:bpm(playerid)
- {
- if(!PmBlock[playerid])
- {
- SendClientMessage(playerid, 0xFF80808B, "[Private Message]: Private Message bloqueada!");
- PmBlock[playerid] = true;
- }
- else
- {
- SendClientMessage(playerid, 0xFF80808B, "[Private Message]: Private Message já bloqueada!");
- return 1;
- }
- return 1;
- }
- CMD:lpm(playerid)
- {
- if(IsPlayerConnected(playerid))
- {
- if(PmBlock[playerid])
- {
- SendClientMessage(playerid, 0xFF80808B, "[Private Message]: Private Message liberada!");
- PmBlock[playerid] = false;
- }
- else
- {
- SendClientMessage(playerid, 0xFF80808B,"[Private Message]: Private Message já liberada!");
- }
- }
- return 1;
- }
- CMD:lerpms(playerid)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsPlayerAdmin(playerid))
- {
- if(!LerPms[playerid])
- {
- SendClientMessage(playerid, 0xFF80808B, "AdmCMD: Você está lendo as [Private Message].");
- LerPms[playerid] = true;
- }
- else
- {
- SendClientMessage(playerid, 0xFF80808B, "AdmCMD: Você parou de ler as [Private Message].");
- LerPms[playerid] = false;
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, 0x00FFFFAA, "Você não tem permissão para usar este comando!");
- }
- }
- else
- {
- SendClientMessage(playerid, 0x00FFFFAA, "Você tem que está logado para usar este comando!");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement