[OPEN] How divide player and could not enter the trade zone of the other

Karpenator

New Member
Tell your comrades how to divide all players into two "factions", when entering the server, the player is given one of two armbands (black or yellow randomly), if it is black, the player will be spawned near one trade, if yellow, then next to another. I want to divide according to this principle, it is necessary to divide the players into two factions, so that the members of one faction could not enter the trade zone of the other.

Code:
ItemBase Armband  = oPlayer.GetHumanInventory().FindAttachment(InventorySlots.ARMBAND);
    if(!Armband)
    {
        int rndFraction = Math.RandomInt(0,100);
        if (rndFraction >= 50)
        {
            item = oPlayer.GetInventory().CreateInInventory( "Armband_Black" );
        }
        else
        {
            item = oPlayer.GetInventory().CreateInInventory( "Armband_Yellow" );
        }
        InventoryLocation inventory_location = new InventoryLocation;
        Armband.GetInventory().GetCurrentInventoryLocation( inventory_location );
        oPlayer.GetInventory().SetSlotLock( inventory_location.GetSlot(), true );
    }
    else
    {
        //Armband.Delete();
    }
 
Top