26.07.2009, 19:49
I have a script to rcon admins see the pms, but i want make a log for these pms...
I have this, but doesnt work.. Dont save pms.
Where is the problem?
pawn Код:
public OnPlayerPrivmsg(playerid, recieverid, text[])
{
new string[256], File:pms=fopen("pms.txt", io_append);
new playername[MAX_PLAYER_NAME];
new recievername[MAX_PLAYER_NAME];
GetPlayerName(recieverid, recievername, sizeof(recievername));
GetPlayerName(playerid, playername, sizeof(playername));
for (new a = 0; a < MAX_PLAYERS; a++)
{
if (IsPlayerConnected(a) && IsPlayerAdmin(a) && a != playerid && a != recieverid)
{
format(string, sizeof(string),"**PM %s to %s: %s ", playername, recievername, text);
SendClientMessage(a, 0x7E60FFAA, string);
fwrite(pms, string);
fclose(pms);
}
}
return 1;
}
Where is the problem?