Hi Folks,
I have a function and receive a mismatch for
PHP Code:
g_iTimeCheckHeight[entity] = iRoundHeight;
The function is:
PHP Code:
public Action HealthkitGroundCheck(int entity, int activator, int caller, UseType type, float value)
{
float fOrigin[3];
GetEntPropVector(entity, Prop_Send, "m_vecOrigin", fOrigin);
float iRoundHeight = RoundFloat(fOrigin[2]);
if (iRoundHeight != g_iTimeCheckHeight[entity])
{
g_iTimeCheckHeight[entity] = iRoundHeight;
g_fTimeCheck[entity] = GetGameTime();
}
}
g_iTimeCheckHeight is a global variable which is
PHP Code:
float g_iTimeCheckHeight[2048] = {0.0, ...};
The function that calls the above function is
PHP Code:
public void OnEntityCreated(int entity, const char[] classname)
{
if (StrEqual(classname, "healthkit"))
{
Handle hDatapack;
CreateDataTimer(Healthkit_Timer_Tickrate, Healthkit, hDatapack, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
WritePackCell(hDatapack, entity);
WritePackFloat(hDatapack, GetGameTime()+Healthkit_Timer_Timeout);
g_fLastHeight[entity] = -9999.0;
g_iTimeCheckHeight[entity] = -9999.0;
SDKHook(entity, SDKHook_VPhysicsUpdate, HealthkitGroundCheck);
CreateTimer(0.1, HealthkitGroundCheckTimer, entity, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}
}
Appreciate your help,
Ozzy
__________________