AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [CSTRIKE] Invalid player 3/2 (https://forums.alliedmods.net/showthread.php?t=296459)

Fuck For Fun 04-21-2017 14:00

[CSTRIKE] Invalid player 3/2
 
Code:

public rotar()
{
        for ( i = 1 ; i <= get_maxplayers (); i ++)
        {
                switch( cs_get_user_team ( i ))
                {
                        case CS_TEAM_T : cs_set_user_team ( i , CS_TEAM_CT )
                        case CS_TEAM_CT : cs_set_user_team ( i , CS_TEAM_T )
                }
        }
        return PLUGIN_HANDLED ;
}

Code:

public logevent_round_end ()
{

        for ( i = 1 ; i <= get_maxplayers (); i ++)
        {
                switch( cs_get_user_team ( i ))
        {

        case CS_TEAM_T :
        {
                set_user_frags ( i , get_user_frags ( i ) + get_pcvar_num ( cvar_frag ))
                ColorChat(0, NORMAL, "Terrorists Win 1 Frag for winning the round." )
        }
                case CS_TEAM_CT : ColorChat(0, NORMAL, "Counter-Terrorists Win the round, Change Teams!" ), rotar ()
        }
}
}

PHP Code:

register_logevent "logevent_round_end" "1=Round_End" 


HamletEagle 04-21-2017 14:31

Re: [CSTRIKE] Invalid player 3/2
 
Ever heard of get_players? Also the case should be after the switch. Does this even compile?


All times are GMT -4. The time now is 17:54.

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