PM Problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: PM Problem (
/showthread.php?tid=453071)
PM Problem -
Helpergood - 23.07.2013
Hey , I need help again ..
How can I make myself see the pm that players do in the rcon console?
I will give you the coding of my PM ..
Thanks for any help
pawn Код:
//First of all , I am using dcmd for cmds , found it is better.
dcmd_pm(playerid, params[])
{
new pID, text[128], string[128];
if(sscanf(params, "us", pID, text)) return SendClientMessage(playerid, COLOR_RED, "USAGE: {EBD730}/PM (Nick/ID) (message) - {FF0000}You must enter a valid Nick / ID");
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "Player is not connected.");
if(pID == playerid) return SendClientMessage(playerid, COLOR_RED, "You cannot PM yourself.");
format(string, sizeof(string), "{EBD730}%s (%d) {FF0000}is not accepting private messages at the moment.", PlayerName(pID), pID);
if(pInfo[pID][NoPM] == 1) return SendClientMessage(playerid, COLOR_RED, string);
format(string, sizeof(string), "PM to {EBD730}%s{FF0000}: {EBD730}%s", PlayerName(pID), text);
SendClientMessage(playerid, COLOR_RED, string);
format(string, sizeof(string), "PM from {EBD730}%s{FF0000}: {EBD730}%s", PlayerName(playerid), text);
SendClientMessage(pID, COLOR_RED, string);
pInfo[pID][Last] = playerid;
return 1;
}
//Thats the code. Hope you help.
Re: PM Problem -
doreto - 23.07.2013
Print or
Printf
pawn Код:
dcmd_pm(playerid, params[])
{
new pID, text[128], string[128];
if(sscanf(params, "us", pID, text)) return SendClientMessage(playerid, COLOR_RED, "USAGE: {EBD730}/PM (Nick/ID) (message) - {FF0000}You must enter a valid Nick / ID");
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "Player is not connected.");
if(pID == playerid) return SendClientMessage(playerid, COLOR_RED, "You cannot PM yourself.");
format(string, sizeof(string), "{EBD730}%s (%d) {FF0000}is not accepting private messages at the moment.", PlayerName(pID), pID);
if(pInfo[pID][NoPM] == 1) return SendClientMessage(playerid, COLOR_RED, string);
format(string, sizeof(string), "PM to {EBD730}%s{FF0000}: {EBD730}%s", PlayerName(pID), text);
SendClientMessage(playerid, COLOR_RED, string);
format(string, sizeof(string), "PM from {EBD730}%s{FF0000}: {EBD730}%s", PlayerName(playerid), text);
SendClientMessage(pID, COLOR_RED, string);
printf("%s pm %s: %s",PlayerName(playerid),PlayerName(pID),text); // will print in server console "doreto pm Helpergood: hello"
pInfo[pID][Last] = playerid;
return 1;
}
Re: PM Problem -
Helpergood - 23.07.2013
I am not so pro..
So I hope you do it for me..If you would, I will be so much thankful.
EDIT: Didn't know you were already doing it!
Thanks very much!!
2nd EDIT: Removed the D from the : so it doesn't make

XD