Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:wisper(playerid, params[])
- {
- if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
- if(IsPlayerConnected(playerid))
- {
- new string[128],id,mess[250],giveplayer[25],sendername[25];
- if(PlayerInfo[playerid][pLevel] < 2) return SendClientMessage(playerid, COLOR_WHITE,"{FFB870}You must be level 2 to use /w(isper).");
- if(PlayerInfo[playerid][pMuted] == 1)
- {
- format(string, sizeof(string), "You can not speak, you have been silenced for %d seconds.",PlayerInfo[playerid][pMuteTime]);
- SendClientMessage(playerid, COLOR_LIGHTRED, string);
- return 1;
- }
- if(sscanf(params, "us[250]",id,mess)) return SCM(playerid, COLOR_WHITE, "{B8DBFF}Synthax: /w <Name/Playerid> <Message>");
- if (IsPlayerConnected(id))
- {
- if(id != INVALID_PLAYER_ID)
- {
- if(GetDistanceBetweenPlayers(playerid,id) > 5) return SCM(playerid,COLOR_WHITE,"{FFFFCC}This player is not near you.");
- if(Spectate[id] != 255) return SCM(playerid,COLOR_WHITE,"{FFFFCC}This player is not near you.");
- if(HidePM[id] > 0) return SendClientMessage(playerid, COLOR_WHITE,"{FFB870}This player doesn't allow whispers.");
- if(id == playerid) return SendClientMessage(playerid, COLOR_WHITE,"{FFB870}You can not send a message to yourself.");
- GetPlayerName(playerid, sendername, sizeof(sendername));
- GetPlayerName(id, giveplayer, sizeof(giveplayer));
- format(string, sizeof(string), "%s whispers: %s", sendername, mess);
- SendClientMessage(id, COLOR_YELLOW, string);
- format(string, sizeof(string), "Whisper to %s: %s", giveplayer, mess);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- if(stringContainsIP(mess))
- {
- format(string, sizeof(string), "{f03337}Warning: %s(%d) typed %s.", sendername,playerid,mess);
- ABroadCast(COLOR_WHITE,string,1);
- }
- for(new d = 1; d < sizeof(Filter); d++)
- {
- if(strfind(mess,Filter[d],true) != -1 )
- {
- format(string, sizeof(string), "{f03337}Warning: %s(%d) typed %s.", sendername,playerid,mess);
- ABroadCast(COLOR_WHITE,string,1);
- }
- }
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: Player not connected.");
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement