Help command /newb
#2

Код:
CMD:anewb(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] < 1)
	{
		SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
		return 1;
	}

        new pID, text[256], string[256];
        if(sscanf(params, "us[256]", pID, text)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /anewb (Playerid) (answer) - 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), "%s (%d) 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 %s: %s", PlayerName(pID), text);
        SendClientMessage(playerid, COLOR_YELLOW, string);
        format(string, sizeof(string), "PM from %s: %s", PlayerName(playerid), text);
        SendClientMessage(pID, COLOR_YELLOW, string);
        pInfo[pID][Last] = playerid;
        for (new i = 0; i < MAX_PLAYERS; i++)
        if (IsPlayerAdmin(i))
        {
         format(string, sizeof(string), "PM: %s(%d) to %s(%d): %s", PlayerName(playerid), playerid,     PlayerName(pID), pID, text);
   {
         if (IsPlayerAdmin(i))
         SendClientMessage(i, COLOR_GREY, string);
                }
        }
        return 1;
}
Reply


Messages In This Thread
Help command /newb - by Ghost110 - 27.01.2015, 22:09
Respuesta: Help command /newb - by Trevor Gin - 27.01.2015, 22:18
Re: Help command /newb - by chsulaj - 11.03.2015, 00:35

Forum Jump:


Users browsing this thread: 1 Guest(s)