AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Stop players from re-joining team (https://forums.alliedmods.net/showthread.php?t=293629)

sinisuba 02-05-2017 12:13

Stop players from re-joining team
 
EDIT: Solved




When a player switches team, he can do it again forever. I want him to switch team and can't re-join again (in that same round).

Code:

public submenu_handler( id, menu, item )
 {
    switch( item )
    {
        case 0:
        {
            if(cs_get_user_team(id) != CS_TEAM_T)
            {
                cs_set_user_team(id, CS_TEAM_T)
                user_kill(id, 1)
            }
        }
        case 1:
        {
            if(cs_get_user_team(id) != CS_TEAM_CT)
            {
                cs_set_user_team(id, CS_TEAM_CT)
                user_kill(id, 1)
            }
        }
        case MENU_EXIT:
        {
            if ( is_user_connected( id ) )
                JailMenu( id );
        }
    }
}


edon1337 02-05-2017 12:20

Re: Stop players from re-joining team
 
Create a bool and set true when he does that, if he tries again return PLUGIN_HANDLED.

sinisuba 02-05-2017 12:54

Re: Stop players from re-joining team
 
How would i do that

edon1337 02-05-2017 13:17

Re: Stop players from re-joining team
 
It's Scripting section, you have to figure it out yourself.

Quote:

Originally Posted by Natsheh (Post 2493140)
By registering the message
Hooking

Msgid 114 for VGUIMenu
Msgid 96. For old menu

And check arguments etc..

What?

Natsheh 02-05-2017 14:01

Re: Stop players from re-joining team
 
i miss understanding ..,.


All times are GMT -4. The time now is 21:00.

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