Raised This Month: $ Target: $400
 0% 

problem with team checking/setting


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shino
Senior Member
Join Date: May 2006
Old 05-21-2006 , 09:49   problem with team checking/setting
Reply With Quote #1

so, i made this code:

Code:
public round_start() {     set_task(0.4,"SetZombieBotCheck") } public SetZombieBotCheck(players[]) {     new players[32],num,i     get_players(players,num)     for(i = 0; i <= num; i++) {         new id = players[i]         if (is_user_connected(id) && is_user_alive(id)) {             if (cs_get_user_team(id) == CS_TEAM_T) {                 cs_set_user_team(id,CS_TEAM_CT)             }         }         if (is_user_bot(id) && is_user_alive(id)) {             if (cs_get_user_team(id) == CS_TEAM_CT) {                 cs_set_user_team(id,CS_TEAM_T)                 set_cvar_num("sv_restartround", 1)             }         }     } }

in play, if i join CT team and one bot is with me and one at T team, bot in CT team doesn't get thrown to Ts. if i go to T team, i don't get thrown to CTs. so i think that it might be a problem in code, and if someone could help me.

thanks!
shino is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-21-2006 , 11:13  
Reply With Quote #2

Try this:

Code:
public round_start() {     set_task(0.4,"SetZombieBotCheck") } public SetZombieBotCheck(players[]) {     new players[32],num,i     get_players(players,num)     for(i = 0; i <= num; i++) {         new id = players[i]         if (is_user_alive(id) && !is_user_bot(id)) {             if (cs_get_user_team(id) == CS_TEAM_T) {                 cs_set_user_team(id,CS_TEAM_CT)             }         }         if (is_user_bot(id) && is_user_alive(id)) {             if (cs_get_user_team(id) == CS_TEAM_CT) {                 cs_set_user_team(id,CS_TEAM_T)                 set_cvar_num("sv_restartround", 1)             }         }     } }
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-21-2006 , 12:09  
Reply With Quote #3

Code:
public round_start() {     set_task(0.4,"SetZombieBotCheck") } public SetZombieBotCheck(/* players[] */) {     new players[32],num,i     get_players(players,num)     new CsTeams:team; // <-     for(i = 0; i <= num; i++) {         new id = players[i]         if (is_user_alive(id) && !is_user_bot(id)) {             team = cs_get_user_team(id); // <-             if (team == CS_TEAM_T) {                 cs_set_user_team(id,CS_TEAM_CT)             }         }         if (is_user_bot(id) && is_user_alive(id)) {             if (team == CS_TEAM_CT) {                 cs_set_user_team(id,CS_TEAM_T)                 set_cvar_num("sv_restartround", 1)             }         }     } }
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
shino
Senior Member
Join Date: May 2006
Old 05-21-2006 , 15:27  
Reply With Quote #4

none of these work

since i'm quite new to plugin writing, i don't know if your codes would make an effect i like:
i like to separate bots from real players, so bots would be terrorists and real players counter-terrorists. i apologise if your codes give this effect.
shino is offline
shino
Senior Member
Join Date: May 2006
Old 05-21-2006 , 15:45  
Reply With Quote #5

don't mind any more, fixed it
shino is offline
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 16:24.


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