That should do it:
PHP Code:
public Action:Event_RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
{
// create local string that we will add all survivors info to!
new String:survivornames[512]
// format the string so the hintmessage has the desired headline
Format(survivornames, sizeof(survivornames), "Winners of the Medal of Honour:\n")
// now we go through all players
for(new i = 1; i < GetMaxClients(); i++)
{
// we're only looking for connected and alive players
if(IsClientInGame(i) && IsPlayerAlive(i))
{
// we're only looking for U.S. Army
if(GetClientTeam(i) == ALLIES)
{
//we found an allied player that's alive on roundend!
// create strings for name and steamid
decl String:pl_steamid[32], String:pl_username[MAX_NAME_LENGTH]
// get player's name
GetClientName(i, pl_username, sizeof(pl_username))
// get player's steamid
GetClientAuthString(i, pl_steamid, sizeof(pl_steamid))
// create local string for survivor info
decl String:SurvivorInfo[64]
// merge playername and steamid into one string
Format(SurvivorInfo, sizeof(SurvivorInfo), "\n%s (%s)", pl_username, pl_steamid)
// add info of this player to the string:
StrCat(survivornames, sizeof(survivornames), SurvivorInfo)
}
}
}
// display the hintmessage with all info we collected
SendPanelToAll(survivornames)
return Plugin_Continue
// adds a line to a txt file called roundend.txt in addons/sourcemod/medals folder
new Handle:file = OpenFile("roundend.txt", "/addons/sourcemod/medals")
if(file != INVALID_HANDLE)
{
WriteFileLine(file,survivornames)
CloseHandle(file)
}
}
but nothing is written ...