er2.createSpawn 3
Creates a spawn point at runtime and registers it in the current phase, so the respawn panel and the AI both see it.These spawns are local and are not synchronised. Call this on every client with identical values (drawing them from a shared seed is the easy way) or players will not agree on what exists.
Return value
| Return Type | Description |
|---|---|
| Number | The index of the new spawn, to be used with the other spawn functions. Returns -1 if it could not be created. |
Parameters
| Parameter | Type | Description |
|---|---|---|
| 1 | void | Where the spawn goes. A position below the water line is raised to it, so a landing craft is not buried in the seabed. |
| 2 | string | The faction this spawn belongs to, for example UnitedStates_allies. It decides which side sees it. |
| 3 | string | The squad to spawn, as listed in the squads archive. |
| 4 | Number | Optional, default 8. Radius in metres the squad is scattered over. |
| 5 | Number | Optional, default 0. 0 = players and AI, 1 = AI only, 2 = players only, 3 = disabled. |
| 6 | Number | Optional, default 0. Seconds before the spawn can be used again. |
| 7 | string | Optional. If set, the squad starts aboard this vehicle, using the keys of the vehicle database. An automatic transport also wants setSpawnVehicleDestination. |
| 8 | Number | Optional, default 0. What one player birth here takes off the faction budget. Leave it at 0 and the spawn is free. |
Examples
No examples available.
