10.08.2014, 00:16
Yeah, it removes only the first block because you kill the loop (which is on your command) (using return) once you realise that a block isn't close to a player. Instead of killing the loop, you should let it continue checking on other blocks. I dunno how the for-loop in your command is needed, check this:
Also, if you want it to remove more than one roadblock, you should remove the (return 1;) on your DeleteClosestRoadblock function.
pawn Код:
CMD:rrb(playerid, params[]) // removing closest roadblock command
{
new result = DeleteClosestRoadblock(playerid);
if(result == 0)
// failure - no close enough roadblocks
else
// success - found a close roadblock and deleted it
return 1;
}