Closed shanapu closed 8 years ago
Im not so familar with old syntax.
how about this?
if (GetConVarInt(gH_Cvar_Add_ServerTag) == 1)
{
new Handle:hTags = FindConVar("sv_tags");
decl String:sTags[128];
GetConVarString(hTags, sTags, sizeof(sTags));
if (StrContains(sTags, SERVERTAG, false) == -1)
{
decl String:sTagsFormat[128];
Format(sTagsFormat, sizeof(sTagsFormat), ", %s", SERVERTAG);
StrCat(sTags, sizeof(sTags), sTagsFormat);
SetConVarString(hTags, sTags);
}
}
This looks good now. I will add a CloseHandle for hTags to be safe.
old way overwrite sv_tags setted by user in .cfg and set hosties tag instead. new way will check for hosties tag, if not found it will be added to the sv_tags set by player. no lost of tags
all credits for this code to Headline22 https://github.com/Headline22/Hunger-Games-Beacon/