DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ OnAction()

override bool Building::OnAction ( int action_id,
Man player,
ParamsReadContext ctx )
inlineprotected

См. определение в файле 3_Game/DayZ/Entities/Building.c строка 219

220 {
221 if (super.OnAction(action_id, player, ctx))
222 return true;
223
224 if (g_Game.IsClient() || !g_Game.IsMultiplayer())
225 {
226 switch (action_id)
227 {
228 case EActions.GIZMO_OBJECT:
229 if (GetGizmoApi())
231 return true;
232 }
233 }
234
235 switch (action_id)
236 {
237 case EActions.BUILDING_PLAY_DOOR_SOUND:
238 PlayDoorSound(GetNearestDoorBySoundPos(player.GetPosition()));
239 return true;
240 }
241
242 if (!g_Game.IsServer())
243 return false;
244
245 switch (action_id)
246 {
247 case EActions.BUILDING_OUTPUT_LOG:
249 return true;
250 case EActions.BUILDING_OPEN_DOOR:
251 OpenDoor(GetNearestDoorBySoundPos(player.GetPosition()));
252 return true;
253 case EActions.BUILDING_CLOSE_DOOR:
254 CloseDoor(GetNearestDoorBySoundPos(player.GetPosition()));
255 return true;
256 case EActions.BUILDING_LOCK_DOOR:
257 LockDoor(GetNearestDoorBySoundPos(player.GetPosition()));
258 return true;
259 case EActions.BUILDING_UNLOCK_DOOR:
260 UnlockDoor(GetNearestDoorBySoundPos(player.GetPosition()));
261 return true;
262 }
263
264 return false;
265 }
DayZGame g_Game
Определения DayZGame.c:4074
EActions
Определения EActions.c:2
proto GizmoApi GetGizmoApi()
proto native void OpenDoor(int index)
Attempts to open the door.
proto native void LockDoor(int index, bool force=false)
Locks the door if not already locked, resets the door health. 'force = true' will close the door if o...
int GetNearestDoorBySoundPos(vector position)
Gets the nearest door based on the sound position (quick and dirty function for debugging)
Определения 3_Game/DayZ/Entities/Building.c:82
proto native void CloseDoor(int index)
Attempts to close the door.
proto native void PlayDoorSound(int index)
Plays the appropriate sound at the door, based on animation phase and state.
proto native void UnlockDoor(int index, bool animate=true)
Unlocks the door if locked, AJAR animation optional.
proto native void OutputDoorLog()
Requires special build as logging is disabled even on internal builds due to memory usage....
proto void SelectObject(Object object)

Перекрестные ссылки CloseDoor(), g_Game, GetGizmoApi(), GetNearestDoorBySoundPos(), LockDoor(), EntityAI::Man(), OpenDoor(), OutputDoorLog(), PlayDoorSound(), GizmoApi::SelectObject() и UnlockDoor().