AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   In CT team can be 4 players. (https://forums.alliedmods.net/showthread.php?t=82384)

xbatista 12-22-2008 10:08

In CT team can be 4 players.
 
What the code in CT team can be max 4 players no more! :)

hzqst 12-22-2008 10:48

Re: In CT team can be 4 players.
 
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??...

xbatista 12-22-2008 10:52

Re: In CT team can be 4 players.
 
:crab: :crab: :crab:
Thx will try.
YEP l4d mod. :D
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 "}" ^^


All times are GMT -4. The time now is 09:15.

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