'Looping' Problem!
#4

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:

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;
}
Also, if you want it to remove more than one roadblock, you should remove the (return 1;) on your DeleteClosestRoadblock function.
Reply


Messages In This Thread
'Looping' Problem! - by Juvanii - 09.08.2014, 23:52
Re: 'Looping' Problem! - by Zezombia - 10.08.2014, 00:11
Re: 'Looping' Problem! - by Juvanii - 10.08.2014, 00:16
Re: 'Looping' Problem! - by [KHK]Khalid - 10.08.2014, 00:16
Re: 'Looping' Problem! - by Juvanii - 10.08.2014, 00:20
Re: 'Looping' Problem! - by [KHK]Khalid - 10.08.2014, 00:22
Re: 'Looping' Problem! - by Juvanii - 10.08.2014, 00:32
Re: 'Looping' Problem! - by [KHK]Khalid - 10.08.2014, 00:41
Re: 'Looping' Problem! - by Juvanii - 10.08.2014, 08:57
Re: 'Looping' Problem! - by Stanford - 10.08.2014, 09:35

Forum Jump:


Users browsing this thread: 1 Guest(s)