Reverse loop fails.
#3

It's probably the fact they all have the same name, try doing this:

pawn Code:
new
    szNPCName[MAX_PLAYER_NAME],
    szIntBuf[4];

for(new i = 499; i >= 485; i--)
{
    // Set the start of string to "Suspect" for each
    // new NPC.
    szNPCName = "Suspect";

    // Convert i to a string, so we can add
    // it to the name of NPC.
    valstr(szIntBuf, i);

    // Add the number (in string form) to the
    // name "Suspect", to get result of "SuspectX"
    strcat(szNPCName, szIntBuf);

    // Create the NPC with the name that has
    // been generated.
    CreateNPC(i, szNPCName);
}
edit: Grr, I miss the "New post" warning from SMF. What was your solution?
Reply


Messages In This Thread
Reverse loop fails. - by MidnightHippie - 12.09.2010, 03:20
Re: Reverse loop fails. - by CuervO - 12.09.2010, 03:28
Re: Reverse loop fails. - by Simon - 12.09.2010, 03:35
Re: Reverse loop fails. - by CuervO - 12.09.2010, 03:45

Forum Jump:


Users browsing this thread: 2 Guest(s)