Hi,
some maps on our server aren't providing enough spawn-points. I need only those CT ones (info_player_start)
Following code is a part of plugin_init( ), but it's not working. It creates all necessary spawns, according to what it prints to server console, but they're not at least functional.
Code:
new entid = -1
while ((entid = find_ent_by_class(entid, "info_player_start")) != 0) spawn_point_count++
server_print("[%s] Found %d CT spawn points.", PLUGIN_NAME, spawn_point_count)
new n = (get_maxplayers() - spawn_point_count)
if (n > 0)
{
server_print("[%s] Need %d more spawn points. Creating.", PLUGIN_NAME, n)
for (new i = 0; i < n; i++)
{
if ((entid = create_entity("info_player_start")) > 0)
{
spawn_point_count++
entity_set_origin(entid, spaw_point_origin)
}
}
}
else server_print("[%s] No new spawn points are needed.", PLUGIN_NAME)
Can you please help and tell me what's wrong? Ty.