Skip to content

CSGO: Client language may not be choosen correctly. #122

Open
@gotgameio

Description

@gotgameio

Описание проблемы на alliedmods:
https://forums.alliedmods.net/showpost.php?p=2211771&postcount=9

Если использовать GetClientLanguage() в OnClientPutInServer() без таймера, иногда это происходит в одном иногда в разных тиках по этому если язык сервера "ru" а язык клиента "en" GetClientLanguage() возвращает язык сервера а не клиента. В общем загрузку данных клиента нужно обернуть в таймер тогда все работает и язык клиента всегда определяется верно.

Clients.sp:

public void OnClientPutInServer(int iClient)
{
	//	g_iClientInfo[iClient] = 0;
	DBG_Clients("OnClientPutInServer %N (%d): %b", iClient, iClient, g_iClientInfo[iClient])
	
	if(!IsFakeClient(iClient) && !IsClientSourceTV(iClient))
	{
		// Clients_CheckVipAccess(iClient, true, true);
		CreateTimer(1.0, Timer_OnClientPutInServer, GetClientSerial(iClient), TIMER_FLAG_NO_MAPCHANGE);
	}
}

public Action Timer_OnClientPutInServer(Handle timer, any serial)
{
	int iClient = GetClientFromSerial(serial);
	if (iClient) 
	{
		Clients_CheckVipAccess(iClient, true, true);
	}

	return Plugin_Stop;
}

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions