Raised This Month: $ Target: $400
 0% 

Mysterious error messages


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Leon M.
Senior Member
Join Date: Apr 2009
Location: Germany
Old 02-03-2010 , 11:23   Mysterious error messages
Reply With Quote #1

Hi,

I have searched already but didn't found anything about my problem. I would like to check spectators and kick them after a defined time.

If I use cs_get_user_team then I get some errors like "invalid player". What's wrong with my code?

Code:
        // Alle Spieler überprüfen
        for (new id = 1; id <= g_iMaxPlayers; id++){

            new CsTeams:eTeam = cs_get_user_team(id)
            if (eTeam == CS_TEAM_SPECTATOR || eTeam == CS_TEAM_UNASSIGNED){

                g_iTime[id]++

                if (g_iTime[id] >= 10){
                    func_kick_player(id)
                }
            }
I have also tried to use only get_user_team and check for 0 but that won't work if a player transferred by cs_set_user_team. Is there a secured function to catch the team? Like an offset?

Thanks a lot for your help!
Leon M. is offline
 


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 07:24.


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