NPC/IsCurrentSchedule

From Garry's Mod
Jump to: navigation, search
 NPC:IsCurrentSchedule( )

Contents

Description

Returns whether or not the NPC is performing the given schedule.

Arguments

number schedule

The schedule number, see SCHED_ Enums.

Returns

boolean

True if the NPC is performing the given schedule, false otherwise.

Examples

Example

Function which returns the schedule an NPC is performing.

function GetNPCSchedule(npc)

	if(!IsValid(npc)) then return end
	
	for s = 0, LAST_SHARED_SCHEDULE-1 do
		if(npc:IsCurrentSchedule(s)) then return s end
	end
	
	return 0
	
end


Personal tools
Navigation