Advertisement
Guest User

Untitled

a guest
Oct 1st, 2014
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.27 KB | None | 0 0
  1. CMD:wisper(playerid, params[])
  2. {
  3.     if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
  4.     if(IsPlayerConnected(playerid))
  5.     {
  6.         new string[128],id,mess[250],giveplayer[25],sendername[25];
  7.         if(PlayerInfo[playerid][pLevel] < 2) return SendClientMessage(playerid, COLOR_WHITE,"{FFB870}You must be level 2 to use /w(isper).");
  8.         if(PlayerInfo[playerid][pMuted] == 1)
  9.         {
  10.             format(string, sizeof(string), "You can not speak, you have been silenced for %d seconds.",PlayerInfo[playerid][pMuteTime]);
  11.             SendClientMessage(playerid, COLOR_LIGHTRED, string);
  12.             return 1;
  13.         }
  14.         if(sscanf(params, "us[250]",id,mess)) return SCM(playerid, COLOR_WHITE, "{B8DBFF}Synthax: /w <Name/Playerid> <Message>");
  15.         if (IsPlayerConnected(id))
  16.         {
  17.             if(id != INVALID_PLAYER_ID)
  18.             {
  19.                 if(GetDistanceBetweenPlayers(playerid,id) > 5) return SCM(playerid,COLOR_WHITE,"{FFFFCC}This player is not near you.");
  20.                 if(Spectate[id] != 255) return SCM(playerid,COLOR_WHITE,"{FFFFCC}This player is not near you.");
  21.                 if(HidePM[id] > 0) return SendClientMessage(playerid, COLOR_WHITE,"{FFB870}This player doesn't allow whispers.");
  22.                 if(id == playerid) return SendClientMessage(playerid, COLOR_WHITE,"{FFB870}You can not send a message to yourself.");
  23.                 GetPlayerName(playerid, sendername, sizeof(sendername));
  24.                 GetPlayerName(id, giveplayer, sizeof(giveplayer));
  25.                 format(string, sizeof(string), "%s whispers: %s", sendername, mess);
  26.                 SendClientMessage(id, COLOR_YELLOW, string);
  27.                 format(string, sizeof(string), "Whisper to %s: %s", giveplayer, mess);
  28.                 SendClientMessage(playerid,  COLOR_YELLOW, string);
  29.                 if(stringContainsIP(mess))
  30.                 {
  31.                     format(string, sizeof(string), "{f03337}Warning: %s(%d) typed %s.", sendername,playerid,mess);
  32.                     ABroadCast(COLOR_WHITE,string,1);
  33.                 }
  34.                 for(new d = 1; d < sizeof(Filter); d++)
  35.                 {
  36.                     if(strfind(mess,Filter[d],true) != -1 )
  37.                     {
  38.                         format(string, sizeof(string), "{f03337}Warning: %s(%d) typed %s.", sendername,playerid,mess);
  39.                         ABroadCast(COLOR_WHITE,string,1);
  40.                     }
  41.                 }
  42.                 return 1;
  43.             }
  44.         }
  45.         else
  46.         {
  47.             SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: Player not connected.");
  48.         }
  49.     }
  50.     return 1;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement