AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Block VIP player? (Assassination Mode) (https://forums.alliedmods.net/showthread.php?t=309477)

SkumTomteN 07-27-2018 16:53

Block VIP player? (Assassination Mode)
 
Is it possible to block/override or change the vip player in assassination mode? (as_)

cs_set_user_vip does not change vip status internally, only visually.

I want to block vip for bots.

E1_531G 07-27-2018 18:08

Re: Block VIP player? (Assassination Mode)
 
Take a look on Objective Reset by HamletEagle.

SkumTomteN 07-27-2018 18:49

Re: Block VIP player? (Assassination Mode)
 
Quote:

Originally Posted by E1_531G (Post 2606494)
Take a look on Objective Reset by HamletEagle.

Can it be done without orpheu?

HTML Code:

                case Obj_ResetVip:
                {
                        new Players[32], Num
                        get_players(Players, Num, "ae", "CT")
                       
                        if(Num > 1)
                        {
                                new OldVip = get_gamerules_data("m_pVIP")
                               
                                if(is_user_alive(OldVip) && !get_pdata_bool(OldVip, m_bEscaped))
                                {
                                        //RemoveCurrentVIP does not fix the score attrib and armor
                                        message_begin(SendReliableMessages ? MSG_ALL : MSG_BROADCAST, gmsgScoreAttrib)
                                        {
                                                write_byte(OldVip)
                                                write_byte(0)
                                                message_end()
                                        }
                                       
                                        cs_set_user_armor(OldVip, 100, CS_ARMOR_KEVLAR)
                                        cs_set_user_bpammo(OldVip, CSW_USP, 24)
                                        cs_set_weapon_ammo(find_ent_by_owner(-1, "weapon_usp", OldVip), 12)
                                       
                                        /*
                                                |        The function will choose the next vip and reset the current one if this offset is above 2.
                                                |  We force that by altering the offset.
                                                |        I don't like much that, but there is no other way. Also, I believe it won't fuck up something
                                                |        The offset is immediately resetted to 0 and increased. This is default game behaviour.
                                        */
                                       
                                        set_gamerules_data("m_iConsecutiveVip", 3)
                                       
                                        SendHookableCalls ?
                                                OrpheuCallSuper(HandleHooks[PickNextVip], g_pGameRules) :
                                                OrpheuCall(HandleHooks[PickNextVip], g_pGameRules)
                                               
                                        set_gamerules_data("m_iConsecutiveVip", get_gamerules_data("m_iConsecutiveVip") + 1)
                                       
                                        new NewVip = get_gamerules_data("m_pVIP")
                                       
                                        if(1 <= NewVip <= MaxPlayers)
                                        {
                                                SendHookableCalls ?
                                                        ExecuteHamB(Ham_CS_RoundRespawn, NewVip) :
                                                        ExecuteHam(Ham_CS_RoundRespawn, NewVip)
                                               
                                                SuccesfullReset = true
                                        }
                                }
                        }
                }



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

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