PM Problem
#1

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.
Reply
#2

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;
}
Reply
#3

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)