07.09.2009, 07:31
So I've got this:
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.
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;
}
I hope you understand what I mean.
Thanks.