Jump to content

Small problem. oO


Jockie

Recommended Posts

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

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)

Link to comment

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)

Link to comment
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. :(

Link to comment
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)

Link to comment

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.

Link to comment

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

If I use for all the teleports / and for the SkyScraper //ss.

You would think: What the hell? Why double /? :mrgreen:

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