SetSpawnInfo
Where and as what the player’s next spawn happens.
Sets the point and the outfit for the next SpawnPlayer or the spawn that follows OnPlayerRequestSpawn. The
presets are GUIDs from the game’s tables - clothing presets and
weapon presets; "" or nil keeps the server’s [spawn] defaults. appearance is the soul
whose face and body the other players see on this player’s body - a soul of the NPC or NPC_Female archetype from
the souls by name, id or GUID; "" picks one from the server’s [spawn] appearances pool by the
player’s name, so a player looks the same every visit. The point is remembered until the next SetSpawnInfo; respawns
after a death use it too.
Syntax
Section titled “Syntax”SetSpawnInfo(pid, x, y, z, yaw [, clothingPreset, weaponPreset, appearance])| Parameter | Type | |
|---|---|---|
pid |
number | the player |
x |
number | metres |
y |
number | metres |
z |
number | metres; below 0 = on the terrain |
yaw |
number | degrees to face (0 without) |
clothingPreset |
string | a clothing preset GUID; "" = the server default (optional) |
weaponPreset |
string | a weapon preset GUID; "" = the server default (optional) |
appearance |
string | the soul whose face the others see (name, id or GUID); "" = the server’s pool (optional) |
Returns
Section titled “Returns”boolean - false when not connected
Example
Section titled “Example”local RED_TEAM_OUTFIT = "52169773-0c2b-407a-a123-8b403e224718" -- UC_HenryTrosky, a clothing preset GUIDlocal LONGSWORD = "00928214-01bb-452f-b322-724cffe6ebdc" -- longsword_5_01, a weapon preset GUID
function OnPlayerRequestSpawn(pid) local x, y, z, yaw = GetRandomSpawnPoint("red") SetSpawnInfo(pid, x, y, z, yaw, RED_TEAM_OUTFIT, LONGSWORD, "test_cuman_ai") return trueendSee also
Section titled “See also”SpawnPlayer · OnPlayerRequestSpawn · GetDefaultSpawn · AddSpawnPoint · the Players group of the index
