I tried using IVecFVec to cast all arrays, but it still isn't working.
Here is all relevant code.
PHP Code:
new healthGain[33] // [id - health gained]
new Float:healthOrigin[33][3] // Origin for the health power
public client_connect(id)
{
powers[id] = PC_INVALID
IVecFVec({0, 0, 0}, healthOrigin[id])
}
public task_giveHealth(in[])
{
new id = str_to_num(in)
client_print(id, print_chat, "Health Task....")
new Float:now[3], Float:then[3], tmp[3]
get_user_origin(id, tmp)
IVecFVec(tmp, healthOrigin[id])
if(!healthOrigin[id][0])
{
for(new i = 0; i < 3; i++)
healthOrigin[id][i] = now[i]
}
then = healthOrigin[id]
if(xs_vec_equal(now, then) && healthGain[id] < 40)
{
client_print(id, print_chat, "Health Given")
new health = get_user_health(id) + 3
set_user_health(id, health)
healthGain[id]+= 3
}
healthOrigin[id] = now
}
task_giveHealth IS called properly. (it prints "Health task...")
__________________