I want to make a icon show on the HUD when the player is not moving, so would setting a task for this every 0.1 seconds affect the server performance in any way? Is there a better way of doing this?
PHP Code:
set_task(0.1, "some_function", id, "", 0, "b", 0)
public some_function(id)
{
new Float:fVecVelocity[3]
entity_get_vector(id, EV_VEC_velocity, fVecVelocity)
iSpeed = floatround(vector_length(fVecVelocity))
message_begin(MSG_ONE, get_user_msgid("StatusIcon"), {0, 0, 0}, id)
write_byte(!iSpeed ? 1 : 0)
write_string(szSpriteName)
write_byte(0)
write_byte(154)
write_byte(255)
message_end()
}