Quote:
Originally Posted by quasemago
First, use PHP tag in code.
Second, use ServerCommand.
PHP Code:
public void OnClientPutInServer(int client) { if (GetClientCount() >= GetConVarInt(g_cvar_PlayerLimit)) { PrintToChatAll("Es sind mehr als %d Spieler online, Map ist jetzt offen... map is open now", GetConVarInt(g_cvar_PlayerLimit)); ServerCommand("exec dod_donner_og/dod_donner_og_open.cfg"); } }
public void OnClientDisconnect_Post(int client) { if (GetClientCount() < GetConVarInt(g_cvar_PlayerLimit)) { PrintToChatAll("Es sind weniger als 12 Spieler online... ONLY GARDEN!"); ServerCommand("exec dod_donner_og/dod_donner_og_close.cfg"); } }
|
Message can be printed and config can be executed multiple times in a row with your code, if 12th player joins <EXECUTE> then 13th player joins <Execute> etc...
PHP Code:
public void OnClientPutInServer(int client)
{
if (GetClientCount() == GetConVarInt(g_cvar_PlayerLimit))
{
PrintToChatAll("Es sind mehr als %d Spieler online, Map ist jetzt offen... map is open now", GetConVarInt(g_cvar_PlayerLimit));
ServerCommand("exec dod_donner_og/dod_donner_og_open.cfg");
}
}
public void OnClientDisconnect_Post(int client)
{
if (GetClientCount() + 1 ==GetConVarInt(g_cvar_PlayerLimit))
{
PrintToChatAll("Es sind weniger als 12 Spieler online... ONLY GARDEN!");
ServerCommand("exec dod_donner_og/dod_donner_og_close.cfg");
}
}