MRThinker Posted July 9, 2018 Share Posted July 9, 2018 how to use /gotobeach and teleport myself to los santos Beach ? please fast answer me @Galactix you can help me ? Link to comment
Galactix Posted July 9, 2018 Share Posted July 9, 2018 function goToBeach() setElementPosition(source, 343.20026, -1780.60388, 5.22299) end addCommandHandler("gotobeach", goToBeach) Don't forget to add a Thanks reaction if it helped Link to comment
MRThinker Posted July 9, 2018 Author Share Posted July 9, 2018 [2018-07-10 00:20:43] WARNING: beach\server.lua:75: Bad argument @ 'setElementPosition' [Expected element at argument 1, got nil] [2018-07-10 00:20:49] WARNING: beach\server.lua:75: Bad argument @ 'setElementPosition' [Expected element at argument 1, got nil] errors! Link to comment
Galactix Posted July 9, 2018 Share Posted July 9, 2018 (edited) function goToBeach() setElementPosition(localPlayer, 343.20026, -1780.60388, 5.22299) end addCommandHandler("gotobeach", goToBeach) Edited July 9, 2018 by Galactix Link to comment
MRThinker Posted July 9, 2018 Author Share Posted July 9, 2018 @Galactix your scripts is best scripts! the problem in my gamemode! you can make a gamemode RPG for me? thanks Link to comment
MRThinker Posted July 10, 2018 Author Share Posted July 10, 2018 12 hours ago, Galactix said: function goToBeach() setElementPosition(localPlayer, 343.20026, -1780.60388, 5.22299) end addCommandHandler("gotobeach", goToBeach) this script is not Working ... Link to comment
Discord Moderators Pirulax Posted July 10, 2018 Discord Moderators Share Posted July 10, 2018 Because it should be client-side, which is dumb. addCommandHandler("gotobeach", function goToBeach(source) setElementPosition(source, 343.20026, -1780.60388, 5.22299) end ) Link to comment
MRThinker Posted July 10, 2018 Author Share Posted July 10, 2018 4 hours ago, Pirulax said: Because it should be client-side, which is dumb. addCommandHandler("gotobeach", function goToBeach(source) setElementPosition(source, 343.20026, -1780.60388, 5.22299) end ) this is a client side ? Link to comment
Mr.Loki Posted July 10, 2018 Share Posted July 10, 2018 5 minutes ago, MRThinker said: this is a client side ? It's server side. Link to comment
MRThinker Posted July 10, 2018 Author Share Posted July 10, 2018 10 hours ago, Pirulax said: Because it should be client-side, which is dumb. addCommandHandler("gotobeach", function goToBeach(source) setElementPosition(source, 343.20026, -1780.60388, 5.22299) end ) not working Link to comment
Mr.Loki Posted July 11, 2018 Share Posted July 11, 2018 addCommandHandler("gotobeach", function(plr) setElementPosition(plr, 343.20026, -1780.60388, 5.22299) end ) Link to comment
MRThinker Posted July 11, 2018 Author Share Posted July 11, 2018 1 hour ago, Mr.Loki said: addCommandHandler("gotobeach", function(plr) setElementPosition(plr, 343.20026, -1780.60388, 5.22299) end ) your script is not working im fixed the script and work it! thanks! Link to comment
Discord Moderators Pirulax Posted July 13, 2018 Discord Moderators Share Posted July 13, 2018 *Server-side* Was tired, sorry Link to comment
EH10 Posted July 13, 2018 Share Posted July 13, 2018 addCommandHandler("gotobeach", function() spawnPlayer(source, 343.20026, -1780.60388, 5.22299,_,_) end ) Link to comment
Mr.Loki Posted July 13, 2018 Share Posted July 13, 2018 9 hours ago, EH10 said: addCommandHandler("gotobeach", function() spawnPlayer(source, 343.20026, -1780.60388, 5.22299,_,_) end ) Idk if this is a troll or not but this is a bad way of moving the player. Also the source in your code is nil @Pirulax your code didn't work because you defined a function name for an anon function. Link to comment
Discord Moderators Pirulax Posted July 14, 2018 Discord Moderators Share Posted July 14, 2018 (edited) Happens, I was tired as I said. Btw, here is the working code then: addCommandHandler("gotobeach", function(source) if (isPedDead(source)) then spawnPlayer(source, 343.20026, -1780.60388, 5.22299) else setElementPosition(source, 343.20026, -1780.60388, 5.22299) end end ) And actually, there is no predefined 'source' variable in addCommandHandler, and why would you spawn a player? Edited July 14, 2018 by Pirulax Link to comment
Infinity# Posted July 15, 2018 Share Posted July 15, 2018 teleport_s.lua addCommandHandler("gotobeach", function(player) if isElement(player) and not isPedDead(player) then setElementPosition(player, 343.20026, -1780.60388, 5.22299) outputChatBox("You have been successfully teleported to the beach.", player, 0, 200, 0, false) else outputChatBox("You must be alive in order to use this command.", player, 200, 0, 0, false) end end) meta.xml <meta> <script src="teleport_s.lua" type="server"/> </meta> http://www.mediafire.com/file/kwz7052k8tltfxf/teleport.zip Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now