Hello there! I'll make it short. We've got the following code:
Code:
public abilities(id)
{
if(a_invisibility[id] && !a_stoneshield[id] && !a_rage[id])
{
set_task(0.1, "invisibilitydo")
}
if(!a_invisibility[id] && a_stoneshield[id] && !a_rage[id])
{
set_task(0.1, "stoneshielddo")
}
if(!a_invisibility[id] && !a_stoneshield[id] && a_rage[id])
{
set_task(0.1, "ragedo")
}
if(!a_invisibility[id] && !a_stoneshield[id] && !a_rage[id])
{
return PLUGIN_HANDLED
}
}
I'd want to use this code in a plugin, and that, from what I've read, would cause a lot of processor branching, thus making the plugin work harder and giving the processor a hard job. I'd like to know how is it possible to optimise it to do the same thing (from what I know up until now, it should be done through a "switch" command, but I guess there are other different ways either).
__________________