09.02.2015, 19:13
Is there any command or link anyone can point me to enable my admins to be able to read the PMs sent by users? I have searched and only found an FS for rcon but i dont need that
new readpm[MAX_PLAYERS;
format(string, sizeof(string), "PM by %s to %s: %s", name1, name2, msgtext);
SendClientMessage(pid, 0x999999AA, string);
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(readpm[i] == 1)
{
SendClientMessage(i, 0x999999AA, string);
}
}
}
readpm[playerid] = 1;
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 Код:
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 Код:
something like this: pawn Код:
a player would (in this version) have to use a command to enable reading, which would be done inside of the command with pawn Код:
|
new string[128]; // Defines the string we are gonna use
for(new i = 0; i < MAX_PLAYERS; i++) // Loops through all players and defines them as "i"
{
if(IsPlayerConnected && IsPlayerAdmin(i)) // If "i" is an RCON admin and is connected it sends the message below
{
format(string, sizeof(string), "(PM) %s > %s: %s"); // Formats the string
SendClientMessage(i, -1, string); // Sends the string message to the admin
}
}