08.09.2010, 21:09
Ok, so say a race started. Player id 0 would get teleported to 1 place and id 1 the next and id 2 another place ect. My friend made one but it gave errors so i deleted it. Example thx?
new StartingPositions[10]; //10 positions (change to match your needs...)
new PlayerStartingPosID[MAX_PLAYERS];
for(new i; i <= MAX_PLAYERS; i++)
{
PlayerStartingPosID[i] = -1;
if(IsPlayerConnected(i)) {
if(PlayerStartingPosID[i] == -1) {
for(new startingpos; startingpos <= sizeof(StartingPositions)) {
if(!StartingPositions[startingpos] && PlayerStartingPosID[i] == -1) StartingPositions[startingpos]++, PlayerStartingPosID[i] = startingpos;
}
}
}
}
//Then simply... (in another function, otherwise change i to something else)
for(new i; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i)) {
if(PlayerStartingPosID[i] != -1) {
//SetPlayerPos(...) Use PlayerStartingPosID[i] to get the starting ID then assign the player to the coordinates.
}
}
}