[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
#2

Still haven't figured it out.
Reply
#3

I know bumping is bad, but I'm really stuck on this.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)