How i make a bool to block and unblock the value of the honey block... like in a menu ... turn on the honey at the player and turn off.
The Code:
PHP Code:
actionHoney(id)
{
new taskid = TASK_HONEY + id;
//make player feel like they're stuck in honey by lowering their maxspeed
set_user_maxspeed(id, 50.0);
//remove any existing 'in honey' task
if (task_exists(taskid))
{
remove_task(taskid);
}
else
{
//half the players velocity the first time they touch it
new Float:vVelocity[3];
entity_get_vector(id, EV_VEC_velocity, vVelocity);
vVelocity[0] = vVelocity[0] / 2.0;
vVelocity[1] = vVelocity[1] / 2.0;
entity_set_vector(id, EV_VEC_velocity, vVelocity);
}
//set task to remove 'in honey' effect very soon (task replaced if player is still in honey before task time reached)
set_task(0.1, "taskNotInHoney", taskid);
}