Jockie Posted March 12, 2010 Posted March 12, 2010 I want to create a teleport. (As you can see at the code) Don't ask: Why /home @ commandHandler?: because I want "//home" as command. ^.^ The console says that there is a bad argument at getElementDimension.. (Oh fricking dimensions) Why only dimension 0? That's secret. This is just a small part. ^^ player = source veh = getPedOccupiedVehicle(source) dimension = getElementDimension(source) function teleHome () if dimension == 0 then if not veh then setElementPosition( player, 405.25030517578, 2436.3159179688, 17.747388839722) else setElementPosition( veh, 423.39221191406, 2522.8637695313, 16.484375) end end end addCommandHandler ( "/home", teleHome) I've also tested: veh = getPedOccupiedVehicle(player) dimension = getElementDimension(player) function teleHome () if dimension == 0 then if not veh then setElementPosition( player, 405.25030517578, 2436.3159179688, 17.747388839722) else setElementPosition( veh, 423.39221191406, 2522.8637695313, 16.484375) end end end addCommandHandler ( "/home", teleHome)
Jumba' Posted March 12, 2010 Posted March 12, 2010 Try this function teleHome ( source, command ) local veh = getPedOccupiedVehicle(source) local dimension = getElementDimension(source) if dimension == 0 then if not veh then setElementPosition( source, 405.25030517578, 2436.3159179688, 17.747388839722) else setElementPosition( veh, 423.39221191406, 2522.8637695313, 16.484375) end end end addCommandHandler ( "/home", teleHome)
Jockie Posted March 12, 2010 Author Posted March 12, 2010 Try this function teleHome ( source, command ) local veh = getPedOccupiedVehicle(source) local dimension = getElementDimension(source) if dimension == 0 then if not veh then setElementPosition( source, 405.25030517578, 2436.3159179688, 17.747388839722) else setElementPosition( veh, 423.39221191406, 2522.8637695313, 16.484375) end end end addCommandHandler ( "/home", teleHome) Doesn't work. Still bad argument @ getElementDimension.
Jumba' Posted March 12, 2010 Posted March 12, 2010 Try this function teleHome ( source, command ) local veh = getPedOccupiedVehicle(source) local dimension = getElementDimension(source) if dimension == 0 then if not veh then setElementPosition( source, 405.25030517578, 2436.3159179688, 17.747388839722) else setElementPosition( veh, 423.39221191406, 2522.8637695313, 16.484375) end end end addCommandHandler ( "/home", teleHome) Doesn't work. Still bad argument @ getElementDimension. Is the script client-side or serverside? If its client side then try this. function teleHome ( ) local player = getLocalPlayer() local veh = getPedOccupiedVehicle(player) local dimension = getElementDimension(player) if dimension == 0 then if not veh then setElementPosition( player, 405.25030517578, 2436.3159179688, 17.747388839722) else setElementPosition( veh, 423.39221191406, 2522.8637695313, 16.484375) end end end addCommandHandler ( "/home", teleHome)
Jockie Posted March 12, 2010 Author Posted March 12, 2010 Only the client-side is working, except the vehicle teleport. I hate when It's only working at client-side. And luac5.1.exe is not working, it's getting better and better! X.X
Jumba' Posted March 12, 2010 Posted March 12, 2010 Only client-side. I hate when It's only working at client-side. And luac5.1.exe is not working, it's getting better and better! X.X Well did the client-side version of the script work?
Jockie Posted March 12, 2010 Author Posted March 12, 2010 Yes, only client-side script is working. The vehicle teleport was not working, but I've turned: if not veh then setElementPosition( player, 405.25030517578, 2436.3159179688, 17.747388839722) else setElementPosition( veh, 423.39221191406, 2522.8637695313, 16.484375) end Into: if veh then setElementPosition( veh, 423.39221191406, 2522.8637695313, 16.484375) else setElementPosition( player, 405.25030517578, 2436.3159179688, 17.747388839722) end And now it's working.
dzek (varez) Posted March 12, 2010 Posted March 12, 2010 one thing, i didnt read the whole post, but when adding command handler use "home" not "/home"
Jumba' Posted March 12, 2010 Posted March 12, 2010 one thing, i didnt read the whole post, butwhen adding command handler use "home" not "/home" He wants the command to be //home
Jockie Posted March 12, 2010 Author Posted March 12, 2010 Because there is some other places I want to add. And the short name of it is SS, SkyScraper. Freeroam resource is also installed on the server. So.. Freeroam + /ss = SetSkin + SkyScraper teleport. If I use for all the teleports / and for the SkyScraper //ss. You would think: What the hell? Why double /?
Michael_Tuner Posted March 14, 2010 Posted March 14, 2010 I know this mode, This is from a server of SA:MP. GamerX I think.
Jockie Posted March 14, 2010 Author Posted March 14, 2010 *Grrrrr*... How did you know? Nah j/k, I know, but the real thought about it is above your post.
Michael_Tuner Posted March 14, 2010 Posted March 14, 2010 ya, You good dude. I can make maps for you, if you want.
Jockie Posted March 14, 2010 Author Posted March 14, 2010 Nah, not needed. The map of my server is almost full with stunts.
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