- Joined
- Oct 19, 2014
- Messages
- 187
I need your thoughs about proper using of this.
Will this desync the game?
I need your criticism.. i am waiting 
Will this desync the game?
JASS:
private function createhero takes nothing returns nothing
local unit u=GetSoldUnit()
local player p=GetOwningPlayer(u)
local integer id=GetPlayerId(p)
local real x=0
local real y=0
local real d=0
set id:PlayersHero=u
if id<5 then
call SetUnitX(id:PP,0:FountainX+144*Cos(180*bj_DEGTORAD))
call SetUnitX(u,0:FountainX+144*Cos(180*bj_DEGTORAD))
call SetUnitY(id:PP,0:FountainY+144*Sin(180*bj_DEGTORAD))
call SetUnitY(u,0:FountainY+144*Sin(180*bj_DEGTORAD))
if GetLocalPlayer()==p then //this part sir
set x=0:FountainX
set y=0:FountainY
set d=0
set u=u
call PanCameraToTimed(x,y,d)
call ClearSelection()
call SelectUnit(u, true)
endif
else
call SetUnitX(id:PP,1:FountainX+144*Cos(0*bj_DEGTORAD))
call SetUnitX(u,1:FountainX+144*Cos(0*bj_DEGTORAD))
call SetUnitY(id:PP,1:FountainY+144*Sin(0*bj_DEGTORAD))
call SetUnitY(u,1:FountainY+144*Sin(0*bj_DEGTORAD))
if GetLocalPlayer()==p then
set x=1:FountainX
set y=1:FountainY
set d=0
set u=u
call PanCameraToTimed(x,y,d)
call ClearSelection()
call SelectUnit(u, true)
endif
endif
set ni=ni+1
if ni==NumberOfPlayers then
call RemoveUnit(tavern)
call DestroyTrigger(GetTriggeringTrigger())
call EnableTrigger(CreepsSpawnTrigger)
endif
endfunction
Last edited: