07.06.2013, 16:10
help me commands /pm
CMD:pm(playerid, params[])
{
new str[128], str2[128], id, adminstr[128];
if(sscanf(params,"ds[128]", id, str2)) return SendClientMessage(playerid, red,"USAGE: /pm [id] [message]");
if(IsPlayerConnected(id))
{
if(id != playerid)
{
format(str, sizeof(str),"PM to [%d]%s: %s", id, PlayerName2(id), str2);
SendClientMessage(playerid, yellow, str);
format(str, sizeof(str),"PM from [%d]%s: %s", playerid, PlayerName2(playerid), str2);
SendClientMessage(id, yellow, str);
SendClientMessage(id, -1,"Use "cblue"/rpm [message] "cwhite"to reply to this PM");
format(adminstr, sizeof(adminstr),"PM from %s[%d] to %s[%d]: %s", PlayerName2(playerid), playerid, PlayerName2(id), id, str2);
MessageTo4(grey, adminstr);
LastPm[id] = playerid;
}
else return SendClientMessage(playerid, red,"You cannot PM yourself");
}
else return SendClientMessage(playerid, red,"Player is not connected");
return 1;
}