Raised This Month: $ Target: $400
 0% 

In CT team can be 4 players.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 12-22-2008 , 10:08   In CT team can be 4 players.
Reply With Quote #1

What the code in CT team can be max 4 players no more!
__________________
xbatista is offline
Send a message via Skype™ to xbatista
hzqst
Senior Member
Join Date: Jul 2008
Old 12-22-2008 , 10:48   Re: In CT team can be 4 players.
Reply With Quote #2

hook team info and check if there are 4 players in CT
if it returns true ,let him join Ts

Quote:

public message_teaminfo(msg_id, msg_dest){
if (msg_dest != MSG_ALL && msg_dest != MSG_BROADCAST) return;
new id = get_msg_arg_int(1)
static team[2]
get_msg_arg_string(2, team, sizeof team - 1)
if(team[0] == 'U' || team[0] == 'S') return;
new cts = ckrun_get_ct_num()
if(cts >= 4){
cs_set_user_team(id, CS_TEAM_T, CS_DONTCHANGE)
set_msg_arg_string(2, "TERRORIST")
}
Quote:
stock ckrun_get_ct_num(){
new num = 0 , i
for (i = 1; i <= g_maxplayers; i++){
if (is_user_connected(i) && get_user_team(i) == 2)
num ++
}
return num
}
and register this message in plugin_init:

Quote:
register_message(get_user_msgid("TeamInfo"), "message_teaminfo")
It's Left 4 Dead??...

Last edited by hzqst; 12-22-2008 at 10:50.
hzqst is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 12-22-2008 , 10:52   Re: In CT team can be 4 players.
Reply With Quote #3


Thx will try.
YEP l4d mod.
Error:Something bad with return(shows a lot of errors.) in stock or in message_teaminfo.
Bad returns.



P.S. message_teaminfo should return a value.


EDIT: OMG you just missed up "}" ^^
__________________

Last edited by xbatista; 12-22-2008 at 11:09.
xbatista is offline
Send a message via Skype™ to xbatista
Reply


Thread Tools
Display Modes

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 09:15.


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