diff --git a/src/zr/cvars.inc b/src/zr/cvars.inc index 7916593..1a0ad65 100644 --- a/src/zr/cvars.inc +++ b/src/zr/cvars.inc @@ -214,10 +214,10 @@ CvarsInit() // Create public cvar for tracking. decl String:description[64]; Format(description, sizeof(description), "%s Current version of this plugin", TRANSLATION_PHRASE_PREFIX); - CreateConVar("gs_zombiereloaded_version", VERSION, description, FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_UNLOGGED|FCVAR_DONTRECORD|FCVAR_REPLICATED|FCVAR_NOTIFY); + CreateConVar("gs_zombiereloaded_version", VERSION, description, FCVAR_SPONLY|FCVAR_UNLOGGED|FCVAR_DONTRECORD|FCVAR_REPLICATED|FCVAR_NOTIFY); #if defined ADD_VERSION_INFO - CreateConVar("zombiereloaded_revision", ZR_VER_REVISION, "Revision number for this plugin in source code repository.", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_UNLOGGED|FCVAR_DONTRECORD|FCVAR_REPLICATED|FCVAR_NOTIFY); + CreateConVar("zombiereloaded_revision", ZR_VER_REVISION, "Revision number for this plugin in source code repository.", FCVAR_SPONLY|FCVAR_UNLOGGED|FCVAR_DONTRECORD|FCVAR_REPLICATED|FCVAR_NOTIFY); #endif // Forward event to modules. diff --git a/src/zr/ztele/ztele.inc b/src/zr/ztele/ztele.inc index bbda996..2fbaf51 100644 --- a/src/zr/ztele/ztele.inc +++ b/src/zr/ztele/ztele.inc @@ -85,18 +85,18 @@ void ZTeleOnRoundStart() continue; } - if (g_iZTeleSpawnPointsCount >= MAX_PLAYER_SPAWNS) - { - break; - } - - GetEdictClassname(i, classname, sizeof(classname)); + GetEntityClassname(i, classname, sizeof(classname)); if (StrEqual(classname, "info_player_terrorist", true) || StrEqual(classname, "info_player_counterterrorist", true)) { GetEntPropVector(i, Prop_Send, "m_vecOrigin", g_vecZTeleSpawnPoints[g_iZTeleSpawnPointsCount]); g_iZTeleSpawnPointsCount++; + + if (g_iZTeleSpawnPointsCount >= MAX_PLAYER_SPAWNS) + { + break; + } } } } @@ -250,7 +250,7 @@ bool ZTeleClient(int client, bool force = false) void ZTele_TeleportClient(int client) { // Teleport client. - if (ZTele_IsRandomSpawnEnabled()) + if (ZTele_IsRandomSpawnEnabled() && g_iZTeleSpawnPointsCount) { int select = Math_GetRandomInt(0, g_iZTeleSpawnPointsCount - 1); TeleportEntity(client, g_vecZTeleSpawnPoints[select], NULL_VECTOR, view_as({0.0, 0.0, 0.0}));