Admin read PM(s)
#1

Hello,

I'm trying to create that admin can read PM(s) but I didn't know to create it.

Regards,
ShadyX
Reply
#2

Show your /pm code. You have to loop all players and search for an admins

Код:
CMD:pm(playerid, params[])
{
	//code

	for(new adminid; adminid != MAX_PLAYERS; adminid++)
	{
		if(!IsPlayerConnected(adminid) || !IsPlayerAdmin(adminid)) continue;

		SendClientMessage(adminid, -1, message);
	}
	return 1;
}
Reply
#3

I believe there are two ways you can do this.

1: Create your own PM script and get the a SendClientMessage to your admins with the contents
2: I believe (don't quote me on this) there is a callback that takes PMs, you can also implement something in there.
Reply
#4

Here is my PM Code
pawn Код:
dcmd_pm(playerid,params[])
{
    new string[128];
    new ID;
    new cmdreason[100];
    if(sscanf(params, "us[100]", ID, cmdreason))
    {
        SendClientMessage(playerid,COLOR_ERROR,"USAGE: /pm (Player Name/ID) (Message)");
        return 1;
    }
    if(IsMuted[playerid] == 1)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You are muted. You can't use this command!");
        return 1;
    }
    if(udb_Exists(PlayerName(playerid)) && !PLAYERLIST_authed[playerid])
    {
        SendClientMessage(playerid,COLOR_ERROR,"You must login before you can talk");
        return 1;
    }
    if(!IsPlayerConnected(ID))
    {
        format(string, sizeof(string), "The Player ID (%d) is not connected to the server.",ID);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    format(string, sizeof(string), "PM Sent to: %s(%d): %s",PlayerName(ID),ID,cmdreason);
    SendClientMessage(playerid,COLOR_YELLOW,string);
   
    format(string, sizeof(string), "PM From: %s(%d) %s",PlayerName(playerid),playerid,cmdreason);
    SendClientMessage(ID,COLOR_YELLOW,string);
   
    format(string, sizeof(string), "3[PM] From %s(%d) to %s(%d): %s",PlayerName(playerid),playerid,PlayerName(ID),ID,cmdreason); // [0] <jacob> hi
    IRC_GroupSay(gGroupAdminID,IRC_ADMINCHANNEL,string);
   
    SpamStrings[playerid] ++;
    PlayerPlaySound(ID,1085,0.0,0.0,0.0);
    return 1;
}
Reply
#5

Show us your admin chat command.
Reply
#6

make a stock that sends message to admins then in cmd put that

pawn Код:
dcmd_pm(playerid,params[])
{
    new string[128];
    new ID;
    new cmdreason[100];
    if(sscanf(params, "us[100]", ID, cmdreason))
    {
        SendClientMessage(playerid,COLOR_ERROR,"USAGE: /pm (Player Name/ID) (Message)");
        return 1;
    }
    if(IsMuted[playerid] == 1)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You are muted. You can't use this command!");
        return 1;
    }
    if(udb_Exists(PlayerName(playerid)) && !PLAYERLIST_authed[playerid])
    {
        SendClientMessage(playerid,COLOR_ERROR,"You must login before you can talk");
        return 1;
    }
    if(!IsPlayerConnected(ID))
    {
        format(string, sizeof(string), "The Player ID (%d) is not connected to the server.",ID);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    format(string, sizeof(string), "PM Sent to: %s(%d): %s",PlayerName(ID),ID,cmdreason);
    SendClientMessage(playerid,COLOR_YELLOW,string);
   
    format(string, sizeof(string), "PM From: %s(%d) %s",PlayerName(playerid),playerid,cmdreason);
    SendClientMessage(ID,COLOR_YELLOW,string);
   
    format(string, sizeof(string), "3[PM] From %s(%d) to %s(%d): %s",PlayerName(playerid),playerid,PlayerName(ID),ID,cmdreason); // [0] <jacob> hi
    IRC_GroupSay(gGroupAdminID,IRC_ADMINCHANNEL,string);

    format(string, sizeof(string), "[PM] From %s(%d) to %s(%d): %s",PlayerName(playerid),playerid,PlayerName(ID),ID,cmdreason);
    SendMessageToAdmins(COLOR_YELLOW, string);

    SpamStrings[playerid] ++;
    PlayerPlaySound(ID,1085,0.0,0.0,0.0);
    return 1;
}

stock SendMessageToAdmins(color, message[]) // to send message to online admins
{
   for(new i = 0; i < MAX_PLAYERS; i++)
   {
      if (IsPlayerConnected(i))
      {
         if (pInfo[i][Admin] >= 3)// put your enum here
            SendClientMessage(i, color, message);
      }
   }
   return 1;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)