AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Only one Terrorist (https://forums.alliedmods.net/showthread.php?t=61989)

Sputnik53 10-15-2007 17:56

Only one Terrorist
 
When there is one terrorist on the terrorist team, don't allow anyone to join it. When there are no terrorist in the team, allow someone to join it.

I've tried stuff but the've all been dead-ends. :(

alien 10-15-2007 21:34

Re: Only one Terrorist
 
Quote:

Originally Posted by Sputnik53 (Post 542515)
When there is one terrorist on the terrorist team, don't allow anyone to join it. When there are no terrorist in the team, allow someone to join it.

Have you tried to remove all info_player_deathmatch entities except one? I'm not sure whether this could work ... it was just an idea I got as I finished reading your post.

Sputnik53 10-16-2007 07:28

Re: Only one Terrorist
 
Quote:

Originally Posted by alien (Post 542582)
Have you tried to remove all info_player_deathmatch entities except one? I'm not sure whether this could work ... it was just an idea I got as I finished reading your post.

I guess it would work for Condition Zero, but not 1.6 (at least what I remember from mapping).

ConnorMcLeod 10-16-2007 08:30

Re: Only one Terrorist
 
1.6 maps work for condition zero.

Did you try something with humans_join_team ?
Set it to "CT" when there's a T, else set it to "ANY"
May not work...:oops:

Sputnik53 10-16-2007 10:15

Re: Only one Terrorist
 
Quote:

Originally Posted by connorr (Post 542687)
1.6 maps work for condition zero.

True true but in 1.6, I think, you can still have more than x players in a team even though there are only x spawn points.

alien 10-16-2007 11:21

Re: Only one Terrorist
 
Well AFAIK you can't.

Sputnik53 10-16-2007 14:59

Re: Only one Terrorist
 
No way it's gotta be possible. At least it sounds very simple comparing to some people doing other plugins with much more powerful functions.

Sputnik53 10-21-2007 12:55

Re: Only one Terrorist
 
What is wrong with this code? It doesn't do anything. :S
Code:
register_event("TeamInfo","event_team_info","a")
Code:
public event_team_info() {     new id = read_data(1)     new model     new smodel     new team[12]     read_data(2,team,sizeof team-1)     new players[32], iT_num     get_players(players, iT_num, "e", "TERRORIST")     switch(team[0]) {         case 'T' : {             if(iT_num > 1) {                 if(equali(mod_name,"cstrike")) {                     model = random_num(1,4)                 } else {                     model = random_num(1,5)                 }                 if(model == 1) smodel = 1 //CS_CT_URBAN                 if(model == 2) smodel = 5 //CS_CT_GSG9                 if(model == 3) smodel = 6 //CS_CT_GIGN                 if(model == 4) smodel = 7 //CS_CT_SAS                 if(model == 5) smodel = 11 //CZ_CT_SPETSNAZ                 cs_set_user_team(id,CS_TEAM_CT,smodel)             }             }         case 'C' : {             if(iT_num == 0) {                 cs_set_user_team(id,CS_TEAM_T,CS_T_LEET)             }         }     }     return PLUGIN_HANDLED }

alien 10-21-2007 21:32

Re: Only one Terrorist
 
I've come across a problem and recalled this topic.
Have you really tried to remove those entities? And if you did, what size of class_name array did you use? This is working to prevent terrorists from joining:

Code:
remove_terrorist_spawns()     {         new             entity_limit = get_global_int(GL_maxEntities);             entity_n = entity_count(),             class_name[32]; // DO NOT use 16 chars here as some people do!                 for (new EID = get_maxplayers() + 1; EID <= _entity_limit; EID++)             {                 if (is_valid_ent(EID))                     {                         entity_get_string(EID, EV_SZ_classname, class_name, sizeof(class_name) - 1);                         if (!strcmp(class_name, "info_player_deathmatch")) remove_entity(EID);                     }             }         return;     }

I saw someone using 16 bytes for class_name array ... changed all my arrays to size 16 thinking of sparing some little space. After that, it took me hour to figure out what's wrong as people were able to join terrorists. Then I thought that you might have been right ... but ... try it if you still didn't find your solution. It works for me.

Sputnik53 10-23-2007 14:40

Re: Only one Terrorist
 
Quote:

Originally Posted by alien (Post 544902)
I've come across a problem and recalled this topic.
Have you really tried to remove those entities? And if you did, what size of class_name array did you use? This is working to prevent terrorists from joining:
*code*
I saw someone using 16 bytes for class_name array ... changed all my arrays to size 16 thinking of sparing some little space. After that, it took me hour to figure out what's wrong as people were able to join terrorists. Then I thought that you might have been right ... but ... try it if you still didn't find your solution. It works for me.

Hmm but doesn't that remove all the spawn points? I want only 1 terrorist being able to join.


All times are GMT -4. The time now is 01:19.

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