Jump to content

Need help at changing spawn location


Dadcdai

Recommended Posts

Hey i tryed so hard to change the spawn location when you (Create) ur character, but whenere i change somthing in it, it wont work or it gives me erros,

can someone tell me how to change the location when you (Create) ur character?

 

Here this is the code:

local locationToSpawn = {}

                if location then -- if this is not a newly created character spawn, location would be nil /maxime

                        --outputDebugString("this is a newly created character spawn.")

                        locationToSpawn.x = location[1]

                        locationToSpawn.y = location[2]

                        locationToSpawn.z = location[3]

                        locationToSpawn.rot = location[4]

                        locationToSpawn.int = location[5]

                        locationToSpawn.dim = location[6]

                else --Otherwise, spawn normally for old characters. Fetch location from database. /maxime

                        locationToSpawn.x = tonumber(characterData["x"])

                        locationToSpawn.y = tonumber(characterData["y"])

                        locationToSpawn.z = tonumber(characterData["z"])

                        locationToSpawn.rot = tonumber(characterData["rotation"])

                        locationToSpawn.int = tonumber(characterData["interior_id"])

                        locationToSpawn.dim = tonumber(characterData["dimension_id"])

                end

                spawnPlayer(client, locationToSpawn.x ,locationToSpawn.y ,locationToSpawn.z , locationToSpawn.rot, tonumber(characterData["skin"]))

                setElementDimension(client, locationToSpawn.dim)

                setElementInterior(client, locationToSpawn.int , locationToSpawn.x, locationToSpawn.y, locationToSpawn.z)

                setCameraInterior(client, locationToSpawn.int)

Link to comment

How?

   local locationToSpawn = {}
                if location then -- if this is not a newly created character spawn, location would be nil /maxime
                        --outputDebugString("this is a newly created character spawn.")
                        locationToSpawn.x = location[1]
                        locationToSpawn.y = location[2]
                        locationToSpawn.z = location[3]
                        locationToSpawn.rot = location[4]
                        locationToSpawn.int = location[5]
                        locationToSpawn.dim = location[6]
                else --Otherwise, spawn normally for old characters. Fetch location from database. /maxime
                        locationToSpawn.x = tonumber(characterData["x"])
                        locationToSpawn.y = tonumber(characterData["y"])
                        locationToSpawn.z = tonumber(characterData["z"])
                        locationToSpawn.rot = tonumber(characterData["rotation"])
                        locationToSpawn.int = tonumber(characterData["interior_id"])
                        locationToSpawn.dim = tonumber(characterData["dimension_id"])
                end
                spawnPlayer(client, -203.65929 ,1119.41309 ,19.74219 , 0, tonumber(characterData["skin"]))
                setElementDimension(client, 0)
                setElementInterior(client, 0 , 0, 0, 0)
                setCameraInterior(client, 0)
   local locationToSpawn = {}
                if location then -- if this is not a newly created character spawn, location would be nil /maxime
                        --outputDebugString("this is a newly created character spawn.")
                        locationToSpawn.x = location[1]
                        locationToSpawn.y = location[2]
                        locationToSpawn.z = location[3]
                        locationToSpawn.rot = location[4]
                        locationToSpawn.int = location[5]
                        locationToSpawn.dim = location[6]
                else --Otherwise, spawn normally for old characters. Fetch location from database. /maxime
                        locationToSpawn.x = tonumber(characterData["x"])
                        locationToSpawn.y = tonumber(characterData["y"])
                        locationToSpawn.z = tonumber(characterData["z"])
                        locationToSpawn.rot = tonumber(characterData["rotation"])
                        locationToSpawn.int = tonumber(characterData["interior_id"])
                        locationToSpawn.dim = tonumber(characterData["dimension_id"])
                end
                spawnPlayer(client, -203.65929 ,1119.41309 ,19.74219 , 0, tonumber(characterData["skin"]))
                setElementDimension(client, 0)
                setElementInterior(client, 0 , 0, 0, 0)
                setCameraInterior(client, 0)

 

here it is:

   local locationToSpawn = {}
                if location then -- if this is not a newly created character spawn, location would be nil /maxime
                        --outputDebugString("this is a newly created character spawn.")
                        locationToSpawn.x = location[1]
                        locationToSpawn.y = location[2]
                        locationToSpawn.z = location[3]
                        locationToSpawn.rot = location[4]
                        locationToSpawn.int = location[5]
                        locationToSpawn.dim = location[6]
                else --Otherwise, spawn normally for old characters. Fetch location from database. /maxime
                        locationToSpawn.x = tonumber(characterData["x"])
                        locationToSpawn.y = tonumber(characterData["y"])
                        locationToSpawn.z = tonumber(characterData["z"])
                        locationToSpawn.rot = tonumber(characterData["rotation"])
                        locationToSpawn.int = tonumber(characterData["interior_id"])
                        locationToSpawn.dim = tonumber(characterData["dimension_id"])
                end
                spawnPlayer(client, -203.65929 ,1119.41309 ,19.74219 , 0, tonumber(characterData["skin"]))
                setElementDimension(client, 0)
                setElementInterior(client, 0 , 0, 0, 0)
                setCameraInterior(client, 0)

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...