What I'm trying to do is, make 2 shops, one can only be accessed by players 1-3, the other players 4-6. The only answer I could come up with is doing this in JASS, but it has a delay and players can buy items from the other persons shop if they are fast enough before the unit is unselected. This is my JASS (1 out of the 2 triggers), is there any better way to do what I'm trying to accomplish?
JASS:
function SpecialtyShop1 takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit q = udg_ShopTracker[1]
local player p = GetTriggerPlayer()
if (u==q) and (GetLocalPlayer() == p) then
call SelectUnit(u, false)
endif
set p = null
set q = null
set u = null
endfunction
function InitTrig_Shop1Unselect takes nothing returns nothing
local integer i = 3
local player p
set gg_trg_Shop1Unselect = CreateTrigger()
loop
exitwhen i > 5
set p = Player(i)
call TriggerRegisterPlayerUnitEvent(gg_trg_Shop1Unselect, p, EVENT_PLAYER_UNIT_SELECTED, null)
set i = i + 1
endloop
call TriggerAddAction(gg_trg_Shop1Unselect, function SpecialtyShop1)
set p = null
endfunction