09.07.2011, 16:23
I've made it using zcmd and sscanf:
pawn Код:
CMD:pm(playerid, params[])
{
new PID, pName[MAX_PLAYER_NAME];
if(sscanf(params, "us[128]", PID, params)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /pm [playerid] [message]");
if(!IsPlayerConnected(PID)) return SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");
new Str[128];
GetPlayerName(PID, pName, sizeof(pName));
format(Str, sizeof(Str), "Admin says: %s", Sender, params);
SendClientMessage(PID, COLOR_WHITE, Str);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
}
return 1;
}