26.07.2009, 20:26
Dont save in loop xD
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) { format(string, sizeof(string),"**PM %s to %s: %s", playername, recievername, text); SendClientMessage(a, 0x7E60FFAA, string); } } return 1; }
Код:
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; }