spawnPlayer

Revision as of 13:00, 29 October 2024 by Mex (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Function Server and Client icon-iii.png icon-vc.png icon-sa.png icon-iv.png Online and Offline

Available since Server 1.0.0, Client 1.0.0
Server:

void spawnPlayer(Client client, Vec3 position, [ float zRotation = 0.0 ], [ int skin = 0 ], [ int interior = 0 ], [ int dimension = 0 ])

Client:

void spawnPlayer(Vec3 position, [ float zRotation = 0.0 ], [ int skin = 0 ], [ int interior = 0 ])

The spawnPlayer function is used to spawn a player.

If spawnPlayer is used client-side, there will be no network player for the spawned player, and localClient.player will not be set client-side.

Parameters

1) Client client The client to spawn the player for. Server only.
2) Vec3 position The 3D position to spawn the player.
3) float zRotation Optional, defaults to 0.0. The Z rotation (heading) for the player.
4) int skin Optional, defaults to 0. The skin ID for the player.
5) int interior Optional, defaults to 0. The interior ID for the player.
6) int dimension Optional, defaults to 0. The dimension ID for the player. Server only.

Return

void This function doesn't return a value.

Notes

There aren't any notes for this function.

Examples

There aren't any examples for this function.

Compatibility

There isn't any compatibility information for this function.

Related

Server Related

        getPlayerCount
        getPlayers
        gta.createPlayer
        localPlayer
        spawnPlayer

        player.armour
        player.children
        player.clearExistsFor
        player.dimension
        player.existsFor
        player.getData
        player.getRotation
        player.giveWeapon
        player.heading
        player.health
        player.id
        player.interior
        player.isCreatedFor
        player.isEnteringVehicle
        player.isExitingVehicle
        player.isLocal
        player.isOwner
        player.isSyncer
        player.isType
        player.matrix
        player.modelIndex
        player.name
        player.netFlags
        player.parent
        player.position
        player.removeAllData
        player.removeData
        player.resource
        player.rotation
        player.seat
        player.setData
        player.setExistsFor
        player.setRotation
        player.setSyncer
        player.skin
        player.streamInDistance
        player.streamOutDistance
        player.syncer
        player.syncerId
        player.turnVelocity
        player.type
        player.vehicle
        player.velocity
        player.warpIntoVehicle
        player.weapon
        player.weaponAmmunition
        player.weaponClipAmmunition
        player.weaponState


Client Related

  createPlayer
      getPlayerCount
      getPlayers
        gta.createPlayer
        gta.setPlayerControl
  gta.shutdownAndLaunchSinglePlayerGame
        localPlayer
  setLocalPlayer
        spawnPlayer

      player.addAnimation
      player.affectedByGravity
  player.alcoholLevel
  player.alpha
        player.armour
      player.bleeding
      player.blendAnimation
      player.boundingCentre
      player.boundingMax
      player.boundingMin
      player.boundingRadius
    player.buyIceCream
    player.canBeKnockedOffBike
    player.canExitVehicle
      player.centerOfMass
  player.changeBodyPart
        player.children
      player.clearAnimations
        player.clearExistsFor
      player.clearObjective
  player.clearPointGunAt
      player.clearThreatSearch
        player.clearWeapons
      player.collisionBoxCount
      player.collisionBoxes
      player.collisionLineCount
      player.collisionLines
      player.collisionPower
      player.collisionsEnabled
      player.collisionSphereCount
      player.collisionSpheres
      player.collisionVertexCount
      player.collisionVertices
      player.contactEntity
      player.contactEntityOffset
      player.crouching
      player.crouchingTime
        player.dimension
      player.displayedMoney
      player.distanceFromCentreOfMassToBaseOfModel
  player.dropObject
    player.duck
        player.enterVehicle
        player.existsFor
        player.exitVehicle
      player.getComponentOffset
      player.getComponentPosition
      player.getControlState
        player.getData
    player.getNearestDoorPosition
    player.getNearestPassengerDoorPosition
    player.getPositionToOpenVehicleDoor
        player.getRotation
      player.getWeaponAmmunition
      player.getWeaponClipAmmunition
      player.getWeaponSlotAmmunition
      player.getWeaponSlotClipAmmunition
  player.giveHelmet
        player.giveWeapon
    player.hailTaxi
        player.heading
  player.health
        player.health
    player.heedThreats
  player.holdObject
        player.id
    player.instantVehicleExit
    player.instantVehicleJack
      player.interior
        player.invincible
      player.inWater
        player.isCreatedFor
      player.isEnteringVehicle
      player.isExitingVehicle
        player.isInVehicle
  player.island
        player.isLocal
      player.isOnScreen
        player.isOwner
        player.isSyncer
        player.isType
      player.jumping
    player.lookAt
      player.markAsNoLongerNeeded
      player.mass
        player.matrix
      player.maxArmour
      player.maxHealth
      player.maxStamina
      player.model
        player.modelIndex
      player.money
  player.money
        player.name
        player.netFlags
  player.objective
      player.onScreen
        player.parent
      player.pedType
      player.pointGunAt
  player.pointGunAtPosition
        player.position
        player.removeAllData
    player.removeBodyPart
        player.removeData
        player.removeFromVehicle
  player.removeHelmet
  player.removeNametag
        player.resource
    player.resurrect
    player.roomToBeVehicleJacked
        player.rotation
        player.runTo
    player.say
      player.seat
        player.setData
        player.setExistsFor
  player.setFightStyle
      player.setInitialState
  player.setNametag
    player.setPedStats
      player.setProofs
        player.setRotation
  player.setSeek
        player.setSyncer
      player.setThreatSearch
  player.setWaitState
    player.setWanderPath
      player.setWeaponAmmunition
      player.setWeaponClipAmmunition
      player.setWeaponSlotAmmunition
      player.setWeaponSlotClipAmmunition
      player.skin
      player.sprintTo
      player.stamina
      player.staminaDuration
  player.state
      player.status
      player.stayInSamePlace
      player.storedMoney
        player.streamInDistance
        player.streamOutDistance
        player.syncer
        player.syncerId
        player.turnVelocity
        player.type
      player.upperTorsoRotation
        player.vehicle
        player.velocity
      player.visible
  player.waitState
      player.walkStyle
        player.walkTo
        player.wantedLevel
        player.warpIntoVehicle
        player.weapon
      player.weapons
      player.weaponSlot
      player.weaponSlots
      player.weaponState