09.02.2015, 19:29
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
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.
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:
a player would (in this version) have to use a command to enable reading, which would be done inside of the command with
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;
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);
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;