Skip to content

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

Description

@ashsrv

Описание проблемы на 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;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions