Adding to an array?
#10

So, if I was to add a check to see if the chosen number has already been used, i'd do something like this?
pawn Код:
for(new i = 0; i < sizeof(UsedObjsID); i++) {
        if(ChosenObj == UsedObjsID[i]) {
            ChosenObj = randomex(0, TotalObjs);
            format(string, sizeof string, "INFO: {FFFFFF}ObjectID: %d has already been used! Looking for another object", ChosenObj-1);
            SendClientMessageToAll(COLOR_ASKQ, string);
            format(string, sizeof string, "TEST: {FFFFFF}ObjectID: %d", UsedObjsID[i]);
            SendClientMessageToAll(COLOR_ASKQ, string);
            return 1;
        }
    }
Reply


Messages In This Thread
Adding to an array? - by Luis- - 01.08.2012, 01:45
Re: Adding to an array? - by Squirrel - 01.08.2012, 03:03
Re: Adding to an array? - by Luis- - 01.08.2012, 03:21
Re: Adding to an array? - by Arca - 01.08.2012, 03:25
Re: Adding to an array? - by Luis- - 01.08.2012, 03:38
Re: Adding to an array? - by Luis- - 01.08.2012, 13:52
Re: Adding to an array? - by Disturn - 01.08.2012, 14:08
Re: Adding to an array? - by Luis- - 01.08.2012, 14:21
Re: Adding to an array? - by Disturn - 01.08.2012, 14:36
Re: Adding to an array? - by Luis- - 01.08.2012, 14:57

Forum Jump:


Users browsing this thread: 1 Guest(s)