PM log doesnt work
#2

Dont save in loop xD
Код:
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));
	format(string, sizeof(string),"**PM %s to %s: %s", playername, recievername, text);
	fwrite(pms, string);
	fclose(pms);
	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);
		}
	}
	return 1;
}
or

Код:
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));
	format(string, sizeof(string),"**PM %s to %s: %s", playername, recievername, text);
	fwrite(pms, string);
	fclose(pms);
	for(new a = 0; a < MAX_PLAYERS; a++)
	{
		if (IsPlayerConnected(a) && IsPlayerAdmin(a) && a != playerid && a != recieverid)
		{
			SendClientMessage(a, 0x7E60FFAA, string);
		}
	}
	return 1;
}
Reply


Messages In This Thread
PM log doesnt work - by jonybomb - 26.07.2009, 19:49
Re: PM log doesnt work - by Jefff - 26.07.2009, 20:26
Re: PM log doesnt work - by jonybomb - 26.07.2009, 20:35

Forum Jump:


Users browsing this thread: 1 Guest(s)