Код:
CMD:pm(playerid, params[])
{
new str[128], str2[128], id;
if(sscanf(params,"ds[128]", id, str2)) return SendClientMessage(playerid, red,"USAGE: /pm [id] [message]");
if(IsPlayerConnected(id))
{
if(id != playerid)
{
if(DND[id] == 0)
{
if(notREPLY[id] == 0)
{
format(str, sizeof(str),"PM to %s[%d]: %s", PlayerName2(id), id, str2);
SendClientMessage(playerid, yellow, str);
format(str, sizeof(str),"PM from %s[%d]: %s", PlayerName2(playerid), playerid, str2);
SendClientMessage(id, yellow, str);
SendClientMessage(id, -1,"Use /reply [message] to reply to this PM, If you want to block incoming PM's use /dnd");
PlayerPlaySound(id,1057,0.0,0.0,0.0);
LastPm[id] = playerid;
notREPLY[id] = 1;
}
else if(notREPLY[playerid] == 1)
{
format(str, sizeof(str),"PM to %s[%d]: %s", PlayerName2(id), id, str2);
SendClientMessage(playerid, yellow, str);
format(str, sizeof(str),"PM from %s[%d]: %s", PlayerName2(playerid), playerid, str2);
SendClientMessage(id, yellow, str);
PlayerPlaySound(id,1057,0.0,0.0,0.0);
LastPm[id] = playerid;
}
else return SendClientMessage(playerid, red,"That player is in do not disturb mode!");
}
else return SendClientMessage(playerid, red,"You cannot PM yourself");
}
else return SendClientMessage(playerid, red,"Player is not connected");
}
return 1;
}
so I've made a message that says "Use /reply [message] to reply to this PM, If you want to block incoming PM's use /dnd" on their first pm recieve. then the second one, they wont receive it, but it says their in Do not disturb mode, how do i fix it? Thanks
Код:
CMD:dnd(playerid, params[])
{
if(DND[playerid] == 0)
{
DND[playerid] = 1;
SendClientMessage(playerid, red,"DND has been enabled.");
}
else if(DND[playerid] == 1)
{
DND[playerid] = 0;
SendClientMessage(playerid, red,"DND has been Disabled.");
}
return 1;
}