PM Problem
#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


Messages In This Thread
PM Problem - by Helpergood - 23.07.2013, 18:17
Re: PM Problem - by doreto - 23.07.2013, 18:20
Re: PM Problem - by Helpergood - 23.07.2013, 18:22

Forum Jump:


Users browsing this thread: 2 Guest(s)