Looking for DCMD PM Command
#4

pawn Код:
#define dcmd(%1,%2,%3) if((strcmp((%3)[1], #%1, true, (%2)) == 0)&&((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2])))))return 1

public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(pm, 2, cmdtext);
    return 0;
}

dcmd_pm(playerid, params[])
{
   new id, pName[MAX_PLAYER_NAME], pName2[MAX_PLAYER_NAME], str[128], msg[100];
   if(sscanf(params, "us[100]", id, msg)) return SendClientMessage(playerid, -1, "USAGE: /pm [id] [msg]");
   GetPlayerName(playerid, pName, sizeof(pName));
   GetPlayerName(id, pName2, sizeof(pName2));
   format(str, sizeof(str), "PM Sent to %s(%d): %s", pName2, id, msg);
   SendClientMessage(playerid, -1, str);
   format(str, sizeof(str), "PM From %s(%d): %s", pName, playerid, msg);
   SendClientMessage(id, -1, str);
   return 1;
}
Reply


Messages In This Thread
Looking for DCMD PM Command - by Shockey HD - 19.07.2011, 20:53
Re: Looking for DCMD PM Command - by [WSF]ThA_Devil - 20.07.2011, 13:47
Re: Looking for DCMD PM Command - by Aira - 27.05.2012, 10:12
Re: Looking for DCMD PM Command - by JaKe Elite - 27.05.2012, 10:14

Forum Jump:


Users browsing this thread: 1 Guest(s)