@grimsight you should check which team a player can join when they join the server. Make 2 player slots (slot_player_can_join_team_0 and slot_player_can_join_team_1). When the player joins the server, send the GUID (and also the local id/player no) and 'run' the php file.
When you receive a message in game_receive_url_response (you should receive the player GUID, the local id/player no and also which team it can join (two values (0 or 1 for first team, 0 or 1 for second team) or a single value which can have 4 possible values (0 - can't join any teams; 1 - can join team 0; 2 - can join team 1; 3 - can join both teams))); check if the player no is active, get it's GUID and check if it is the same as the one you received and then set the player's slots accordingly. Then, all you have to do is check those two slots in cf_multiplayer_team_is_available.
Make sure to initialize the slots when the player joins the server to 'can't join team' value (it is whatever you decide, preferably 0).