Jump to content

[In need of Professional scripters]


Hogan1996

Recommended Posts

I am starting  a new server for MTA and need a little help with scripting, if you are able to help me out with any questions I may need to ask please add my discord "FrankHogan#2619"

I am working on a script now for spawn points here is the code
 

local spawnX, spawnY, spawnZ = 1769.55469, -1862.20325, 13.57658
    function joinhandler ()
        spawnPlayer (source, spawnX, spawnY, spawnZ)
        fadecamera (source, true)
        setcameratarget (source, spawnX, spawnY, spawnZ)
        outputchatbox ("Welcome to Los Angeles Roleplay", source)


    end addEventHandler ("onPlayerjoin", getRootElement (), joinhandler)


Problem I have having when I start the script it doesn't spawn at XYZ. When I kill myself I don't respawn either I just keep floating in the death screen.
 

Link to comment
  • Scripting Moderators
14 minutes ago, Hogan1996 said:

I am starting  a new server for MTA and need a little help with scripting, if you are able to help me out with any questions I may need to ask please add my discord "FrankHogan#2619"

I am working on a script now for spawn points here is the code
 

local spawnX, spawnY, spawnZ = 1769.55469, -1862.20325, 13.57658
    function joinhandler ()
        spawnPlayer (source, spawnX, spawnY, spawnZ)
        fadecamera (source, true)
        setcameratarget (source, spawnX, spawnY, spawnZ)
        outputchatbox ("Welcome to Los Angeles Roleplay", source)


    end addEventHandler ("onPlayerjoin", getRootElement (), joinhandler)


Problem I have having when I start the script it doesn't spawn at XYZ. When I kill myself I don't respawn either I just keep floating in the death screen.
 

Next time use this:

bp0bz4A.png

To show your code, it will help in readability for others.

About problem, i doubt that you check /debugscript 3 for errors/warnings, without debug you couldn't go any further, trust me.

Lua is case sensitive

Fixed code:

local spawnX, spawnY, spawnZ = 1769.55469, -1862.20325, 13.57658

function joinHandler()
	spawnPlayer(source, spawnX, spawnY, spawnZ)
	fadeCamera(source, true) -- case sensitive
	setCameraTarget(source) -- case sensitive + there's no such arguments like x, y, z
	outputChatBox("Welcome to Los Angeles Roleplay", source)
end
addEventHandler("onPlayerJoin", getRootElement(), joinHandler)

 

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...