added request amb285
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40828
This commit is contained in:
		
							parent
							
								
									459a9d41ba
								
							
						
					
					
						commit
						314e7097f8
					
				@ -227,10 +227,22 @@ static cell_t smn_TriggerTimer(IPluginContext *pCtx, const cell_t *params)
 | 
			
		||||
	return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static cell_t smn_GetTickedTime(IPluginContext *pContext, const cell_t *params)
 | 
			
		||||
{
 | 
			
		||||
	cell_t *simulating;
 | 
			
		||||
	pContext->LocalToPhysAddr(params[1], &simulating);
 | 
			
		||||
 | 
			
		||||
	*simulating = g_SimTicks.ticking ? 0 : 1;
 | 
			
		||||
 | 
			
		||||
	float t = g_SimTicks.ticking ? gpGlobals->curtime : g_SimTicks.ticktime;
 | 
			
		||||
	return sp_ftoc(t);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
REGISTER_NATIVES(timernatives)
 | 
			
		||||
{
 | 
			
		||||
	{"CreateTimer",				smn_CreateTimer},
 | 
			
		||||
	{"KillTimer",				smn_KillTimer},
 | 
			
		||||
	{"TriggerTimer",			smn_TriggerTimer},
 | 
			
		||||
	{"GetTickedTime",			smn_GetTickedTime},
 | 
			
		||||
	{NULL,						NULL}
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@ -88,6 +88,17 @@ native KillTimer(Handle:timer, bool:autoClose=false);
 | 
			
		||||
 */
 | 
			
		||||
native TriggerTimer(Handle:timer, bool:reset=false);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Returns the simulated game time.
 | 
			
		||||
 *
 | 
			
		||||
 * @param simulated			Retrieves whether or not the tick count
 | 
			
		||||
 *							is being manually simulated by SourceMod.
 | 
			
		||||
 *							This is the case if no players have joined
 | 
			
		||||
 *							the map yet.
 | 
			
		||||
 * @return					Time based on the game tick count.
 | 
			
		||||
 */
 | 
			
		||||
native Float:GetTickedTime(&bool:simulated);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Creates a timer associated with a new data pack, and returns the datapack.
 | 
			
		||||
 * @note The datapack is automatically freed when the timer ends.
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user