dcmd_pm(playerid,params[])
{
if(!strlen(params)) return
SendClientMessage(playerid, orange, "Usage: /pm [PlayerID]");
PMplayer1 = strval(params);
if(PMplayer1 == playerid) return
SendClientMessage(playerid, white, "ERROR: {FF0000} You can't send PM to yourself!");
if(!(IsPlayerConnected(PMplayer1) && PMplayer1 != INVALID_PLAYER_ID)) return
SendClientMessage(playerid, white, "ERROR: Player not Connected!");
new string[128];
GetPlayerName(PMplayer1, PmReceiver, sizeof(PmReceiver));
format(string,sizeof(string),"PM To: \"%s(%d)\" \n\nType the message to send:", PmReceiver, PMplayer1);
ShowPlayerDialog(playerid,DIALOG_TYPE_PM,DIALOG_STYLE_INPUT,"PrivateMessage",string,"Send!","Cancel");
return 1;
}
dcmd_pm(playerid,params[])
{
new id, gMessage[128],Message[128],iName[MAX_PLAYER_NAME], pmName[MAX_PLAYER_NAME];
new string[256];
if (sscanf(params, "is",id,gMessage)) return SendClientMessage(playerid, 0x33CCFFAA, "USAGE: /pm <ID> <Message>");
if(!IsPlayerConnected(id)) {
SendClientMessage(playerid,0xFF444499,"/pm : Bad player ID");
return 1;}
if(playerid == id) {
SendClientMessage(playerid,0xFF444499,"You cannot PM yourself");
return 1;}
if(ServerInfo[ReadPMs] == 1 && AccInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) {
new recievername[MAX_PLAYER_NAME];
GetPlayerName(playerid, string, sizeof(string)); GetPlayerName(id, recievername, sizeof(recievername));
format(string, sizeof(string), "***PM From: %s To %s: %s", string, recievername, gMessage);
for (new a = 0; a < MAX_PLAYERS; a++) if ((AccInfo[a][Level] >= ServerInfo[MaxAdminLevel]) && a != playerid)
SendClientMessage(a, grey, string);}
if(AccInfo[playerid][Muted] == 1) {
AccInfo[playerid][MuteWarnings]++;
if(AccInfo[playerid][MuteWarnings] < ServerInfo[MaxMuteWarnings]) {
format(string, sizeof(string),"WARNING: You are muted, if you continue to speak you will be kicked (Warning: %d/%d)", AccInfo[playerid][MuteWarnings], ServerInfo[MaxMuteWarnings] );
SendClientMessage(playerid,0xAA3333AA,string);
} else {
SendClientMessage(playerid,0xAA3333AA,"You have been warned! Now you have been kicked");
GetPlayerName(playerid, string, sizeof(string));
format(string, sizeof(string),"%s [ID %d] Kicked for exceeding mute warnings", string, playerid);
SendClientMessageToAll(grey,string); Kick(playerid);}
return 0;}
GetPlayerName(id,iName,sizeof(iName));
GetPlayerName(playerid,pmName,sizeof(pmName));
format(Message,sizeof(Message),"PM To %s(%d): %s",iName,id,gMessage);
SendClientMessage(playerid,0xFFCC2299,Message);
format(Message,sizeof(Message),"PM From %s(%d): %s",pmName,playerid,gMessage);
SendClientMessage(id,0xFFFF22AA,Message);
PlayerPlaySound(id,1085,0.0,0.0,0.0);
printf("PM: %s",Message);
return 1;
}
dcmd_pm(playerid, params[])
{
new id, msg[148],str[148],str1[148];
if(sscanf(params, "us[81]", id, msg)) return Usage(playerid, "/pm [player] [message]");
if(msg[80]) return SendClientMessage(playerid, COLOR_RED, "Error! Invalid PM Length. Your PM Must Be Between 1-80 Characters.");
if(isnull(msg)) return SendClientMessage(playerid, COLOR_RED, "Error! Invalid PM Length. Your PM Must Be Between 1-80 Characters.");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Invalid Player!");
//if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "You Can Not PM Yourself!");
//uncomment the line above if you want to disable PMing yourself
else
{
format(str,sizeof(str),"PM Sent To %s(%d): %s", pNick(id), id, msg);
format(str1,sizeof(str1),"PM From %s(%d): %s", pNick(playerid), playerid, msg);
SendClientMessage(playerid,COLOR_YELLOW,str);
SendClientMessage(id, COLOR_YELLOW,str1);
SendClientMessage(id, COLOR_BLUE, "Use /r to reply quickly.");
}
return 1;
}
3799 - if(sscanf(params, "us[81]", id, msg)) return Usage(playerid, "/pm [player] [message]");
3801- if(isnull(msg)) return SendClientMessage(playerid, red, "Error! Invalid PM Length. Your PM Must Be Between 1-80 Characters."); 3807- format(str,sizeof(str),"PM Sent To %s(%d): %s", pNick(id), id, msg); |
dcmd_pm(playerid, params[])
{
new id, msg[148],str[148],str1[148];
if(sscanf(params, "us[81]", id, msg)) return SendClientMessage(playerid, 0xFFFFFFFF, "/pm [player] [message]");
if(msg[80]) return SendClientMessage(playerid, 0xFFFFFFFF, "Error! Invalid PM Length. Your PM Must Be Between 1-80 Characters.");
if(!strlen(msg)) return SendClientMessage(playerid, 0xFFFFFFFF, "Error! Invalid PM Length. Your PM Must Be Between 1-80 Characters.");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Invalid Player!");
//if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "You Can Not PM Yourself!");
//uncomment the line above if you want to disable PMing yourself
else
{
new sentname[MAX_PLAYER_NAME], recievedname[MAX_PLAYER_NAME];
GetPlayerName(playerid, sentname, sizeof(sentname));
GetPlayerName(id, recievedname, sizeof(recievedname));
format(str,sizeof(str),"PM Sent To %s(%d): %s", recievedname, id, msg);
format(str1,sizeof(str1),"PM From %s(%d): %s", sentname, playerid, msg);
SendClientMessage(playerid,0xFFFFFFFF,str);
SendClientMessage(id, 0xFFFFFFFF,str1);
}
return 1;
}