30.06.2015, 09:26
Yea, you can try what person above said, but I don't know where you want to spawn person? at hospital, some point you specified before?
In my first response, I thouhgt you want to spawn at exact location where person died.
In case you have points where you would like to spawn. And on player's death get the closest one:
In my first response, I thouhgt you want to spawn at exact location where person died.
In case you have points where you would like to spawn. And on player's death get the closest one:
Код:
new Float:distance; new respawnID; distance = GetPlayerDistanceFromPoint(playerid, respawnPoints[0][0], respawnPoints[0][1], respawnPoints[0][2]); respawnID = 0; for(new i = 1; i < MAX_RESPAWN_POINTS; ++i) { new tempDistance = GetPlayerDistanceFromPoint(playerid, respawnPoints[i][0], respawnPoints[i][1], respawnPoints[i][2]); if(tempDistance < distance) { distance = tempDistance; respawnID = i; } } // and after this loop your coordinates you need are stored inside respawnPoints[respawnID]