Raised This Month: $ Target: $400
 0% 

Only one Terrorist


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sputnik53
Senior Member
Join Date: Jun 2005
Old 10-15-2007 , 17:56   Only one Terrorist
Reply With Quote #1

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.

Last edited by Sputnik53; 10-15-2007 at 19:03.
Sputnik53 is offline
alien
Senior Member
Join Date: Aug 2005
Location: London || Slovakia
Old 10-15-2007 , 21:34   Re: Only one Terrorist
Reply With Quote #2

Quote:
Originally Posted by Sputnik53 View Post
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.
__________________
alien is offline
Send a message via ICQ to alien
Sputnik53
Senior Member
Join Date: Jun 2005
Old 10-16-2007 , 07:28   Re: Only one Terrorist
Reply With Quote #3

Quote:
Originally Posted by alien View Post
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).
Sputnik53 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-16-2007 , 08:30   Re: Only one Terrorist
Reply With Quote #4

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...
ConnorMcLeod is offline
Sputnik53
Senior Member
Join Date: Jun 2005
Old 10-16-2007 , 10:15   Re: Only one Terrorist
Reply With Quote #5

Quote:
Originally Posted by connorr View Post
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.
Sputnik53 is offline
alien
Senior Member
Join Date: Aug 2005
Location: London || Slovakia
Old 10-16-2007 , 11:21   Re: Only one Terrorist
Reply With Quote #6

Well AFAIK you can't.
__________________
alien is offline
Send a message via ICQ to alien
Old 10-21-2007, 12:45
Sputnik53
This message has been deleted by Sputnik53. Reason: Wasn't working properly
Sputnik53
Senior Member
Join Date: Jun 2005
Old 10-21-2007 , 12:55   Re: Only one Terrorist
Reply With Quote #8

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 }
Sputnik53 is offline
alien
Senior Member
Join Date: Aug 2005
Location: London || Slovakia
Old 10-21-2007 , 21:32   Re: Only one Terrorist
Reply With Quote #9

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.
__________________
alien is offline
Send a message via ICQ to alien
Sputnik53
Senior Member
Join Date: Jun 2005
Old 10-23-2007 , 14:40   Re: Only one Terrorist
Reply With Quote #10

Quote:
Originally Posted by alien View Post
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.
Sputnik53 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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