ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server events
  3. onPlayerSpawn

Event

onPlayerSpawn

A player appeared in the world (the first time or after death), e.g. after spawnPlayer.

Handler

addEventHandler("onPlayerSpawn", root, function() ... end)

Differences from MTA:SA

  • These MTA:SA parameters are not here: float posX, float posY, float posZ, float spawnRotation, team theTeam, int theSkin, int theInterior, int theDimension

In MTA:SA

function(float posX, float posY, float posZ, float spawnRotation, team theTeam, int theSkin, int theInterior, int theDimension)

Source

source is the player.

Example

addEventHandler("onPlayerSpawn", root, function()
    giveWeapon(source, 22, 60)
end)

See also