Admins PM
#3

If you are talking about reading live /pm messaging on the forum, you won't find any FS for that (except an admin script that includes /pm).
Most people send PMs with SendClientMessage or SendPlayerMessageToPlayer.. There is no way to detect whether such a message is being sent, therefore no secondary script (FS) could provide such a feature..
The solution to this is to create a player variable like
pawn Код:
new readpm[MAX_PLAYERS;
which is set to 0 when connecting (or disconnecting)
Then you would run a loop when a player uses the /pm command.

Let's say you used SendClientMessage to send the PM. Then you would have some variable (let's call it "string") that stores the text... E.G.
pawn Код:
format(string, sizeof(string), "PM by %s to %s: %s", name1, name2, msgtext);
SendClientMessage(pid, 0x999999AA, string);
You would add the loop behind of this. The loop would run through all players and detect whether the player is online and reading pms (readpm[playerid] == 1) (and optional whether the player is an admin)
something like this:
pawn Код:
for(new i=0; i<GetMaxPlayers(); i++)
{
    if(IsPlayerConnected(i))
    {
        if(readpm[i] == 1)
        {
            SendClientMessage(i, 0x999999AA, string);
        }
    }
}

a player would (in this version) have to use a command to enable reading, which would be done inside of the command with
pawn Код:
readpm[playerid] = 1;
Reply


Messages In This Thread
Admins PM - by Thoma - 09.02.2015, 19:13
Re: Admins PM - by HazardouS - 09.02.2015, 19:21
Re: Admins PM - by Sascha - 09.02.2015, 19:29
Re: Admins PM - by Thoma - 09.02.2015, 19:32
Re: Admins PM - by Sascha - 09.02.2015, 19:37
Re: Admins PM - by CalvinC - 10.02.2015, 04:57

Forum Jump:


Users browsing this thread: 1 Guest(s)