Thanks for the input!
A few questions about it though:
Does get_pcvar do the same thing as get_cvar? If not, what is the difference?
I see these g_* variables used in plugins, but cannot find anything about them, is there a place that has a list of them or what they do? I've tried to google and search the
documentation
I have 2 problems that I cannot find the solution to:
1st:
Setting players teams (puts them on ct first, then selects random T) sometimes makes it where if 1 certain player dies (usually the CT), it says something like "Counter-Terrorist Win!" (Correct me if I am wrong on this, but if you switch a players team when they're alive, they keep some property of their previous team (assumption I am making, based on no known facts)). So if that is true, I think they were spawned as a T before the plugin set them onto CT (and since mp_limitteams is set to whatever dr_tnum is, they could have been the only T spawned). How could I prevent this from happening? Is there a function that will set users teams before they a spawned for the coming round?
2nd: I haven't been able to test this with more than a few people, but whenever theres a low number of people (4-5), sometimes no player gets selected as T and everyone stays on CT (until the new round comes). Is there an error in the logic in my script somewhere? I don't see anything wrong from my noob-ish view.
My hopeful solution to problem number 2:
PHP Code:
for (new i = -1; i < num_ts; ++i) {
randnum = random_num(1,team_ct)
if (picked != randnum) { // If not picked already
cs_set_user_team(random_num(1,team_ct), CS_TEAM_T, get_model(random_num(0,3)))
picked = randnum
} else { // If picked, decrease i and start again
i--
}
}
I made i start at -1 and increase before the for statement. I think that when the plugin would find a new player for T, it would select one twice, and i-- would decrease it too low before i++ increased the first time.
Hope I don't annoy you with all of these questions, I really appreciate your help!