AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Too few CT spawnpoints (https://forums.alliedmods.net/showthread.php?t=22928)

alien 01-07-2006 01:20

Too few CT spawnpoints
 
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.

Des12 01-07-2006 01:43

Re: Too few CT spawnpoints
 
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) new entspawn[33] if (n > 0)   {     server_print("[%s] Need %d more spawn points. Creating.", PLUGIN_NAME, n)     for (new i = 0; i < n; i++)       {             entspawn[i] = create_entity("info_player_start")             spawn_point_count++             entity_set_origin(entspawn[i], spawn_point_origin)                 }   } else server_print("[%s] No new spawn points are needed.", PLUGIN_NAME)

Fixed up abit...but how are you going to rotate the spawn_point_origin's? I added a 'n' btw to the end of that.

v3x 01-07-2006 02:20

Re: Too few CT spawnpoints
 
Quote:

Originally Posted by Des12
Fixed up abit...but how are you going to rotate the spawn_point_origin's? I added a 'n' btw to the end of that.

Code:
entity_set_int(ent, EV_INT_fixangle, 1); entity_set_vector(ent, EV_VEC_v_angle, Float:angle[3]);
Or something, bla..

http://www.amxmodx.org/funcwiki.php?...d=333#comments

alien 01-07-2006 14:02

Well, it's not working anyway. I read somewhere on these forums, that it's not possible because of caching map entities during map load. I should check Deathmatch source and figure out somehow.

Hawk552 01-07-2006 14:04

You could use Stripper2 to add some in.


All times are GMT -4. The time now is 16:07.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.