[HELP]Random Co-ords from a file
#1

So I've got this:

pawn Код:
LoadRandomSpawnFromFile(const team[])
{
    new File:file, str[128];
    format(str, sizeof str, "CoDS/Maps/%s/%sspawns.ini", MapName, team);
    file = fopen(str, io_read);
    if (!file) return 0;
    new
      line[128],
      count = 0,
      Float:X, Float:Y, Float:Z, Float:A;

    while (fread(file, line))
    {
      if (!sscanf(line, "ffff", X, Y, Z, A))
      {
        format(str, sizeof str, "%f %f %f %f",X, Y, Z, A);
        count++;
      }
    }
    fclose(file);
    return count;
}
So that formats all the team spawn points in the file, how do I then random all those possible spawns and SetPlayerPos in one of the random spawns?

I hope you understand what I mean.

Thanks.
Reply


Messages In This Thread
[HELP]Random Co-ords from a file - by Gappy - 07.09.2009, 07:31
Re: [HELP]Random from file - by Gappy - 07.09.2009, 09:45
Re: [HELP]Random Co-ords from a file - by Gappy - 08.09.2009, 03:23

Forum Jump:


Users browsing this thread: 2 Guest(s)