MRThinker Posted July 9, 2018 Posted July 9, 2018 how to use /gotobeach and teleport myself to los santos Beach ? please fast answer me @Galactix you can help me ?
Galactix Posted July 9, 2018 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 If I helped you, make sure you click the reaction button on the right to support me! It will grant me more visibility and will help me to help others!If you have any kind of request or subject you would like to discuss about with me, don't hesitate to send me a private message about it!
MRThinker Posted July 9, 2018 Author 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!
Galactix Posted July 9, 2018 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 If I helped you, make sure you click the reaction button on the right to support me! It will grant me more visibility and will help me to help others!If you have any kind of request or subject you would like to discuss about with me, don't hesitate to send me a private message about it!
MRThinker Posted July 9, 2018 Author Posted July 9, 2018 @Galactix your scripts is best scripts! the problem in my gamemode! you can make a gamemode RPG for me? thanks
Galactix Posted July 9, 2018 Posted July 9, 2018 Go in private messages. 1 If I helped you, make sure you click the reaction button on the right to support me! It will grant me more visibility and will help me to help others!If you have any kind of request or subject you would like to discuss about with me, don't hesitate to send me a private message about it!
MRThinker Posted July 10, 2018 Author 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 ...
Moderators Pirulax Posted July 10, 2018 Moderators 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 )
MRThinker Posted July 10, 2018 Author 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 ?
Mr.Loki Posted July 10, 2018 Posted July 10, 2018 5 minutes ago, MRThinker said: this is a client side ? It's server side. [REL]Cinema Experience Beta 2.0 [TUT]Object offsets with OOP. [TUT] Adding a Discord bot to your server. Discord: Loki#7355
MRThinker Posted July 10, 2018 Author 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
Mr.Loki Posted July 11, 2018 Posted July 11, 2018 addCommandHandler("gotobeach", function(plr) setElementPosition(plr, 343.20026, -1780.60388, 5.22299) end ) [REL]Cinema Experience Beta 2.0 [TUT]Object offsets with OOP. [TUT] Adding a Discord bot to your server. Discord: Loki#7355
MRThinker Posted July 11, 2018 Author 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!
Moderators Pirulax Posted July 13, 2018 Moderators Posted July 13, 2018 *Server-side* Was tired, sorry
EH10 Posted July 13, 2018 Posted July 13, 2018 addCommandHandler("gotobeach", function() spawnPlayer(source, 343.20026, -1780.60388, 5.22299,_,_) end ) Old Nick : MaxUr , #Skype : maxurmaxur BBM : 577287FC
Mr.Loki Posted July 13, 2018 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. [REL]Cinema Experience Beta 2.0 [TUT]Object offsets with OOP. [TUT] Adding a Discord bot to your server. Discord: Loki#7355
Moderators Pirulax Posted July 14, 2018 Moderators 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
Infinity# Posted July 15, 2018 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
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